/[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.4 - (show annotations) (download)
Fri Jul 28 17:02:18 2017 UTC (8 years, 4 months ago) by jmc
Branch: MAIN
Changes since 1.3: +22 -22 lines
change eamil address from "jmc@mitgcm.org" to "jmc@dev.mitgcm.org"

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

  ViewVC Help
Powered by ViewVC 1.1.22