/[MITgcm]/MITgcm_contrib/test_scripts/other/test_local
ViewVC logotype

Contents of /MITgcm_contrib/test_scripts/other/test_local

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


Revision 1.5 - (show annotations) (download)
Fri Jan 5 22:25:25 2018 UTC (7 years, 11 months ago) by jmc
Branch: MAIN
Changes since 1.4: +32 -24 lines
- check if download is successful
- to send testreport output, use new email address: jm_c@mitgcm.org
   (replacing jmc@dev.mitgcm.org)

1 #! /usr/bin/env bash
2
3 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/test_local,v 1.4 2017/07/28 17:02:18 jmc Exp $
4 # $Name: $
5
6 if test $# = 0 ; then
7 echo 'need 1 argument'
8 exit
9 else
10 if test $1 = ifort ; then
11 # tst_list='iadm imp2 iur4'
12 tst_list='iad4 imp2 iur4'
13 dd1=`date +%d -d "1 day"`
14 # if test $dd1 != '01' ; then echo 'not last day of month'; exit ; fi
15 elif test $1 = gfort ; then
16 tst_list='gadm gads gad4 gmp4 gmp2 gfo gfo4 g77'
17 elif test $1 = gfor8 ; then
18 # tst_list='gadm gads gmp2 gmpi gfo g77'
19 tst_list='gadm gads gmp2 gfo'
20 elif test $1 = gfor4 ; then
21 tst_list='gad4 gmp4 gfo4 g77'
22 else
23 tst_list=$*
24 fi
25 fi
26 echo "run: \""`basename $0` $*"\" on:" `date`
27 echo " tst_list='$tst_list'"
28
29 #- to get ~/bin in the patch (for staf) when run on cron:
30 if [ -d ~/bin ]; then
31 echo 'add ~/bin to $PATH'
32 export PATH=$PATH:~/bin
33 fi
34 #- to get case insensitive "ls" (and order of tested experiments)
35 #export LC_ALL="en_US.UTF-8"
36 #- Turn off stack limit for FIZHI & AD-tests
37 ulimit -s unlimited
38 #- method to acces CVS:
39 cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
40
41 #-- for now, cannot mix ifort/gfortran tests:
42 gfort=1
43 for tt in $tst_list
44 do
45 echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$?
46 if [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2
47 elif [ $retv -ne 0 -a $gfort -le 1 ] ; then gfort=0
48 else echo 'cannot mix ifort/gfortran' ; exit
49 fi
50 done
51 if [ $gfort -eq 0 ] ; then
52 #echo 'source ~jmc/bin/intel_v14.sh'
53 #source ~jmc/bin/intel_v14.sh
54 echo 'source ~jmc/bin/intel_v15.sh'
55 source ~jmc/bin/intel_v15.sh
56 fi
57 if [ $gfort -eq 2 ] ; then
58 echo 'source ~jmc/bin/openmpi.sh'
59 source ~jmc/bin/openmpi.sh
60 fi
61
62 #--------------------------------------------------------------------
63 for tt in $tst_list
64 do
65
66 echo "=========================================================================="
67 # set -x
68 rm -f tr_clean_$tt.log
69 echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$?
70 echo " testing tt= $tt , fwd= $fwd"
71 if test -d MITgcm_$tt/verification ; then
72 #- cleaning previous testreport run and updating the code:
73 if [ $fwd -eq 0 ] ; then
74 set -x
75 #- cleanup previous test:
76 ( cd MITgcm_$tt/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 )
77 set +x
78 else
79 set -x
80 #- cleanup previous restart:
81 ( cd MITgcm_$tt/verification ; ../tools/do_tst_2+2 -clean > ../../tr_clean_$tt.log 2>&1 )
82 #- cleanup previous test:
83 ( cd MITgcm_$tt/verification ; ./testreport -clean >> ../../tr_clean_$tt.log 2>&1 )
84 set +x
85 fi
86 if [ $gfort -eq 0 ] ; then
87 echo ' remove all Makefile_syntax and do "cvs update -P -d"' >> tr_clean_$tt.log
88 ( cd MITgcm_$tt/verification ; rm -f */build/Makefile_syntax )
89 else
90 echo " run '$cmdCVS update -P -d'" >> tr_clean_$tt.log
91 fi
92 echo ""
93
94 echo "=========================================================================="
95 set -x
96 #- update the code:
97 ( cd MITgcm_$tt ; $cmdCVS update -P -d >> ../tr_clean_$tt.log 2>&1 ; retv=$? )
98 set +x
99 if test $retv != 0 ; then
100 echo "cvs update in MITgcm_$tt fail (return val=$retv) => skip" | tee -a tr_clean_$tt.log
101 continue
102 fi
103 else
104 #- download new code:
105 echo " run '$cmdCVS co -P -d MITgcm_$tt MITgcm'" >> tr_clean_$tt.log
106 echo "=========================================================================="
107 set -x
108 $cmdCVS co -P -d MITgcm_$tt MITgcm >> tr_clean_$tt.log 2>&1 ; retv=$?
109 set +x
110 if test $retv != 0 ; then
111 echo "cvs co of MITgcm_$tt fail (return val=$retv) => skip" | tee -a tr_clean_$tt.log
112 continue
113 fi
114 fi
115 echo ""
116 echo "=========================================================================="
117
118 if test -d MITgcm_$tt/verification ; then
119 if test -e tr_run_$tt.log ; then mv -f tr_run_$tt.log tr_run_$tt.log_bak ; fi
120 cd MITgcm_$tt/verification
121
122 date
123 # verbose mode:
124 set -x
125 pwd
126 test -e tr_out.txt && mv -f tr_out.txt tr_out.sav
127
128 case $tt in
129 'iadm' )
130
131 ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_ifort11 \
132 -devel -nc -ncad -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
133 echo '' >> ../../tr_run_$tt.log 2>&1
134
135 ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_ifort11 \
136 -devel -q -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
137
138 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
139 ;;
140
141 'iad4' )
142
143 ./testreport -MPI 3 -ur4 -adm -of ../tools/build_options/linux_amd64_ifort11 \
144 -devel -nc -ncad -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
145 echo '' >> ../../tr_run_$tt.log 2>&1
146
147 ./testreport -MPI 3 -ur4 -adm -of ../tools/build_options/linux_amd64_ifort11 \
148 -devel -q -match 5 -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
149
150 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
151 ;;
152
153 'imp2')
154
155 export OMP_NUM_THREADS=2
156 export KMP_STACKSIZE=400m
157
158 ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_ifort11 \
159 -devel -nc -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
160 echo '' >> ../../tr_run_$tt.log 2>&1
161
162 ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_ifort11 \
163 -devel -q -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
164
165 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
166
167 #- test restart:
168 echo '' >> ../../tr_run_$tt.log 2>&1
169 ../tools/do_tst_2+2 -mpi -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
170 ;;
171
172 'iur4')
173
174 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \
175 -devel -nc -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
176 echo '' >> ../../tr_run_$tt.log 2>&1
177
178 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \
179 -devel -q -match 5 -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
180
181 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
182
183 #- test restart:
184 echo '' >> ../../tr_run_$tt.log 2>&1
185 ../tools/do_tst_2+2 -mpi -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
186 ;;
187
188 'gadm')
189
190 ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_gfortran \
191 -devel -ncad -nc -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
192
193 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
194 ;;
195
196 'gads')
197
198 ./testreport -adm -of ../tools/build_options/linux_amd64_gfortran \
199 -devel -ncad -nc -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
200
201 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
202 ;;
203
204 'gad4')
205
206 ./testreport -adm -ur4 -of ../tools/build_options/linux_amd64_gfortran \
207 -devel -ncad -nc -match 5 -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
208
209 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
210 ;;
211
212 'gmp2')
213
214 export OMP_NUM_THREADS=2
215 export GOMP_STACKSIZE=400m
216
217 ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_gfortran \
218 -devel -nc -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
219
220 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
221
222 #- test restart:
223 echo '' >> ../../tr_run_$tt.log 2>&1
224 ../tools/do_tst_2+2 -mpi -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
225 ;;
226
227 'gmpi')
228
229 ./testreport -MPI 3 -of ../tools/build_options/linux_amd64_gfortran \
230 -devel -nc -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
231
232 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
233
234 #- test restart:
235 echo '' >> ../../tr_run_$tt.log 2>&1
236 ../tools/do_tst_2+2 -mpi -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
237 ;;
238
239 'gmp4')
240
241 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \
242 -devel -nc -match 5 -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
243
244 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
245
246 #- test restart:
247 echo '' >> ../../tr_run_$tt.log 2>&1
248 ../tools/do_tst_2+2 -mpi -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
249 ;;
250
251 'gfo')
252
253 ./testreport -of ../tools/build_options/linux_amd64_gfortran \
254 -devel -nc -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
255
256 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
257
258 #- test restart:
259 echo '' >> ../../tr_run_$tt.log 2>&1
260 ../tools/do_tst_2+2 -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
261 ;;
262
263 'gfo4')
264
265 ./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \
266 -devel -nc -match 5 -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
267
268 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
269
270 #- test restart:
271 echo '' >> ../../tr_run_$tt.log 2>&1
272 ../tools/do_tst_2+2 -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
273 ;;
274
275 'g77')
276
277 ./testreport -of ../tools/build_options/linux_amd64_g77 \
278 -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \
279 -nc -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
280
281 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
282
283 #- test restart:
284 echo '' >> ../../tr_run_$tt.log 2>&1
285 ../tools/do_tst_2+2 -a jm_c@mitgcm.org >> ../../tr_run_$tt.log 2>&1
286 ;;
287
288 *) echo "unrecognized test suffix '$tt' <== skipped" ;;
289 esac
290
291 set +x
292 cd ../..
293
294 else
295 echo "error: missing dir MITgcm_$tt/verification"
296 fi
297
298 done

  ViewVC Help
Powered by ViewVC 1.1.22