/[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.6 - (show annotations) (download)
Fri Feb 9 20:42:07 2018 UTC (7 years, 10 months ago) by jmc
Branch: MAIN
Changes since 1.5: +61 -43 lines
change to use new code repository on GitHub

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

  ViewVC Help
Powered by ViewVC 1.1.22