/[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.8 - (show annotations) (download)
Mon Aug 3 14:11:49 2020 UTC (5 years, 4 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 #! /usr/bin/env bash
2
3 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/test_local,v 1.7 2018/11/07 23:10:02 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'
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 echo " testing tt= $tt , fwd= $fwd"
79 if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then
80 #- cleaning previous testreport run and updating the code:
81 if [ $fwd -eq 0 ] ; then
82 set -x
83 #- cleanup previous test:
84 ( cd $gcmDIR/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 )
85 set +x
86 else
87 set -x
88 #- cleanup previous restart:
89 ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean > ../../tr_clean_$tt.log 2>&1 )
90 #- cleanup previous test:
91 ( cd $gcmDIR/verification ; ./testreport -clean >> ../../tr_clean_$tt.log 2>&1 )
92 set +x
93 fi
94 if [ $gfort -eq 0 ] ; then
95 echo ' remove all Makefile_syntax' >> tr_clean_$tt.log
96 ( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax )
97 fi
98 echo "" >> tr_clean_$tt.log
99
100 echo "==========================================================================" \
101 >> tr_clean_$tt.log
102 echo " Update MITgcm code in dir: $gcmDIR using 'git pull':" | tee -a tr_clean_$tt.log
103 set -x
104 #- update the code:
105 ( cd $gcmDIR ; git pull ) >> tr_clean_$tt.log 2>&1 ; retv=$?
106 set +x
107 if test $retv != 0 ; then
108 echo "'git pull' in $gcmDIR fail (return val=$retv) => skip" | tee -a tr_clean_$tt.log
109 continue
110 fi
111 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 else
116 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 #- download new code:
123 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 set -x
127 git clone https://github.com/$git_repo/${git_code}.git $gcmDIR 2> $tmpFil
128 retv=$?
129 set +x
130 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 continue
136 fi
137 fi
138 echo ""
139 echo "=========================================================================="
140
141 if test -d $gcmDIR/verification ; then
142 if test -e tr_run_$tt.log ; then mv -f tr_run_$tt.log tr_run_$tt.log_bak ; fi
143 cd $gcmDIR/verification
144
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 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
160
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 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
172
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 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
187
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 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
193 ;;
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 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
203
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 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
209 ;;
210
211 'gadm')
212
213 ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_gfortran \
214 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
215
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 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
223
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 -devel -ncad -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
231
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 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
242
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 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
248 ;;
249
250 'gmpi')
251
252 ./testreport -MPI 3 -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 ;;
261
262 'gmp4')
263
264 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \
265 -devel -nc -match 5 $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 ;;
273
274 'gfo')
275
276 ./testreport -of ../tools/build_options/linux_amd64_gfortran \
277 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
278
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 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
284 ;;
285
286 'gfo4')
287
288 ./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \
289 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
290
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 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
296 ;;
297
298 'g77')
299
300 ./testreport -of ../tools/build_options/linux_amd64_g77 \
301 -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \
302 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
303
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 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
309 ;;
310
311 *) echo "unrecognized test suffix '$tt' <== skipped" ;;
312 esac
313
314 set +x
315 cd ../..
316
317 else
318 echo "error: missing dir $gcmDIR/verification"
319 fi
320
321 done

  ViewVC Help
Powered by ViewVC 1.1.22