/[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.22 - (show annotations) (download)
Fri Jan 29 14:15:28 2016 UTC (8 years, 3 months ago) by jmc
Branch: MAIN
Changes since 1.21: +12 -1 lines
add 2 experiments (atm_gray & offline_cheapaml) from Contrib:verification_other
 to mpi+mth (gfortran) test and ifc test

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

  ViewVC Help
Powered by ViewVC 1.1.22