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

Annotation of /MITgcm_contrib/test_scripts/other/test_local

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


Revision 1.11 - (hide annotations) (download)
Mon Nov 1 13:45:29 2021 UTC (3 years, 8 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 jmc 1.1 #! /usr/bin/env bash
2    
3 jmc 1.11 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/test_local,v 1.10 2021/09/21 14:28:33 jmc Exp $
4 jmc 1.1 # $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 jmc 1.2 # if test $dd1 != '01' ; then echo 'not last day of month'; exit ; fi
15 jmc 1.1 elif test $1 = gfort ; then
16 jmc 1.10 tst_list='gadm gads gad4 gmp4 gmp2 gfo gfo4 g77 g7a'
17 jmc 1.3 elif test $1 = gfor8 ; then
18 jmc 1.1 # 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 jmc 1.6 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 jmc 1.8 sendCmd='-a jm_c@mitgcm.org'
46     sendCmd='-send scp -a jm_c@mitgcm.org:testing/MITgcm-test'
47 jmc 1.1
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 jmc 1.6 gcmDIR="MITgcm_$tt"
74 jmc 1.1 echo "=========================================================================="
75     # set -x
76     rm -f tr_clean_$tt.log
77     echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$?
78 jmc 1.10 if test $tt = g7a ; then fwd=0 ; fi
79 jmc 1.1 echo " testing tt= $tt , fwd= $fwd"
80 jmc 1.6 if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then
81 jmc 1.1 #- cleaning previous testreport run and updating the code:
82     if [ $fwd -eq 0 ] ; then
83     set -x
84     #- cleanup previous test:
85 jmc 1.6 ( cd $gcmDIR/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 )
86 jmc 1.1 set +x
87     else
88     set -x
89     #- cleanup previous restart:
90 jmc 1.6 ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean > ../../tr_clean_$tt.log 2>&1 )
91 jmc 1.1 #- cleanup previous test:
92 jmc 1.6 ( cd $gcmDIR/verification ; ./testreport -clean >> ../../tr_clean_$tt.log 2>&1 )
93 jmc 1.1 set +x
94     fi
95     if [ $gfort -eq 0 ] ; then
96 jmc 1.6 echo ' remove all Makefile_syntax' >> tr_clean_$tt.log
97     ( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax )
98 jmc 1.1 fi
99 jmc 1.6 echo "" >> tr_clean_$tt.log
100 jmc 1.1
101 jmc 1.6 echo "==========================================================================" \
102     >> tr_clean_$tt.log
103     echo " Update MITgcm code in dir: $gcmDIR using 'git pull':" | tee -a tr_clean_$tt.log
104 jmc 1.1 set -x
105     #- update the code:
106 jmc 1.7 ( cd $gcmDIR ; git pull ) >> tr_clean_$tt.log 2>&1 ; retv=$?
107 jmc 1.1 set +x
108 jmc 1.5 if test $retv != 0 ; then
109 jmc 1.6 echo "'git pull' in $gcmDIR fail (return val=$retv) => skip" | tee -a tr_clean_$tt.log
110 jmc 1.5 continue
111     fi
112 jmc 1.7 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 jmc 1.1 else
117 jmc 1.6 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 jmc 1.1 #- download new code:
124 jmc 1.6 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 jmc 1.1 set -x
128 jmc 1.6 git clone https://github.com/$git_repo/${git_code}.git $gcmDIR 2> $tmpFil
129     retv=$?
130 jmc 1.1 set +x
131 jmc 1.6 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 jmc 1.5 continue
137     fi
138 jmc 1.1 fi
139     echo ""
140     echo "=========================================================================="
141    
142 jmc 1.6 if test -d $gcmDIR/verification ; then
143 jmc 1.1 if test -e tr_run_$tt.log ; then mv -f tr_run_$tt.log tr_run_$tt.log_bak ; fi
144 jmc 1.6 cd $gcmDIR/verification
145 jmc 1.1
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 jmc 1.8 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
161 jmc 1.1
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 jmc 1.8 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
173 jmc 1.1
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 jmc 1.8 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
188 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
194 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
195 jmc 1.1 ;;
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 jmc 1.8 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
205 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
211 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
212 jmc 1.1 ;;
213    
214     'gadm')
215    
216     ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_gfortran \
217 jmc 1.8 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
218 jmc 1.1
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 jmc 1.8 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
226 jmc 1.1
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 jmc 1.8 -devel -ncad -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
234 jmc 1.1
235     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
236     ;;
237    
238 jmc 1.10 'g7a')
239    
240     ./testreport -adm -of ../tools/build_options/linux_amd64_g77 \
241 jmc 1.11 -skd 'halfpipe_streamice' \
242 jmc 1.10 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
243    
244     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
245     ;;
246    
247 jmc 1.1 '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 jmc 1.8 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
254 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
260 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
261 jmc 1.1 ;;
262    
263     'gmpi')
264    
265     ./testreport -MPI 3 -of ../tools/build_options/linux_amd64_gfortran \
266 jmc 1.8 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
267 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
273 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
274 jmc 1.1 ;;
275    
276     'gmp4')
277    
278     ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \
279 jmc 1.8 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
280 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
286 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
287 jmc 1.1 ;;
288    
289     'gfo')
290    
291     ./testreport -of ../tools/build_options/linux_amd64_gfortran \
292 jmc 1.8 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
293 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
299 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
300 jmc 1.1 ;;
301    
302     'gfo4')
303    
304     ./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \
305 jmc 1.8 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
306 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
312 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
313 jmc 1.1 ;;
314    
315     'g77')
316    
317     ./testreport -of ../tools/build_options/linux_amd64_g77 \
318 jmc 1.11 -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20 halfpipe_streamice internal_wave tutorial_advection_in_gyre' \
319 jmc 1.8 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
320 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
326 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
327 jmc 1.1 ;;
328    
329     *) echo "unrecognized test suffix '$tt' <== skipped" ;;
330     esac
331    
332     set +x
333     cd ../..
334    
335     else
336 jmc 1.6 echo "error: missing dir $gcmDIR/verification"
337 jmc 1.1 fi
338    
339     done

  ViewVC Help
Powered by ViewVC 1.1.22