/[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.9 - (show annotations) (download)
Sun May 2 18:42:06 2021 UTC (4 years, 7 months ago) by jmc
Branch: MAIN
Changes since 1.8: +9 -1 lines
Add tst_2+2 report to main log file

1 #! /usr/bin/env bash
2
3 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/test_local,v 1.8 2020/08/03 14:11:49 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 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
194 ;;
195
196 'iur4')
197
198 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \
199 -devel -nc -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1
200 echo '' >> ../../tr_run_$tt.log 2>&1
201
202 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \
203 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
204
205 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
206
207 #- test restart:
208 echo '' >> ../../tr_run_$tt.log 2>&1
209 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
210 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
211 ;;
212
213 'gadm')
214
215 ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_gfortran \
216 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
217
218 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
219 ;;
220
221 'gads')
222
223 ./testreport -adm -of ../tools/build_options/linux_amd64_gfortran \
224 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
225
226 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
227 ;;
228
229 'gad4')
230
231 ./testreport -adm -ur4 -of ../tools/build_options/linux_amd64_gfortran \
232 -devel -ncad -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
233
234 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
235 ;;
236
237 'gmp2')
238
239 export OMP_NUM_THREADS=2
240 export GOMP_STACKSIZE=400m
241
242 ./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_gfortran \
243 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
244
245 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
246
247 #- test restart:
248 echo '' >> ../../tr_run_$tt.log 2>&1
249 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
250 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
251 ;;
252
253 'gmpi')
254
255 ./testreport -MPI 3 -of ../tools/build_options/linux_amd64_gfortran \
256 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
257
258 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
259
260 #- test restart:
261 echo '' >> ../../tr_run_$tt.log 2>&1
262 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
263 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
264 ;;
265
266 'gmp4')
267
268 ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \
269 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
270
271 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
272
273 #- test restart:
274 echo '' >> ../../tr_run_$tt.log 2>&1
275 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
276 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
277 ;;
278
279 'gfo')
280
281 ./testreport -of ../tools/build_options/linux_amd64_gfortran \
282 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
283
284 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
285
286 #- test restart:
287 echo '' >> ../../tr_run_$tt.log 2>&1
288 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
289 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
290 ;;
291
292 'gfo4')
293
294 ./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \
295 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
296
297 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
298
299 #- test restart:
300 echo '' >> ../../tr_run_$tt.log 2>&1
301 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
302 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
303 ;;
304
305 'g77')
306
307 ./testreport -of ../tools/build_options/linux_amd64_g77 \
308 -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \
309 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
310
311 sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
312
313 #- test restart:
314 echo '' >> ../../tr_run_$tt.log 2>&1
315 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
316 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
317 ;;
318
319 *) echo "unrecognized test suffix '$tt' <== skipped" ;;
320 esac
321
322 set +x
323 cd ../..
324
325 else
326 echo "error: missing dir $gcmDIR/verification"
327 fi
328
329 done

  ViewVC Help
Powered by ViewVC 1.1.22