/[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.8 - (hide annotations) (download)
Mon Aug 3 14:11:49 2020 UTC (4 years, 11 months ago) by jmc
Branch: MAIN
Changes since 1.7: +24 -23 lines
switch to "scp" to send resuts

(sending email does not work well if not from fixed IP address)

1 jmc 1.1 #! /usr/bin/env bash
2    
3 jmc 1.8 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/test_local,v 1.7 2018/11/07 23:10:02 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.3 tst_list='gadm gads gad4 gmp4 gmp2 gfo gfo4 g77'
17     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     echo " testing tt= $tt , fwd= $fwd"
79 jmc 1.6 if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then
80 jmc 1.1 #- cleaning previous testreport run and updating the code:
81     if [ $fwd -eq 0 ] ; then
82     set -x
83     #- cleanup previous test:
84 jmc 1.6 ( cd $gcmDIR/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 )
85 jmc 1.1 set +x
86     else
87     set -x
88     #- cleanup previous restart:
89 jmc 1.6 ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean > ../../tr_clean_$tt.log 2>&1 )
90 jmc 1.1 #- cleanup previous test:
91 jmc 1.6 ( cd $gcmDIR/verification ; ./testreport -clean >> ../../tr_clean_$tt.log 2>&1 )
92 jmc 1.1 set +x
93     fi
94     if [ $gfort -eq 0 ] ; then
95 jmc 1.6 echo ' remove all Makefile_syntax' >> tr_clean_$tt.log
96     ( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax )
97 jmc 1.1 fi
98 jmc 1.6 echo "" >> tr_clean_$tt.log
99 jmc 1.1
100 jmc 1.6 echo "==========================================================================" \
101     >> tr_clean_$tt.log
102     echo " Update MITgcm code in dir: $gcmDIR using 'git pull':" | tee -a tr_clean_$tt.log
103 jmc 1.1 set -x
104     #- update the code:
105 jmc 1.7 ( cd $gcmDIR ; git pull ) >> tr_clean_$tt.log 2>&1 ; retv=$?
106 jmc 1.1 set +x
107 jmc 1.5 if test $retv != 0 ; then
108 jmc 1.6 echo "'git pull' in $gcmDIR fail (return val=$retv) => skip" | tee -a tr_clean_$tt.log
109 jmc 1.5 continue
110     fi
111 jmc 1.7 echo " and checkout master:" | tee -a tr_clean_$tt.log
112     set -x
113     ( cd $gcmDIR ; git checkout master -- . ) >> tr_clean_$tt.log 2>&1
114     set +x
115 jmc 1.1 else
116 jmc 1.6 echo "Missing '$gcmDIR/.git/config' or dir '$gcmDIR/verification'" >> tr_clean_$tt.log
117     if test -e $gcmDIR ; then
118     echo -n " removing working copy: $gcmDIR ..." >> tr_clean_$tt.log
119     rm -rf $gcmDIR
120     echo " done" >> tr_clean_$tt.log
121     fi
122 jmc 1.1 #- download new code:
123 jmc 1.6 echo "==========================================================================" \
124     >> tr_clean_$tt.log
125     echo "Make a clone of $git_code from repo: $git_repo into: $gcmDIR ..." | tee -a tr_clean_$tt.log
126 jmc 1.1 set -x
127 jmc 1.6 git clone https://github.com/$git_repo/${git_code}.git $gcmDIR 2> $tmpFil
128     retv=$?
129 jmc 1.1 set +x
130 jmc 1.6 if test $retv = 0 ; then
131     echo ' done' >> tr_clean_$tt.log ; rm -f $tmpFil
132     else
133     echo "'git clone' into $gcmDIR failed (return: $retv) => skip" | tee -a tr_clean_$tt.log
134     cat $tmpFil >> tr_clean_$tt.log ; rm -f $tmpFil
135 jmc 1.5 continue
136     fi
137 jmc 1.1 fi
138     echo ""
139     echo "=========================================================================="
140    
141 jmc 1.6 if test -d $gcmDIR/verification ; then
142 jmc 1.1 if test -e tr_run_$tt.log ; then mv -f tr_run_$tt.log tr_run_$tt.log_bak ; fi
143 jmc 1.6 cd $gcmDIR/verification
144 jmc 1.1
145     date
146     # verbose mode:
147     set -x
148     pwd
149     test -e tr_out.txt && mv -f tr_out.txt tr_out.sav
150    
151     case $tt in
152     'iadm' )
153    
154     ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_ifort11 \
155     -devel -nc -ncad -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
156     echo '' >> ../../tr_run_$tt.log 2>&1
157    
158     ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_ifort11 \
159 jmc 1.8 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
160 jmc 1.1
161     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
162     ;;
163    
164     'iad4' )
165    
166     ./testreport -MPI 3 -ur4 -adm -of ../tools/build_options/linux_amd64_ifort11 \
167     -devel -nc -ncad -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
168     echo '' >> ../../tr_run_$tt.log 2>&1
169    
170     ./testreport -MPI 3 -ur4 -adm -of ../tools/build_options/linux_amd64_ifort11 \
171 jmc 1.8 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
172 jmc 1.1
173     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
174     ;;
175    
176     'imp2')
177    
178     export OMP_NUM_THREADS=2
179     export KMP_STACKSIZE=400m
180    
181     ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_ifort11 \
182     -devel -nc -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
183     echo '' >> ../../tr_run_$tt.log 2>&1
184    
185     ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_ifort11 \
186 jmc 1.8 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
187 jmc 1.1
188     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
189    
190     #- test restart:
191     echo '' >> ../../tr_run_$tt.log 2>&1
192 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
193 jmc 1.1 ;;
194    
195     'iur4')
196    
197     ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \
198     -devel -nc -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
199     echo '' >> ../../tr_run_$tt.log 2>&1
200    
201     ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \
202 jmc 1.8 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
203 jmc 1.1
204     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
205    
206     #- test restart:
207     echo '' >> ../../tr_run_$tt.log 2>&1
208 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
209 jmc 1.1 ;;
210    
211     'gadm')
212    
213     ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_gfortran \
214 jmc 1.8 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
215 jmc 1.1
216     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
217     ;;
218    
219     'gads')
220    
221     ./testreport -adm -of ../tools/build_options/linux_amd64_gfortran \
222 jmc 1.8 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
223 jmc 1.1
224     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
225     ;;
226    
227     'gad4')
228    
229     ./testreport -adm -ur4 -of ../tools/build_options/linux_amd64_gfortran \
230 jmc 1.8 -devel -ncad -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
231 jmc 1.1
232     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
233     ;;
234    
235     'gmp2')
236    
237     export OMP_NUM_THREADS=2
238     export GOMP_STACKSIZE=400m
239    
240     ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_gfortran \
241 jmc 1.8 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
242 jmc 1.1
243     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
244    
245     #- test restart:
246     echo '' >> ../../tr_run_$tt.log 2>&1
247 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
248 jmc 1.1 ;;
249    
250     'gmpi')
251    
252     ./testreport -MPI 3 -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.1 ;;
261    
262     'gmp4')
263    
264     ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \
265 jmc 1.8 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
266 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
272 jmc 1.1 ;;
273    
274     'gfo')
275    
276     ./testreport -of ../tools/build_options/linux_amd64_gfortran \
277 jmc 1.8 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
278 jmc 1.1
279     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
280    
281     #- test restart:
282     echo '' >> ../../tr_run_$tt.log 2>&1
283 jmc 1.8 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
284 jmc 1.1 ;;
285    
286     'gfo4')
287    
288     ./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \
289 jmc 1.8 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
290 jmc 1.1
291     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
292    
293     #- test restart:
294     echo '' >> ../../tr_run_$tt.log 2>&1
295 jmc 1.8 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
296 jmc 1.1 ;;
297    
298     'g77')
299    
300     ./testreport -of ../tools/build_options/linux_amd64_g77 \
301     -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \
302 jmc 1.8 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
303 jmc 1.1
304     sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
305    
306     #- test restart:
307     echo '' >> ../../tr_run_$tt.log 2>&1
308 jmc 1.8 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
309 jmc 1.1 ;;
310    
311     *) echo "unrecognized test suffix '$tt' <== skipped" ;;
312     esac
313    
314     set +x
315     cd ../..
316    
317     else
318 jmc 1.6 echo "error: missing dir $gcmDIR/verification"
319 jmc 1.1 fi
320    
321     done

  ViewVC Help
Powered by ViewVC 1.1.22