/[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.11 - (show annotations) (download)
Mon Nov 1 13:45:29 2021 UTC (4 years, 10 months ago) by jmc
Branch: MAIN
Changes since 1.10: +3 -2 lines
skip more experiments in g77 tests

no need to compile/run exeriments that are known to fail with g77

1 #! /usr/bin/env bash
2
3 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/test_local,v 1.10 2021/09/21 14:28:33 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 g7a'
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 #- and which GitHub repository to use:
41 git_repo='MITgcm'; git_code='MITgcm'
42 #git_repo='altMITgcm'; #git_code='MITgcm66h'
43 #- other settings:
44 tmpFil="/tmp/"`basename $0`".$$"
45 sendCmd='-a jm_c@mitgcm.org'
46 sendCmd='-send scp -a jm_c@mitgcm.org:testing/MITgcm-test'
47
48 #-- for now, cannot mix ifort/gfortran tests:
49 gfort=1
50 for tt in $tst_list
51 do
52 echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$?
53 if [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2
54 elif [ $retv -ne 0 -a $gfort -le 1 ] ; then gfort=0
55 else echo 'cannot mix ifort/gfortran' ; exit
56 fi
57 done
58 if [ $gfort -eq 0 ] ; then
59 #echo 'source ~jmc/bin/intel_v14.sh'
60 #source ~jmc/bin/intel_v14.sh
61 echo 'source ~jmc/bin/intel_v15.sh'
62 source ~jmc/bin/intel_v15.sh
63 fi
64 if [ $gfort -eq 2 ] ; then
65 echo 'source ~jmc/bin/openmpi.sh'
66 source ~jmc/bin/openmpi.sh
67 fi
68
69 #--------------------------------------------------------------------
70 for tt in $tst_list
71 do
72
73 gcmDIR="MITgcm_$tt"
74 echo "=========================================================================="
75 # set -x
76 rm -f tr_clean_$tt.log
77 echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$?
78 if test $tt = g7a ; then fwd=0 ; fi
79 echo " testing tt= $tt , fwd= $fwd"
80 if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then
81 #- cleaning previous testreport run and updating the code:
82 if [ $fwd -eq 0 ] ; then
83 set -x
84 #- cleanup previous test:
85 ( cd $gcmDIR/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 )
86 set +x
87 else
88 set -x
89 #- cleanup previous restart:
90 ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean > ../../tr_clean_$tt.log 2>&1 )
91 #- cleanup previous test:
92 ( cd $gcmDIR/verification ; ./testreport -clean >> ../../tr_clean_$tt.log 2>&1 )
93 set +x
94 fi
95 if [ $gfort -eq 0 ] ; then
96 echo ' remove all Makefile_syntax' >> tr_clean_$tt.log
97 ( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax )
98 fi
99 echo "" >> tr_clean_$tt.log
100
101 echo "==========================================================================" \
102 >> tr_clean_$tt.log
103 echo " Update MITgcm code in dir: $gcmDIR using 'git pull':" | tee -a tr_clean_$tt.log
104 set -x
105 #- update the code:
106 ( cd $gcmDIR ; git pull ) >> tr_clean_$tt.log 2>&1 ; retv=$?
107 set +x
108 if test $retv != 0 ; then
109 echo "'git pull' in $gcmDIR fail (return val=$retv) => skip" | tee -a tr_clean_$tt.log
110 continue
111 fi
112 echo " and checkout master:" | tee -a tr_clean_$tt.log
113 set -x
114 ( cd $gcmDIR ; git checkout master -- . ) >> tr_clean_$tt.log 2>&1
115 set +x
116 else
117 echo "Missing '$gcmDIR/.git/config' or dir '$gcmDIR/verification'" >> tr_clean_$tt.log
118 if test -e $gcmDIR ; then
119 echo -n " removing working copy: $gcmDIR ..." >> tr_clean_$tt.log
120 rm -rf $gcmDIR
121 echo " done" >> tr_clean_$tt.log
122 fi
123 #- download new code:
124 echo "==========================================================================" \
125 >> tr_clean_$tt.log
126 echo "Make a clone of $git_code from repo: $git_repo into: $gcmDIR ..." | tee -a tr_clean_$tt.log
127 set -x
128 git clone https://github.com/$git_repo/${git_code}.git $gcmDIR 2> $tmpFil
129 retv=$?
130 set +x
131 if test $retv = 0 ; then
132 echo ' done' >> tr_clean_$tt.log ; rm -f $tmpFil
133 else
134 echo "'git clone' into $gcmDIR failed (return: $retv) => skip" | tee -a tr_clean_$tt.log
135 cat $tmpFil >> tr_clean_$tt.log ; rm -f $tmpFil
136 continue
137 fi
138 fi
139 echo ""
140 echo "=========================================================================="
141
142 if test -d $gcmDIR/verification ; then
143 if test -e tr_run_$tt.log ; then mv -f tr_run_$tt.log tr_run_$tt.log_bak ; fi
144 cd $gcmDIR/verification
145
146 date
147 # verbose mode:
148 set -x
149 pwd
150 test -e tr_out.txt && mv -f tr_out.txt tr_out.sav
151
152 case $tt in
153 'iadm' )
154
155 ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_ifort11 \
156 -devel -nc -ncad -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
157 echo '' >> ../../tr_run_$tt.log 2>&1
158
159 ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_ifort11 \
160 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
161
162 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
163 ;;
164
165 'iad4' )
166
167 ./testreport -MPI 3 -ur4 -adm -of ../tools/build_options/linux_amd64_ifort11 \
168 -devel -nc -ncad -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
169 echo '' >> ../../tr_run_$tt.log 2>&1
170
171 ./testreport -MPI 3 -ur4 -adm -of ../tools/build_options/linux_amd64_ifort11 \
172 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
173
174 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
175 ;;
176
177 'imp2')
178
179 export OMP_NUM_THREADS=2
180 export KMP_STACKSIZE=400m
181
182 ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_ifort11 \
183 -devel -nc -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
184 echo '' >> ../../tr_run_$tt.log 2>&1
185
186 ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_ifort11 \
187 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
188
189 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
190
191 #- test restart:
192 echo '' >> ../../tr_run_$tt.log 2>&1
193 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
194 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
195 ;;
196
197 'iur4')
198
199 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \
200 -devel -nc -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
201 echo '' >> ../../tr_run_$tt.log 2>&1
202
203 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \
204 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
205
206 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
207
208 #- test restart:
209 echo '' >> ../../tr_run_$tt.log 2>&1
210 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
211 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
212 ;;
213
214 'gadm')
215
216 ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_gfortran \
217 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
218
219 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
220 ;;
221
222 'gads')
223
224 ./testreport -adm -of ../tools/build_options/linux_amd64_gfortran \
225 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
226
227 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
228 ;;
229
230 'gad4')
231
232 ./testreport -adm -ur4 -of ../tools/build_options/linux_amd64_gfortran \
233 -devel -ncad -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
234
235 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
236 ;;
237
238 'g7a')
239
240 ./testreport -adm -of ../tools/build_options/linux_amd64_g77 \
241 -skd 'halfpipe_streamice' \
242 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
243
244 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
245 ;;
246
247 'gmp2')
248
249 export OMP_NUM_THREADS=2
250 export GOMP_STACKSIZE=400m
251
252 ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_gfortran \
253 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
254
255 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
256
257 #- test restart:
258 echo '' >> ../../tr_run_$tt.log 2>&1
259 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
260 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
261 ;;
262
263 'gmpi')
264
265 ./testreport -MPI 3 -of ../tools/build_options/linux_amd64_gfortran \
266 -devel -nc $sendCmd >> ../../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 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
273 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
274 ;;
275
276 'gmp4')
277
278 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \
279 -devel -nc -match 5 $sendCmd >> ../../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 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
286 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
287 ;;
288
289 'gfo')
290
291 ./testreport -of ../tools/build_options/linux_amd64_gfortran \
292 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
293
294 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
295
296 #- test restart:
297 echo '' >> ../../tr_run_$tt.log 2>&1
298 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
299 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
300 ;;
301
302 'gfo4')
303
304 ./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \
305 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
306
307 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
308
309 #- test restart:
310 echo '' >> ../../tr_run_$tt.log 2>&1
311 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
312 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
313 ;;
314
315 'g77')
316
317 ./testreport -of ../tools/build_options/linux_amd64_g77 \
318 -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20 halfpipe_streamice internal_wave tutorial_advection_in_gyre' \
319 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
320
321 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
322
323 #- test restart:
324 echo '' >> ../../tr_run_$tt.log 2>&1
325 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
326 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
327 ;;
328
329 *) echo "unrecognized test suffix '$tt' <== skipped" ;;
330 esac
331
332 set +x
333 cd ../..
334
335 else
336 echo "error: missing dir $gcmDIR/verification"
337 fi
338
339 done

  ViewVC Help
Powered by ViewVC 1.1.22