/[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.10 - (show annotations) (download)
Tue Sep 21 14:28:33 2021 UTC (4 years, 11 months ago) by jmc
Branch: MAIN
Changes since 1.9: +11 -2 lines
add g77 ADM test

1 #! /usr/bin/env bash
2
3 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/test_local,v 1.9 2021/05/02 18:42:06 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 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
242
243 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
244 ;;
245
246 'gmp2')
247
248 export OMP_NUM_THREADS=2
249 export GOMP_STACKSIZE=400m
250
251 ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_gfortran \
252 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
253
254 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
255
256 #- test restart:
257 echo '' >> ../../tr_run_$tt.log 2>&1
258 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
259 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
260 ;;
261
262 'gmpi')
263
264 ./testreport -MPI 3 -of ../tools/build_options/linux_amd64_gfortran \
265 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
266
267 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
268
269 #- test restart:
270 echo '' >> ../../tr_run_$tt.log 2>&1
271 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
272 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
273 ;;
274
275 'gmp4')
276
277 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \
278 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
279
280 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
281
282 #- test restart:
283 echo '' >> ../../tr_run_$tt.log 2>&1
284 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
285 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
286 ;;
287
288 'gfo')
289
290 ./testreport -of ../tools/build_options/linux_amd64_gfortran \
291 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
292
293 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
294
295 #- test restart:
296 echo '' >> ../../tr_run_$tt.log 2>&1
297 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
298 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
299 ;;
300
301 'gfo4')
302
303 ./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \
304 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
305
306 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
307
308 #- test restart:
309 echo '' >> ../../tr_run_$tt.log 2>&1
310 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
311 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
312 ;;
313
314 'g77')
315
316 ./testreport -of ../tools/build_options/linux_amd64_g77 \
317 -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \
318 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
319
320 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
321
322 #- test restart:
323 echo '' >> ../../tr_run_$tt.log 2>&1
324 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
325 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
326 ;;
327
328 *) echo "unrecognized test suffix '$tt' <== skipped" ;;
329 esac
330
331 set +x
332 cd ../..
333
334 else
335 echo "error: missing dir $gcmDIR/verification"
336 fi
337
338 done

  ViewVC Help
Powered by ViewVC 1.1.22