/[MITgcm]/MITgcm/verification/cpl_aim+ocn/run_cpl_test
ViewVC logotype

Contents of /MITgcm/verification/cpl_aim+ocn/run_cpl_test

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download)
Sat Dec 26 23:44:03 2009 UTC (14 years, 4 months ago) by jmc
Branch: MAIN
Changes since 1.13: +16 -16 lines
minor changes

1 #! /bin/sh
2
3 # $Header: /u/gcmpack/MITgcm/verification/cpl_aim+ocn/run_cpl_test,v 1.13 2009/12/26 01:59:17 jmc Exp $
4 # $Name: $
5
6 Np=3
7 #- parse options:
8 MTH=
9 MTHo=
10 MTHa=
11 if test $1 = '-mth' ; then
12 MTH='-omp' ; shift
13 if test -f input_ocn/eedata.mth ; then MTHo=$MTH ; fi
14 if test -f input_atm/eedata.mth ; then MTHa=$MTH ; fi
15 fi
16 if [ $# -ne 1 ]
17 then
18 echo 'Usage:'`basename $0`' [opt] step'
19 echo ' => test coupled set-up on linux box (1.cpu)'
20 echo 'opt = -mth : compile and run (if eedata.mth) 2-threads for ocn & atm'
21 echo ' step = 0 : clean all directories'
22 echo ' step = 1 : compile the 3 executables (cpl,ocn,atm)'
23 echo ' step = 2 : copy input files and dir(s)'
24 echo " step = 3 : run with $Np mpi processes"
25 echo ' step = 4 : check the results'
26 echo ' step = 5 : remove output files in rank_0,1,2 dir.'
27 exit
28 fi
29 kpr=$1
30 dir=`pwd`
31
32 #============================================================================
33
34 if test $kpr = 0
35 then
36 rm -f pr_group std_outp comp_res.{ocn,atm,land,sice}
37 rm -f build_???/TTT.*make.* build_???/TTT.mkdepend.*
38 /bin/rm -r -f rank_0 rank_1 rank_2
39 if test -f build_cpl/Makefile ; then cd build_cpl ; make CLEAN ; cd .. ; fi
40 if test -f build_ocn/Makefile ; then cd build_ocn ; make CLEAN ; cd .. ; fi
41 if test -f build_atm/Makefile ; then cd build_atm ; make CLEAN ; cd .. ; fi
42 fi
43 if test $kpr = 5
44 then
45 echo 'remove output files in rank_0,1,2 dir.'
46 rm -f pr_group std_outp comp_res.{ocn,atm,land,sice}
47 if test -d rank_0 ; then cd rank_0 ; rm -f Coupler.0000.clog ; cd .. ; fi
48 if test -d rank_1
49 then cd rank_1 ; rm -f *.data *.meta STD???.0000 UV-*.0001.clog ; cd .. ; fi
50 if test -d rank_2
51 then cd rank_2 ; rm -f *.data *.meta STD???.0000 UV-*.0001.clog ; cd .. ; fi
52 fi
53
54 if test $kpr = 1
55 then
56
57 #- choice of the optfile: take a local one in dir verification with sufix '+mpi'
58 nbOpF=`ls ../linux_*+mpi 2> /dev/null | wc -l`
59 if test $nbOpF = 1
60 then
61 OPTFILE=`ls ../linux_*+mpi`
62 zz=`grep '^FC=' $OPTFILE`
63 echo " Using optfile: $OPTFILE (compiler=$zz) $MTH"
64 else echo 'Pb in finding optfile' ; exit;
65 fi
66 zz=`echo $OPTFILE | grep -c '^\/'`
67 if test $zz = 0 ; then OPTFILE="../$OPTFILE" ; fi
68 #---
69 echo '==== compile coupler:'
70 cd build_cpl
71 echo ' --- genmake2 (cpl):'
72 ../../../tools/genmake2 -of $OPTFILE -mpi -ieee > TTT.genmake.$$
73 tail -5 TTT.genmake.$$
74 echo ' --- make depend (cpl):'
75 make depend > TTT.mkdepend.$$
76 tail -5 TTT.mkdepend.$$
77 echo ' --- make (cpl):'
78 make > TTT.make.$$ 2>&1
79 tail -10 TTT.make.$$
80 echo ' ' ; cd $dir
81
82 echo '==== compile OGCM:'
83 cd build_ocn
84 echo ' --- genmake2 (ocn):'
85 ../../../tools/genmake2 -of $OPTFILE -mpi $MTHo -ieee > TTT.genmake.$$
86 tail -5 TTT.genmake.$$
87 echo ' --- make depend (ocn):'
88 make depend > TTT.mkdepend.$$
89 tail -10 TTT.mkdepend.$$
90 echo ' --- make (ocn):'
91 make > TTT.make.$$ 2>&1
92 tail -10 TTT.make.$$
93 echo ' ' ; cd $dir
94
95 echo '==== compile AGCM:'
96 cd build_atm
97 echo ' --- genmake2 (atm):'
98 ../../../tools/genmake2 -of $OPTFILE -mpi $MTHa -ieee > TTT.genmake.$$
99 tail -5 TTT.genmake.$$
100 echo ' --- make depend (atm):'
101 make depend > TTT.mkdepend.$$
102 tail -10 TTT.mkdepend.$$
103 echo ' --- make (atm):'
104 make > TTT.make.$$ 2>&1
105 tail -10 TTT.make.$$
106 echo ' ' ; cd $dir
107
108 ls -l build_???/mitgcmuv
109
110 fi
111
112 if test $kpr = 2
113 then
114 /bin/rm -r -f rank_0 rank_1 rank_2
115 echo 'CP dir:' input_cpl '->' rank_0
116 cp -p -r input_cpl rank_0
117
118 echo 'CP dir:' input_ocn '->' rank_1
119 cp -p -r input_ocn rank_1
120 cd rank_1
121 ./prepare_run
122 if test "x$MTHo" != x ; then
123 echo " MTH run: mv -f eedata.mth eedata"
124 mv -f eedata.mth eedata
125 fi
126 cd $dir
127
128 echo 'CP dir:' input_atm '->' rank_2
129 cp -p -r input_atm rank_2
130 cd rank_2
131 ./prepare_run
132 if test "x$MTHa" != x ; then
133 echo " MTH run: mv -f eedata.mth eedata"
134 mv -f eedata.mth eedata
135 fi
136 cd $dir
137
138 fi
139
140 if test $kpr = 3
141 then
142 ROOTDIR=$dir
143 rm -f rank_?/pickup*.ckptA.00?.00?.??ta
144 echo $ROOTDIR
145 tmpfil=TTT.$$
146
147 rm -f pr_group ; touch pr_group
148 nc=0; xx=`hostname`
149 for dd1 in cpl ocn atm
150 do
151 echo $xx $nc $dir/build_$dd1/mitgcmuv >> pr_group
152 nc=1
153 done
154
155 cd $ROOTDIR
156 if test "x$MTH" != x ; then
157 export OMP_NUM_THREADS=2 ; export KMP_STACKSIZE=400m
158 if test "x$MTHo" != x ; then
159 echo -n " run OCN ($MTHo) with $OMP_NUM_THREADS threads ;"
160 fi
161 if test "x$MTHa" != x ; then
162 echo -n " run ATM ($MTHa) with $OMP_NUM_THREADS threads ;"
163 fi
164 echo ""
165 fi
166 # /usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpirun.ch_gm -pg pr_group -wd $ROOTDIR --gm-kill 5 -v ./build_cpl/mitgcmuv > std_outp 2>&1
167 mpirun -p4pg pr_group -v ./build_cpl/mitgcmuv > std_outp 2>&1
168 tail -20 std_outp
169 ls -l rank_?/pickup*.ckptA.001.001.data
170
171 fi
172
173 if test $kpr = 4
174 then
175
176 if test -f rank_1/STDOUT.0000
177 then echo '==> check Ocean output:'
178 /home/jmc/bin/comp_res rank_1/STDOUT.0000 results/ocnSTDOUT.0000
179 mv -f comp_res.log comp_res.ocn
180 echo ' '
181 else echo 'No Ocean output file in rank_1' ; fi
182
183 if test -f rank_2/STDOUT.0000
184 then
185 echo '==> check Atmos output:'
186 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000
187 mv -f comp_res.log comp_res.atm
188 echo '==> check Land output:'
189 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 L
190 mv -f comp_res.log comp_res.land
191 echo '==> check thSIce output:'
192 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 I
193 mv -f comp_res.log comp_res.sice
194 echo ' '
195 else echo 'No Atmos output file in rank_2' ; fi
196
197 fi
198
199 exit 0

  ViewVC Help
Powered by ViewVC 1.1.22