1 |
jmc |
1.1 |
#! /usr/bin/env bash |
2 |
|
|
|
3 |
jmc |
1.6 |
# $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/test_local,v 1.5 2018/01/05 22:25:25 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 |
|
|
mAddr='jm_c@mitgcm.org' |
46 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
gcmDIR="MITgcm_$tt" |
73 |
jmc |
1.1 |
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 |
jmc |
1.6 |
if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then |
79 |
jmc |
1.1 |
#- cleaning previous testreport run and updating the code: |
80 |
|
|
if [ $fwd -eq 0 ] ; then |
81 |
|
|
set -x |
82 |
|
|
#- cleanup previous test: |
83 |
jmc |
1.6 |
( cd $gcmDIR/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 ) |
84 |
jmc |
1.1 |
set +x |
85 |
|
|
else |
86 |
|
|
set -x |
87 |
|
|
#- cleanup previous restart: |
88 |
jmc |
1.6 |
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean > ../../tr_clean_$tt.log 2>&1 ) |
89 |
jmc |
1.1 |
#- cleanup previous test: |
90 |
jmc |
1.6 |
( cd $gcmDIR/verification ; ./testreport -clean >> ../../tr_clean_$tt.log 2>&1 ) |
91 |
jmc |
1.1 |
set +x |
92 |
|
|
fi |
93 |
|
|
if [ $gfort -eq 0 ] ; then |
94 |
jmc |
1.6 |
echo ' remove all Makefile_syntax' >> tr_clean_$tt.log |
95 |
|
|
( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax ) |
96 |
jmc |
1.1 |
fi |
97 |
jmc |
1.6 |
echo "" >> tr_clean_$tt.log |
98 |
jmc |
1.1 |
|
99 |
jmc |
1.6 |
echo "==========================================================================" \ |
100 |
|
|
>> tr_clean_$tt.log |
101 |
|
|
echo " Update MITgcm code in dir: $gcmDIR using 'git pull':" | tee -a tr_clean_$tt.log |
102 |
jmc |
1.1 |
set -x |
103 |
|
|
#- update the code: |
104 |
jmc |
1.6 |
( cd $gcmDIR ; git checkout master ; git pull ) >> tr_clean_$tt.log 2>&1 ; retv=$? |
105 |
jmc |
1.1 |
set +x |
106 |
jmc |
1.5 |
if test $retv != 0 ; then |
107 |
jmc |
1.6 |
echo "'git pull' in $gcmDIR fail (return val=$retv) => skip" | tee -a tr_clean_$tt.log |
108 |
jmc |
1.5 |
continue |
109 |
|
|
fi |
110 |
jmc |
1.1 |
else |
111 |
jmc |
1.6 |
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 |
jmc |
1.1 |
#- download new code: |
118 |
jmc |
1.6 |
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 |
jmc |
1.1 |
set -x |
122 |
jmc |
1.6 |
git clone https://github.com/$git_repo/${git_code}.git $gcmDIR 2> $tmpFil |
123 |
|
|
retv=$? |
124 |
jmc |
1.1 |
set +x |
125 |
jmc |
1.6 |
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 |
jmc |
1.5 |
continue |
131 |
|
|
fi |
132 |
jmc |
1.1 |
fi |
133 |
|
|
echo "" |
134 |
|
|
echo "==========================================================================" |
135 |
|
|
|
136 |
jmc |
1.6 |
if test -d $gcmDIR/verification ; then |
137 |
jmc |
1.1 |
if test -e tr_run_$tt.log ; then mv -f tr_run_$tt.log tr_run_$tt.log_bak ; fi |
138 |
jmc |
1.6 |
cd $gcmDIR/verification |
139 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
-devel -q -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
155 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
-devel -q -match 5 -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
167 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
-devel -q -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
182 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
../tools/do_tst_2+2 -mpi -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
188 |
jmc |
1.1 |
;; |
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 |
jmc |
1.6 |
-devel -q -match 5 -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
198 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
../tools/do_tst_2+2 -mpi -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
204 |
jmc |
1.1 |
;; |
205 |
|
|
|
206 |
|
|
'gadm') |
207 |
|
|
|
208 |
|
|
./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_gfortran \ |
209 |
jmc |
1.6 |
-devel -ncad -nc -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
210 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
-devel -ncad -nc -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
218 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
-devel -ncad -nc -match 5 -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
226 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
-devel -nc -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
237 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
../tools/do_tst_2+2 -mpi -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
243 |
jmc |
1.1 |
;; |
244 |
|
|
|
245 |
|
|
'gmpi') |
246 |
|
|
|
247 |
|
|
./testreport -MPI 3 -of ../tools/build_options/linux_amd64_gfortran \ |
248 |
jmc |
1.6 |
-devel -nc -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
249 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
../tools/do_tst_2+2 -mpi -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
255 |
jmc |
1.1 |
;; |
256 |
|
|
|
257 |
|
|
'gmp4') |
258 |
|
|
|
259 |
|
|
./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \ |
260 |
jmc |
1.6 |
-devel -nc -match 5 -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
261 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
../tools/do_tst_2+2 -mpi -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
267 |
jmc |
1.1 |
;; |
268 |
|
|
|
269 |
|
|
'gfo') |
270 |
|
|
|
271 |
|
|
./testreport -of ../tools/build_options/linux_amd64_gfortran \ |
272 |
jmc |
1.6 |
-devel -nc -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
273 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
../tools/do_tst_2+2 -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
279 |
jmc |
1.1 |
;; |
280 |
|
|
|
281 |
|
|
'gfo4') |
282 |
|
|
|
283 |
|
|
./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \ |
284 |
jmc |
1.6 |
-devel -nc -match 5 -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
285 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
../tools/do_tst_2+2 -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
291 |
jmc |
1.1 |
;; |
292 |
|
|
|
293 |
|
|
'g77') |
294 |
|
|
|
295 |
|
|
./testreport -of ../tools/build_options/linux_amd64_g77 \ |
296 |
|
|
-skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \ |
297 |
jmc |
1.6 |
-nc -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
298 |
jmc |
1.1 |
|
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 |
jmc |
1.6 |
../tools/do_tst_2+2 -a $mAddr >> ../../tr_run_$tt.log 2>&1 |
304 |
jmc |
1.1 |
;; |
305 |
|
|
|
306 |
|
|
*) echo "unrecognized test suffix '$tt' <== skipped" ;; |
307 |
|
|
esac |
308 |
|
|
|
309 |
|
|
set +x |
310 |
|
|
cd ../.. |
311 |
|
|
|
312 |
|
|
else |
313 |
jmc |
1.6 |
echo "error: missing dir $gcmDIR/verification" |
314 |
jmc |
1.1 |
fi |
315 |
|
|
|
316 |
|
|
done |