/[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.12 - (hide annotations) (download)
Thu Feb 16 21:29:01 2023 UTC (2 years, 4 months ago) by jmc
Branch: MAIN
Changes since 1.11: +3 -2 lines
remove g77 tests (not available with fc37)

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

  ViewVC Help
Powered by ViewVC 1.1.22