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 |
|
# 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` |
dInWeek=`date +%a` |
33 |
TESTDIR="/scratch/jmc/test_"`hostname -s` |
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 |
if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm" ; fi |
#if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm oad" ; fi |
41 |
#tst_list='g77 adm gfo ifc mth pgi+rs' |
outDir="${outDir}-a" |
42 |
#tst_list='adm gfo+rs mth' |
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 |
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 |
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 |
156 |
comm="$comm -adm" |
comm="$comm -adm" |
157 |
|
elif test $typ = 'oad' ; then |
158 |
|
comm="$comm -oad" |
159 |
elif test $typ = 'tlm' ; then |
elif test $typ = 'tlm' ; then |
160 |
comm="$comm -tlm" |
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'|'tlm'|'mth') comm="$comm -match $MC -devel" |
'gfo'|'adm'|'oad'|'tlm'|'mth') comm="$comm -match $MC -devel" |
174 |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
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') comm="$comm -match $MC -devel" ; MPI=6 |
'mpa'|'mpi'|'mp2') comm="$comm -match $MC -devel" ; MPI=6 |
179 |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
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:" | tee -a $tdir/output_$tt |
echo "Cleaning test directories:" | tee -a $tdir/output_$tt |
235 |
if test $tt != $typ |
if test $tt != $typ |
236 |
then |
then |
237 |
echo "testing restart using:" | tee -a $tdir/output_$tt |
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\"" | tee -a $tdir/output_$tt |
echo " \"$comm\"" | tee -a $tdir/output_$tt |
241 |
echo "======================" |
echo "======================" |