/[MITgcm]/MITgcm_contrib/test_scripts/other/test_local
ViewVC logotype

Annotation of /MITgcm_contrib/test_scripts/other/test_local

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.9 - (hide annotations) (download)
Sun May 2 18:42:06 2021 UTC (4 years, 2 months ago) by jmc
Branch: MAIN
Changes since 1.8: +9 -1 lines
Add tst_2+2 report to main log file

1 jmc 1.1 #! /usr/bin/env bash
2    
3 jmc 1.9 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/test_local,v 1.8 2020/08/03 14:11:49 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 jmc 1.8 sendCmd='-a jm_c@mitgcm.org'
46     sendCmd='-send scp -a jm_c@mitgcm.org:testing/MITgcm-test'
47 jmc 1.1
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 jmc 1.6 gcmDIR="MITgcm_$tt"
74 jmc 1.1 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 jmc 1.6 if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then
80 jmc 1.1 #- cleaning previous testreport run and updating the code:
81     if [ $fwd -eq 0 ] ; then
82     set -x
83     #- cleanup previous test:
84 jmc 1.6 ( cd $gcmDIR/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 )
85 jmc 1.1 set +x
86     else
87     set -x
88     #- cleanup previous restart:
89 jmc 1.6 ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean > ../../tr_clean_$tt.log 2>&1 )
90 jmc 1.1 #- cleanup previous test:
91 jmc 1.6 ( cd $gcmDIR/verification ; ./testreport -clean >> ../../tr_clean_$tt.log 2>&1 )
92 jmc 1.1 set +x
93     fi
94     if [ $gfort -eq 0 ] ; then
95 jmc 1.6 echo ' remove all Makefile_syntax' >> tr_clean_$tt.log
96     ( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax )
97 jmc 1.1 fi
98 jmc 1.6 echo "" >> tr_clean_$tt.log
99 jmc 1.1
100 jmc 1.6 echo "==========================================================================" \
101     >> tr_clean_$tt.log
102     echo " Update MITgcm code in dir: $gcmDIR using 'git pull':" | tee -a tr_clean_$tt.log
103 jmc 1.1 set -x
104     #- update the code:
105 jmc 1.7 ( cd $gcmDIR ; git pull ) >> tr_clean_$tt.log 2>&1 ; retv=$?
106 jmc 1.1 set +x
107 jmc 1.5 if test $retv != 0 ; then
108 jmc 1.6 echo "'git pull' in $gcmDIR fail (return val=$retv) => skip" | tee -a tr_clean_$tt.log
109 jmc 1.5 continue
110     fi
111 jmc 1.7 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 jmc 1.1 else
116 jmc 1.6 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 jmc 1.1 #- download new code:
123 jmc 1.6 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 jmc 1.1 set -x
127 jmc 1.6 git clone https://github.com/$git_repo/${git_code}.git $gcmDIR 2> $tmpFil
128     retv=$?
129 jmc 1.1 set +x
130 jmc 1.6 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 jmc 1.5 continue
136     fi
137 jmc 1.1 fi
138     echo ""
139     echo "=========================================================================="
140    
141 jmc 1.6 if test -d $gcmDIR/verification ; then
142 jmc 1.1 if test -e tr_run_$tt.log ; then mv -f tr_run_$tt.log tr_run_$tt.log_bak ; fi
143 jmc 1.6 cd $gcmDIR/verification
144 jmc 1.1
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 jmc 1.8 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
160 jmc 1.1
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 jmc 1.8 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
172 jmc 1.1
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 jmc 1.8 -devel -q $sendCmd >> ../../tr_run_$tt.log 2>&1
187 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
193 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
194 jmc 1.1 ;;
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 jmc 1.8 -devel -q -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
204 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
210 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
211 jmc 1.1 ;;
212    
213     'gadm')
214    
215     ./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_gfortran \
216 jmc 1.8 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
217 jmc 1.1
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 jmc 1.8 -devel -ncad -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
225 jmc 1.1
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 jmc 1.8 -devel -ncad -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
233 jmc 1.1
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 jmc 1.8 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
244 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
250 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
251 jmc 1.1 ;;
252    
253     'gmpi')
254    
255     ./testreport -MPI 3 -of ../tools/build_options/linux_amd64_gfortran \
256 jmc 1.8 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
257 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
263 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
264 jmc 1.1 ;;
265    
266     'gmp4')
267    
268     ./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \
269 jmc 1.8 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
270 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 -mpi $sendCmd >> ../../tr_run_$tt.log 2>&1
276 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
277 jmc 1.1 ;;
278    
279     'gfo')
280    
281     ./testreport -of ../tools/build_options/linux_amd64_gfortran \
282 jmc 1.8 -devel -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
283 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
289 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
290 jmc 1.1 ;;
291    
292     'gfo4')
293    
294     ./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \
295 jmc 1.8 -devel -nc -match 5 $sendCmd >> ../../tr_run_$tt.log 2>&1
296 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
302 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
303 jmc 1.1 ;;
304    
305     'g77')
306    
307     ./testreport -of ../tools/build_options/linux_amd64_g77 \
308     -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \
309 jmc 1.8 -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
310 jmc 1.1
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 jmc 1.8 ../tools/do_tst_2+2 $sendCmd >> ../../tr_run_$tt.log 2>&1
316 jmc 1.9 sed -n '/^===== Summary /,$ p' ../../tr_run_$tt.log
317 jmc 1.1 ;;
318    
319     *) echo "unrecognized test suffix '$tt' <== skipped" ;;
320     esac
321    
322     set +x
323     cd ../..
324    
325     else
326 jmc 1.6 echo "error: missing dir $gcmDIR/verification"
327 jmc 1.1 fi
328    
329     done

  ViewVC Help
Powered by ViewVC 1.1.22