25 |
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack' |
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack' |
26 |
cmdCVS='cvs -d /u/gcmpack' |
cmdCVS='cvs -d /u/gcmpack' |
27 |
|
|
28 |
TESTDIR="/scratch/jmc/test_"`hostname -s` |
# 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 |
MC=13 |
36 |
checkOut=1 |
checkOut=2 |
37 |
sepDir=1 |
sepDir=1 |
38 |
option= |
option= |
39 |
tst_list='g7a adm mpa g77 gfo+rs mth mp2+rs mpi ifc' |
#tst_list='g7a adm mpa g77 gfo+rs mth mp2+rs mpi ifc' |
40 |
#tst_list='g77 adm gfo ifc mth pgi+rs' |
#if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm oad" ; fi |
41 |
#tst_list='adm gfo+rs mth' |
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=0 |
#option="-nc" ; checkOut=1 |
48 |
#option="-q" ; checkOut=0 |
#option="-q" ; checkOut=1 |
49 |
|
|
50 |
TODAY=`date +%d` |
TODAY=`date +%d` |
51 |
tdir=$TESTDIR |
tdir=$TESTDIR |
52 |
if test $checkOut = '0' ; then |
if test $checkOut != 2 ; then |
53 |
if test -e $tdir/MITgcm/CVS ; then |
if test -e $tdir/MITgcm/CVS ; then |
54 |
echo $tdir/MITgcm/CVS 'exist' |
echo $tdir/MITgcm/CVS 'exist' |
55 |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
if test $sepDir = 0 -a $checkOut = 1 ; then |
56 |
cd $tdir/MITgcm |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
57 |
if test $sepDir = 1 ; then |
cd $tdir/MITgcm |
|
$cmdCVS update -P -d > /dev/null |
|
|
else |
|
58 |
$cmdCVS update -P -d |
$cmdCVS update -P -d |
59 |
|
echo " done" |
60 |
fi |
fi |
|
echo " done" |
|
61 |
else |
else |
62 |
echo -n $tdir/MITgcm 'missing ; ' |
echo -n $tdir/MITgcm 'missing ; ' |
63 |
checkOut=1 |
checkOut=2 |
64 |
fi |
fi |
65 |
fi |
fi |
66 |
if test $checkOut = '1' ; then |
if test $checkOut = 2 ; then |
67 |
if test -e $tdir ; then |
if test -e $tdir ; then |
68 |
echo -n "Removing working copy: $tdir/MITgcm ..." |
echo -n "Removing working copy: $tdir/MITgcm ..." |
69 |
test -e $tdir/MITgcm && rm -rf $tdir/MITgcm |
test -e $tdir/MITgcm && rm -rf $tdir/MITgcm |
89 |
|
|
90 |
echo "================================================================" |
echo "================================================================" |
91 |
typ=`echo $tt | sed 's/+rs//'` |
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: |
#- check day and time: |
98 |
curDay=`date +%d` ; curHour=`date +%H` |
curDay=`date +%d` ; curHour=`date +%H` |
99 |
if [ $curDay -ne $TODAY ] ; then |
if [ $curDay -ne $TODAY ] ; then |
104 |
date ; echo "too late to run test $typ" |
date ; echo "too late to run test $typ" |
105 |
continue |
continue |
106 |
fi |
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 |
#- clean-up old output files |
112 |
rm -f $tdir/output_${typ}* |
rm -f $tdir/output_${typ}* |
113 |
|
touch $tdir/output_$tt |
114 |
if test $sepDir = 1 ; then |
if test $sepDir = 1 ; then |
115 |
new_dir="MITgcm_$typ" |
new_dir="MITgcm_$typ" |
116 |
if test -d $new_dir/CVS -a $checkOut = '0' ; then |
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 |
pushd $new_dir |
119 |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
if test $tt != $typ ; then |
120 |
$cmdCVS update -P -d |
( cd verification ; ../tools/do_tst_2+2 -clean ) |
121 |
echo " done" |
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 |
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 |
test -e $new_dir && rm -rf $new_dir |
138 |
mkdir $new_dir |
mkdir $new_dir |
139 |
pushd $new_dir |
pushd $new_dir |
140 |
cp -ra ../MITgcm/* . |
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 |
fi |
148 |
else |
else |
149 |
pushd MITgcm |
pushd MITgcm |
151 |
cd verification |
cd verification |
152 |
|
|
153 |
#-- set the testreport command: |
#-- set the testreport command: |
|
nbl='-100' |
|
154 |
comm="./testreport" |
comm="./testreport" |
155 |
if test $typ = 'g7a' -o $typ = 'adm' -o $typ = 'mpa' ; then |
if test $typ = 'g7a' -o $typ = 'adm' -o $typ = 'mpa' ; then |
|
nbl='-60' |
|
156 |
comm="$comm -adm" |
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 |
elif test $typ = 'mth' -o $typ = 'mp2' ; then |
162 |
export GOMP_STACKSIZE=400m |
export GOMP_STACKSIZE=400m |
163 |
export OMP_NUM_THREADS=2 |
export OMP_NUM_THREADS=2 |
164 |
comm="$comm -mth" |
comm="$comm -mth" |
165 |
|
else |
166 |
|
comm="$comm -md cyrus-makedepend" |
167 |
fi |
fi |
168 |
comm="$comm -a jmc@mitgcm.org" |
comm="$comm -odir $outDir -a jmc@mitgcm.org" |
169 |
#-- set the optfile (+ mpi & match-precision) |
#-- set the optfile (+ mpi & match-precision) |
170 |
MPI=0 |
MPI=0 |
171 |
case $typ in |
case $typ in |
172 |
'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
173 |
'gfo'|'adm'|'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran' |
'gfo'|'adm'|'oad'|'tlm'|'mth') comm="$comm -match $MC -devel" |
174 |
comm="$comm -match $MC -devel" ;; |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
175 |
'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort11' ;; |
'ifc') comm="$comm -devel" |
176 |
|
OPTFILE='../tools/build_options/linux_amd64_ifort11' ;; |
177 |
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
178 |
'mpa'|'mpi'|'mp2') OPTFILE='../tools/build_options/linux_amd64_gfortran' |
'mpa'|'mpi'|'mp2') comm="$comm -match $MC -devel" ; MPI=6 |
179 |
comm="$comm -match $MC -devel" ; MPI=6 ;; |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
180 |
*) OPTFILE= ;; |
*) OPTFILE= ;; |
181 |
esac |
esac |
182 |
#-- set MPI command: |
#-- set MPI command: |
190 |
fi |
fi |
191 |
|
|
192 |
#-- set specific Env Vars: |
#-- 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 |
if test $typ = 'ifc' ; then |
197 |
source /srv/software/intel/intel-11.1.073/bin/ifortvars.sh intel64 |
source /srv/software/intel/intel-11.1.073/bin/ifortvars.sh intel64 |
198 |
fi |
fi |
203 |
export LM_LICENSE_FILE=$PGI/license.dat |
export LM_LICENSE_FILE=$PGI/license.dat |
204 |
fi |
fi |
205 |
|
|
206 |
if test $sepDir = 0 -a $checkOut = '1' -a $tt = $firstTst ; then |
if test $sepDir = 0 -a "x$option" = x -a $tt = $firstTst -a $checkOut != 2 ; then |
207 |
#-- cleaning: |
#-- cleaning: |
208 |
echo "======================" |
echo "======================" |
209 |
echo "Cleaning test directories:" |
echo "Cleaning test directories:" | tee -a $tdir/output_$tt |
210 |
cmdCLN="./testreport -clean" |
cmdCLN="./testreport -clean" |
211 |
echo " clean dir running: $cmdCLN" |
echo " clean dir running: $cmdCLN" | tee -a $tdir/output_$tt |
212 |
$cmdCLN > /dev/null 2>&1 |
$cmdCLN >> $tdir/output_$tt 2>&1 |
213 |
echo "======================" |
echo "======================" |
214 |
echo |
echo "" | tee -a $tdir/output_$tt |
215 |
fi |
fi |
216 |
|
|
217 |
#-- run the testreport command: |
#-- run the testreport command: |
218 |
echo -n "Running testreport using:" |
echo -n "Running testreport using:" | tee -a $tdir/output_$tt |
219 |
if test "x$OPTFILE" != x ; then |
if test "x$OPTFILE" != x ; then |
220 |
comm="$comm -of=$OPTFILE" |
comm="$comm -of=$OPTFILE" |
221 |
fi |
fi |
222 |
if test $MPI = 0 ; then echo '' |
if test $MPI = 0 ; then echo '' | tee -a $tdir/output_$tt |
223 |
else echo " (EXE='$EXE')" |
else echo " (EXE='$EXE')" | tee -a $tdir/output_$tt |
224 |
comm="$comm -MPI $MPI -command \"\$EXE\"" |
comm="$comm -MPI $MPI -command \"\$EXE\"" |
225 |
fi |
fi |
226 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
if test "x$option" != x ; then comm="$comm $option" ; fi |
227 |
#if test $typ = 'pgi' ; then comm="$comm -t \"\$listT\"" ; fi |
#if test $typ = 'pgi' ; then comm="$comm -t \"\$listT\"" ; fi |
228 |
echo " \"eval $comm\"" |
echo " \"eval $comm\"" | tee -a $tdir/output_$tt |
229 |
echo "======================" |
echo "======================" |
230 |
eval $comm > $tdir/output_$typ 2>&1 |
eval $comm >> $tdir/output_$tt 2>&1 |
231 |
tail $nbl $tdir/output_$typ |
sed -n "/^An email /,/^======== End of testreport / p" $tdir/output_$tt |
232 |
echo |
echo "" | tee -a $tdir/output_$tt |
233 |
|
|
234 |
#-- also test restart (test 2+2=4) |
#-- also test restart (test 2+2=4) |
235 |
if test $tt != $typ |
if test $tt != $typ |
236 |
then |
then |
237 |
echo "testing restart using:" |
echo "testing restart using:" | tee -a $tdir/output_$tt |
238 |
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
comm="../tools/do_tst_2+2 -o $outDir -a jmc@mitgcm.org" |
239 |
if test $MPI = 0 ; then |
if test $MPI = 0 ; then |
240 |
echo " \"$comm\"" |
echo " \"$comm\"" | tee -a $tdir/output_$tt |
241 |
echo "======================" |
echo "======================" |
242 |
$comm > $tdir/output_2+2 2>&1 |
$comm >> $tdir/output_$tt 2>&1 |
243 |
else |
else |
244 |
echo " \"$comm -mpi -exe $EXE\"" |
echo " \"$comm -mpi -exe $EXE\"" | tee -a $tdir/output_$tt |
245 |
echo "======================" |
echo "======================" |
246 |
$comm -mpi -exe "$EXE" > $tdir/output_2+2 2>&1 |
$comm -mpi -exe "$EXE" >> $tdir/output_$tt 2>&1 |
247 |
fi |
fi |
|
#tail $nbl $tdir/output_2+2 |
|
248 |
echo ; cat tst_2+2_out.txt |
echo ; cat tst_2+2_out.txt |
249 |
echo |
echo |
250 |
fi |
fi |
253 |
if test $sepDir = 0 ; then |
if test $sepDir = 0 ; then |
254 |
#-- cleaning: |
#-- cleaning: |
255 |
echo "======================" |
echo "======================" |
256 |
echo "Cleaning test directories:" |
echo "Cleaning test directories:" | tee -a $tdir/output_$tt |
257 |
if test $tt != $typ ; then |
if test $tt != $typ ; then |
258 |
cmdCLN="../tools/do_tst_2+2 -clean" |
cmdCLN="../tools/do_tst_2+2 -clean" |
259 |
echo " clean tst_2+2 running: $cmdCLN" |
echo " clean tst_2+2 running: $cmdCLN" | tee -a $tdir/output_$tt |
260 |
$cmdCLN >> $tdir/output_2+2 2>&1 |
$cmdCLN >> $tdir/output_$tt 2>&1 |
261 |
fi |
fi |
262 |
if test $tt != $last_Tst ; then |
if test $tt != $last_Tst ; then |
263 |
cmdCLN="./testreport -clean" |
cmdCLN="./testreport -clean" |
264 |
echo " clean dir running: $cmdCLN" |
echo " clean dir running: $cmdCLN" | tee -a $tdir/output_$tt |
265 |
$cmdCLN > /dev/null 2>&1 |
$cmdCLN >> $tdir/output_$tt 2>&1 |
266 |
fi |
fi |
267 |
echo "======================" |
echo "======================" |
268 |
echo |
echo |