/[MITgcm]/MITgcm/tools/example_scripts/csail/test_baudelaire
ViewVC logotype

Contents of /MITgcm/tools/example_scripts/csail/test_baudelaire

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


Revision 1.26 - (show annotations) (download)
Fri May 20 19:16:00 2016 UTC (7 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65x
Changes since 1.25: +4 -1 lines
exp. "global_oce_biogeo_bling" from Contrib/verification_other
added to standard gfortran daily test

1 #! /usr/bin/env bash
2
3 # $Header: /u/gcmpack/MITgcm/tools/example_scripts/csail/test_baudelaire,v 1.25 2016/05/10 14:41:00 jmc Exp $
4
5 # Test script for MITgcm that should work on most of the csail.mit.edu Linux machines.
6
7 tst_grp=0 ; if test $# = 1 ; then tst_grp=$1 ; fi
8 if test $tst_grp != 'a' -a $tst_grp != 'b' ; then
9 echo "missing or invalid argument (expect: 'a' or 'b') ==> exit"
10 exit 1
11 fi
12
13 # defaults
14 #export PATH="$PATH:/usr/local/bin"
15 if [ -d ~/bin ]; then export PATH=$PATH:~/bin ; fi
16 #- to get case insensitive "ls" (and order of tested experiments)
17 export LC_ALL="en_US.UTF-8"
18 # Turn off stack limit for FIZHI & AD-tests
19 ulimit -s unlimited
20 # MPI test (for now, only with gfortran)
21 export MPI_GCC_DIR=/srv/software/gcc/gcc-packages/gcc-4.4.5/mpich2/mpich2-1.3
22 export MPI_INC_DIR=$MPI_GCC_DIR/include
23 export PATH="$PATH:$MPI_GCC_DIR/bin"
24
25 #- method to acces CVS:
26 # export CVSROOT='/u/gcmpack'
27 # export CVSROOT=':ext:@mitgcm.org:/u/gcmpack'
28 # export CVS_RSH='ssh' ; cvs co -P MITgcm > /dev/null
29 # cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P MITgcm > /dev/null
30 cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack'
31 cmdCVS='cvs -d /u/gcmpack'
32
33 # checkOut=2 : download new code ;
34 # =3 : skip download but, if sepDir, use a new copy
35 # =1 : update code (if no existing code -> swith to 2)
36 # =0 : use existing code (if no existing code -> swith to 2)
37 dInWeek=`date +%a`
38 outDir=`hostname -s`
39 TESTDIR="/scratch/jmc/test_${outDir}"
40 outDir="${outDir}-${tst_grp}"
41 MC=13
42 sepDir=1
43 option=
44 #tst_list='g7a adm mpa g77 gfo+rs mth mp2+rs mpi ifc'
45 #if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm oad" ; fi
46 if test $tst_grp = 'a' ; then
47 checkOut=2
48 tst_list='g7a mpa mth mp2+rs mpi oad'
49 else
50 checkOut=3
51 tst_list='adm g77 gfo+rs ifc'
52 if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm" ; fi
53 fi
54 echo " test: $outDir ; list='$tst_list'"
55
56 #option="-nc" ; checkOut=1
57 #option="-q" ; checkOut=1
58
59 TODAY=`date +%d`
60 tdir=$TESTDIR
61 if test $checkOut != 2 ; then
62 if test -e $tdir/MITgcm/CVS ; then
63 echo $tdir/MITgcm/CVS 'exist'
64 if test $sepDir = 0 -a $checkOut = 1 ; then
65 echo -n "Update the MITgcm code using: $cmdCVS ..."
66 cd $tdir/MITgcm
67 $cmdCVS update -P -d
68 echo " done"
69 fi
70 else
71 echo -n $tdir/MITgcm 'missing ; '
72 checkOut=2
73 fi
74 fi
75 if test $checkOut = 2 ; then
76 if test -e $tdir ; then
77 echo -n "Removing working copy: $tdir/MITgcm ..."
78 test -e $tdir/MITgcm && rm -rf $tdir/MITgcm
79 else
80 echo -n "Creating a working dir: $tdir ..."
81 mkdir $tdir
82 fi
83 echo " done"
84 echo -n "Downloading the MITgcm code using: $cmdCVS ..."
85 cd $tdir
86 $cmdCVS co -P MITgcm > /dev/null
87 echo " done"
88 else
89 cd $tdir
90 fi
91
92 #------------------------------------------------------------------------
93
94 firstTst=`echo $tst_list | awk '{print $1}'`
95 last_Tst=`echo $tst_list | awk '{print $NF}'`
96 for tt in $tst_list
97 do
98
99 echo "================================================================"
100 typ=`echo $tt | sed 's/+rs//'`
101 #- define list of additional experiences to test:
102 addExp=''
103 if test $typ = 'mp2' -o $typ = 'ifc' ; then
104 addExp="offline_cheapaml atm_gray"
105 fi
106 if test $typ = 'gfo' ; then
107 addExp="$addExp global_oce_biogeo_bling"
108 fi
109 if test $typ = 'gfo' ; then
110 addExp="$addExp shelfice_remeshing"
111 fi
112 #- check day and time:
113 curDay=`date +%d` ; curHour=`date +%H`
114 if [ $curDay -ne $TODAY ] ; then
115 date ; echo "day is over => skip test $typ"
116 continue
117 fi
118 if [ $curHour -ge 18 ] ; then
119 date ; echo "too late to run test $typ"
120 continue
121 fi
122 if test $sepDir = 0 -a "x$option" != x -a $tt != $last_Tst ; then
123 echo "using option='$option' prevent multi-tests => skip test $typ"
124 continue
125 fi
126 #- clean-up old output files
127 rm -f $tdir/output_${typ}*
128 touch $tdir/output_$tt
129 if test $sepDir = 1 ; then
130 new_dir="MITgcm_$typ"
131 reUse=1 ; if [ $checkOut -ge 2 ] ; then reUse=0 ; fi
132 if test -d $new_dir/CVS -a $reUse = 1 ; then
133 pushd $new_dir
134 if test $tt != $typ ; then
135 ( cd verification ; ../tools/do_tst_2+2 -clean )
136 fi
137 if test $checkOut = 1 ; then
138 echo -n "Update the MITgcm code using: $cmdCVS ..."
139 $cmdCVS update -P -d
140 echo " done"
141 fi
142 else
143 if test -d prev ; then
144 #-- save previous summary:
145 oldS=`ls -t ${new_dir}/verification/tr_${outDir}_*/summary.txt 2> /dev/null | head -1`
146 if test "x$oldS" != x ; then cp -p -f $oldS prev/tr_out.$typ ; fi
147 if test $tt != $typ ; then
148 oldS=`ls -t ${new_dir}/verification/rs_${outDir}_*/summary.txt 2> /dev/null | head -1`
149 if test "x$oldS" != x ; then cp -p -f $oldS prev/rs_out.$typ ; fi
150 fi
151 fi
152 test -e $new_dir && rm -rf $new_dir
153 mkdir $new_dir
154 pushd $new_dir
155 cp -ra ../MITgcm/* .
156 #-- download additional experience from Contrib:
157 for exp2add in $addExp ; do
158 echo " add dir: $exp2add (from Contrib:verification_other)"
159 ( cd verification ; $cmdCVS co -P -d $exp2add \
160 MITgcm_contrib/verification_other/$exp2add > /dev/null )
161 done
162 fi
163 else
164 pushd MITgcm
165 fi
166 cd verification
167
168 #-- set the testreport command:
169 comm="./testreport"
170 if test $typ = 'g7a' -o $typ = 'adm' -o $typ = 'mpa' ; then
171 comm="$comm -adm"
172 elif test $typ = 'oad' ; then
173 comm="$comm -oad"
174 elif test $typ = 'tlm' ; then
175 comm="$comm -tlm"
176 elif test $typ = 'mth' -o $typ = 'mp2' ; then
177 export GOMP_STACKSIZE=400m
178 export OMP_NUM_THREADS=2
179 comm="$comm -mth"
180 else
181 comm="$comm -md cyrus-makedepend"
182 fi
183 comm="$comm -odir $outDir -a jmc@mitgcm.org"
184 #-- set the optfile (+ mpi & match-precision)
185 MPI=0
186 case $typ in
187 'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;;
188 'gfo'|'adm'|'oad'|'tlm'|'mth') comm="$comm -match $MC -devel"
189 OPTFILE='../tools/build_options/linux_amd64_gfortran' ;;
190 'ifc') comm="$comm -devel"
191 OPTFILE='../tools/build_options/linux_amd64_ifort11' ;;
192 'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;;
193 'mpa'|'mpi'|'mp2') comm="$comm -match $MC -devel" ; MPI=6
194 OPTFILE='../tools/build_options/linux_amd64_gfortran' ;;
195 *) OPTFILE= ;;
196 esac
197 #-- set MPI command:
198 if test $MPI != 0 ; then
199 if test $typ = 'mp2' ; then MPI=3 ; fi
200 if test $typ = 'mpa' ; then
201 EXE="mpirun -np TR_NPROC ./mitgcmuv_ad"
202 else
203 EXE="mpirun -np TR_NPROC ./mitgcmuv"
204 fi
205 fi
206
207 #-- set specific Env Vars:
208 if test $typ = 'oad' ; then
209 source ~jmc/mitgcm/bin/setenv_OpenAD.sh
210 fi
211 if test $typ = 'ifc' ; then
212 source /srv/software/intel/intel-11.1.073/bin/ifortvars.sh intel64
213 fi
214 if test $typ = 'pgi' ; then
215 #listT='fizhi-cs-32x32x40 fizhi-cs-aqualev20'
216 export PGI=/srv/software/pgi/pgi-10.9
217 export PATH="$PATH:$PGI/linux86-64/10.9/bin"
218 export LM_LICENSE_FILE=$PGI/license.dat
219 fi
220
221 if test $sepDir = 0 -a "x$option" = x -a $tt = $firstTst -a $checkOut != 2 ; then
222 #-- cleaning:
223 echo "======================"
224 echo "Cleaning test directories:" | tee -a $tdir/output_$tt
225 cmdCLN="./testreport -clean"
226 echo " clean dir running: $cmdCLN" | tee -a $tdir/output_$tt
227 $cmdCLN >> $tdir/output_$tt 2>&1
228 echo "======================"
229 echo "" | tee -a $tdir/output_$tt
230 fi
231
232 #-- run the testreport command:
233 echo -n "Running testreport using:" | tee -a $tdir/output_$tt
234 if test "x$OPTFILE" != x ; then
235 comm="$comm -of=$OPTFILE"
236 fi
237 if test $MPI = 0 ; then echo '' | tee -a $tdir/output_$tt
238 else echo " (EXE='$EXE')" | tee -a $tdir/output_$tt
239 comm="$comm -MPI $MPI -command \"\$EXE\""
240 fi
241 if test "x$option" != x ; then comm="$comm $option" ; fi
242 #if test $typ = 'pgi' ; then comm="$comm -t \"\$listT\"" ; fi
243 echo " \"eval $comm\"" | tee -a $tdir/output_$tt
244 echo "======================"
245 eval $comm >> $tdir/output_$tt 2>&1
246 sed -n "/^An email /,/^======== End of testreport / p" $tdir/output_$tt
247 echo "" | tee -a $tdir/output_$tt
248
249 #-- also test restart (test 2+2=4)
250 if test $tt != $typ
251 then
252 echo "testing restart using:" | tee -a $tdir/output_$tt
253 comm="../tools/do_tst_2+2 -o $outDir -a jmc@mitgcm.org"
254 if test $MPI = 0 ; then
255 echo " \"$comm\"" | tee -a $tdir/output_$tt
256 echo "======================"
257 $comm >> $tdir/output_$tt 2>&1
258 else
259 echo " \"$comm -mpi -exe $EXE\"" | tee -a $tdir/output_$tt
260 echo "======================"
261 $comm -mpi -exe "$EXE" >> $tdir/output_$tt 2>&1
262 fi
263 echo ; cat tst_2+2_out.txt
264 echo
265 fi
266 export OMP_NUM_THREADS=1
267
268 if test $sepDir = 0 ; then
269 #-- cleaning:
270 echo "======================"
271 echo "Cleaning test directories:" | tee -a $tdir/output_$tt
272 if test $tt != $typ ; then
273 cmdCLN="../tools/do_tst_2+2 -clean"
274 echo " clean tst_2+2 running: $cmdCLN" | tee -a $tdir/output_$tt
275 $cmdCLN >> $tdir/output_$tt 2>&1
276 fi
277 if test $tt != $last_Tst ; then
278 cmdCLN="./testreport -clean"
279 echo " clean dir running: $cmdCLN" | tee -a $tdir/output_$tt
280 $cmdCLN >> $tdir/output_$tt 2>&1
281 fi
282 echo "======================"
283 echo
284 fi
285 popd
286
287 done

  ViewVC Help
Powered by ViewVC 1.1.22