/[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.12 - (show annotations) (download)
Thu Feb 16 21:29:01 2023 UTC (3 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.11: +3 -2 lines
remove g77 tests (not available with fc37)

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

  ViewVC Help
Powered by ViewVC 1.1.22