14 |
export LC_ALL="en_US.UTF-8" |
export LC_ALL="en_US.UTF-8" |
15 |
# Turn off stack limit for FIZHI & AD-tests |
# Turn off stack limit for FIZHI & AD-tests |
16 |
ulimit -s unlimited |
ulimit -s unlimited |
17 |
|
# MPI test (for now, only with gfortran) |
18 |
|
export MPI_GCC_DIR=/srv/software/gcc/gcc-packages/gcc-4.4.5/mpich2/mpich2-1.3 |
19 |
|
export MPI_INC_DIR=$MPI_GCC_DIR/include |
20 |
|
export PATH="$PATH:$MPI_GCC_DIR/bin" |
21 |
|
|
22 |
#- method to acces CVS: |
#- method to acces CVS: |
23 |
# export CVSROOT='/u/gcmpack' |
# export CVSROOT='/u/gcmpack' |
28 |
cmdCVS='cvs -d /u/gcmpack' |
cmdCVS='cvs -d /u/gcmpack' |
29 |
|
|
30 |
TESTDIR="/scratch/jmc/test_"`hostname -s` |
TESTDIR="/scratch/jmc/test_"`hostname -s` |
31 |
MC=10 |
MC=13 |
32 |
checkOut=1 |
checkOut=1 |
33 |
sepDir=1 |
sepDir=1 |
34 |
option= |
option= |
35 |
tst_list='g77 adm gfo+rs mth ifc' |
tst_list='g7a adm mpa g77 gfo+rs mth mp2+rs mpi ifc' |
36 |
#tst_list='g77 adm gfo ifc mth pgi+rs' |
#tst_list='g77 adm gfo ifc mth pgi+rs' |
37 |
#tst_list='adm g77 gfo+rs mth' |
#tst_list='g77 gfo+rs mth' |
38 |
|
|
39 |
#option="-nc" ; checkOut=0 |
#option="-nc" ; checkOut=0 |
40 |
#option="-q" ; checkOut=0 |
#option="-q" ; checkOut=0 |
81 |
for tt in $tst_list |
for tt in $tst_list |
82 |
do |
do |
83 |
|
|
84 |
echo "================================================================" |
echo "================================================================" |
85 |
typ=`echo $tt | sed 's/+rs//'` |
typ=`echo $tt | sed 's/+rs//'` |
86 |
#- check day and time: |
#- check day and time: |
87 |
curDay=`date +%d` ; curHour=`date +%H` |
curDay=`date +%d` ; curHour=`date +%H` |
88 |
if [ $curDay -ne $TODAY ] ; then |
if [ $curDay -ne $TODAY ] ; then |
89 |
date ; echo "day is over => skip test $typ" |
date ; echo "day is over => skip test $typ" |
90 |
continue |
continue |
91 |
fi |
fi |
92 |
if [ $curHour -ge 18 ] ; then |
if [ $curHour -ge 18 ] ; then |
93 |
date ; echo "too late to run test $typ" |
date ; echo "too late to run test $typ" |
94 |
continue |
continue |
95 |
fi |
fi |
96 |
#- clean-up old output files |
#- clean-up old output files |
97 |
rm -f $tdir/output_${typ}* |
rm -f $tdir/output_${typ}* |
98 |
if test $sepDir = 1 ; then |
if test $sepDir = 1 ; then |
99 |
new_dir="MITgcm_$typ" |
new_dir="MITgcm_$typ" |
100 |
if test -d $new_dir/CVS -a $checkOut = '0' ; then |
if test -d $new_dir/CVS -a $checkOut = '0' ; then |
101 |
pushd $new_dir |
pushd $new_dir |
102 |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
103 |
$cmdCVS update -P -d |
$cmdCVS update -P -d |
104 |
echo " done" |
echo " done" |
105 |
|
else |
106 |
|
test -e $new_dir && rm -rf $new_dir |
107 |
|
mkdir $new_dir |
108 |
|
pushd $new_dir |
109 |
|
cp -ra ../MITgcm/* . |
110 |
|
fi |
111 |
else |
else |
112 |
test -e $new_dir && rm -rf $new_dir |
pushd MITgcm |
|
mkdir $new_dir |
|
|
pushd $new_dir |
|
|
cp -ra ../MITgcm/* . |
|
113 |
fi |
fi |
114 |
else |
cd verification |
|
pushd MITgcm |
|
|
fi |
|
|
cd verification |
|
115 |
|
|
116 |
case $typ in |
#-- set the testreport command: |
117 |
'g77') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
nbl='-100' |
118 |
'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
comm="./testreport" |
119 |
'gfo') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
if test $typ = 'g7a' -o $typ = 'adm' -o $typ = 'mpa' ; then |
120 |
'adm') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
nbl='-60' |
121 |
'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort' ;; |
comm="$comm -adm" |
122 |
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
elif test $typ = 'mth' -o $typ = 'mp2' ; then |
123 |
'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran' |
export GOMP_STACKSIZE=400m |
124 |
export GOMP_STACKSIZE=400m ;; |
export OMP_NUM_THREADS=2 |
125 |
*) OPTFILE= ;; |
comm="$comm -mth" |
126 |
esac |
fi |
127 |
|
comm="$comm -a jmc@mitgcm.org" |
128 |
|
#-- set the optfile (+ mpi & match-precision) |
129 |
|
MPI=0 |
130 |
|
case $typ in |
131 |
|
'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
132 |
|
'gfo'|'adm'|'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran' |
133 |
|
comm="$comm -match $MC" ;; |
134 |
|
'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort11' ;; |
135 |
|
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
136 |
|
'mpa'|'mpi'|'mp2') OPTFILE='../tools/build_options/linux_amd64_gfortran+mpi_generic' |
137 |
|
comm="$comm -match $MC" ; MPI=1 ;; |
138 |
|
*) OPTFILE= ;; |
139 |
|
esac |
140 |
|
#-- set MPI command: |
141 |
|
if test $MPI = 1 ; then |
142 |
|
if test $typ = 'mpa' ; then |
143 |
|
EXE="mpirun -np TR_NPROC ./mitgcmuv_ad" |
144 |
|
else |
145 |
|
EXE="mpirun -np TR_NPROC ./mitgcmuv" |
146 |
|
fi |
147 |
|
fi |
148 |
|
|
149 |
if test $sepDir = 0 -a $checkOut = '1' -a $tt = $firstTst ; then |
if test $sepDir = 0 -a $checkOut = '1' -a $tt = $firstTst ; then |
150 |
#-- cleaning: |
#-- cleaning: |
151 |
echo "======================" |
echo "======================" |
152 |
echo "Cleaning test directories:" |
echo "Cleaning test directories:" |
153 |
cmdCLN="./testreport -clean" |
cmdCLN="./testreport -clean" |
154 |
echo " clean dir running: $cmdCLN" |
echo " clean dir running: $cmdCLN" |
155 |
$cmdCLN > /dev/null 2>&1 |
$cmdCLN > /dev/null 2>&1 |
156 |
echo "======================" |
echo "======================" |
157 |
echo |
echo |
|
fi |
|
|
|
|
|
if test $typ = 'g77' |
|
|
then |
|
|
|
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -a jmc@mitgcm.org" |
|
|
# comm="$comm -match $MC" |
|
|
if test "x$OPTFILE" != x ; then |
|
|
comm="$comm -of=$OPTFILE" |
|
158 |
fi |
fi |
|
if test "x$option" != x ; then comm="$comm $option" ; fi |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_$typ 2>&1 |
|
|
tail -100 $tdir/output_$typ |
|
|
echo |
|
|
|
|
|
fi |
|
|
|
|
|
if test $typ = 'gfo' |
|
|
then |
|
159 |
|
|
160 |
echo "Running testreport using:" |
#-- set specific Env Vars: |
161 |
comm="./testreport -a jmc@mitgcm.org" |
if test $typ = 'ifc' ; then |
162 |
comm="$comm -match $MC" |
source /srv/software/intel/intel-11.1.073/bin/ifortvars.sh intel64 |
|
if test "x$OPTFILE" != x ; then |
|
|
comm="$comm -of=$OPTFILE" |
|
163 |
fi |
fi |
164 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
if test $typ = 'pgi' ; then |
165 |
echo " \"$comm\"" |
export PGI=/srv/software/pgi/pgi-10.9 |
166 |
echo "======================" |
export PATH="$PATH:$PGI/linux86-64/10.9/bin" |
167 |
$comm > $tdir/output_$typ 2>&1 |
export LM_LICENSE_FILE=$PGI/license.dat |
|
tail -100 $tdir/output_$typ |
|
|
echo |
|
|
|
|
|
fi |
|
|
|
|
|
if test $typ = 'adm' |
|
|
then |
|
|
|
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -adm -a jmc@mitgcm.org" |
|
|
comm="$comm -match $MC" |
|
|
if test "x$OPTFILE" != x ; then |
|
|
comm="$comm -of=$OPTFILE" |
|
168 |
fi |
fi |
|
if test "x$option" != x ; then comm="$comm $option" ; fi |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_$typ 2>&1 |
|
|
tail -60 $tdir/output_$typ |
|
|
echo |
|
|
|
|
|
fi |
|
169 |
|
|
170 |
if test $typ = 'ifc' |
#-- run the testreport command: |
171 |
then |
echo -n "Running testreport using:" |
|
|
|
|
source /srv/software/intel/intel-11.1.073/bin/ifortvars.sh intel64 |
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -a jmc@mitgcm.org" |
|
|
comm="$comm -match $MC" |
|
172 |
if test "x$OPTFILE" != x ; then |
if test "x$OPTFILE" != x ; then |
173 |
comm="$comm -of=$OPTFILE" |
comm="$comm -of=$OPTFILE" |
174 |
fi |
fi |
175 |
|
if test $MPI = 1 ; then echo " (EXE='$EXE')" |
176 |
|
comm="$comm -MPI 6 -command \"\$EXE\"" |
177 |
|
else echo '' ; fi |
178 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
if test "x$option" != x ; then comm="$comm $option" ; fi |
179 |
echo " \"$comm\"" |
#if test $typ = 'pgi' ; then comm="$comm -skd tutorial_advection_in_gyre" ; fi |
180 |
|
echo " \"eval $comm\"" |
181 |
echo "======================" |
echo "======================" |
182 |
$comm > $tdir/output_$typ 2>&1 |
eval $comm > $tdir/output_$typ 2>&1 |
183 |
tail -100 $tdir/output_$typ |
tail $nbl $tdir/output_$typ |
184 |
echo |
echo |
185 |
|
|
186 |
fi |
#-- also test restart (test 2+2=4) |
187 |
|
if test $tt != $typ |
188 |
if test $typ = 'mth' |
then |
189 |
then |
echo "testing restart using:" |
190 |
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
191 |
export OMP_NUM_THREADS=2 |
if test $MPI = 1 ; then |
192 |
echo "Running testreport using:" |
echo " \"$comm -mpi -exe $EXE\"" |
193 |
comm="./testreport -mth -a jmc@mitgcm.org" |
echo "======================" |
194 |
comm="$comm -match $MC" |
$comm -mpi -exe "$EXE" > $tdir/output_2+2 2>&1 |
195 |
if test "x$OPTFILE" != x ; then |
else |
196 |
comm="$comm -of=$OPTFILE" |
echo " \"$comm\"" |
197 |
fi |
echo "======================" |
198 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
$comm > $tdir/output_2+2 2>&1 |
199 |
echo " \"$comm\"" |
fi |
200 |
echo "======================" |
#tail $nbl $tdir/output_2+2 |
201 |
$comm > $tdir/output_$typ 2>&1 |
echo ; cat tst_2+2_out.txt |
202 |
tail -100 $tdir/output_$typ |
echo |
|
echo |
|
|
|
|
|
fi |
|
|
|
|
|
if test $typ = 'pgi' |
|
|
then |
|
|
|
|
|
export PGI=/srv/software/pgi/pgi-10.9 |
|
|
export PATH=$PGI/linux86-64/10.9/bin:$PATH |
|
|
export LM_LICENSE_FILE=$PGI/license.dat |
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -dd" |
|
|
comm="$comm -match $MC" |
|
|
#comm="$comm -skd tutorial_advection_in_gyre" |
|
|
if test "x$OPTFILE" != x ; then |
|
|
comm="$comm -of=$OPTFILE" |
|
|
fi |
|
|
if test "x$option" != x ; then comm="$comm $option" ; fi |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_${typ}_1 2>&1 |
|
|
tail -100 $tdir/output_${typ}_1 |
|
|
echo |
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -q -a jmc@mitgcm.org" |
|
|
comm="$comm -match $MC" |
|
|
#comm="$comm -skd tutorial_advection_in_gyre" |
|
|
if test "x$OPTFILE" != x ; then |
|
|
comm="$comm -of=$OPTFILE" |
|
203 |
fi |
fi |
204 |
echo " \"$comm\"" |
export OMP_NUM_THREADS=1 |
|
echo "======================" |
|
|
$comm > $tdir/output_${typ}_2 2>&1 |
|
|
tail -100 $tdir/output_${typ}_2 |
|
|
echo |
|
|
|
|
|
fi |
|
205 |
|
|
206 |
#-- also test restart (test 2+2=4) |
if test $sepDir = 0 ; then |
207 |
if test $tt != $typ |
#-- cleaning: |
208 |
then |
echo "======================" |
209 |
echo "testing restart using:" |
echo "Cleaning test directories:" |
210 |
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
if test $tt != $typ ; then |
211 |
echo " \"$comm\"" |
cmdCLN="../tools/do_tst_2+2 -clean" |
212 |
|
echo " clean tst_2+2 running: $cmdCLN" |
213 |
|
$cmdCLN >> $tdir/output_2+2 2>&1 |
214 |
|
fi |
215 |
|
if test $tt != $last_Tst ; then |
216 |
|
cmdCLN="./testreport -clean" |
217 |
|
echo " clean dir running: $cmdCLN" |
218 |
|
$cmdCLN > /dev/null 2>&1 |
219 |
|
fi |
220 |
echo "======================" |
echo "======================" |
|
$comm > $tdir/output_2+2 2>&1 |
|
|
#tail -100 $tdir/output_2+2 |
|
|
echo ; cat tst_2+2_out.txt |
|
221 |
echo |
echo |
222 |
fi |
fi |
|
export OMP_NUM_THREADS=1 |
|
|
|
|
|
if test $sepDir = 0 ; then |
|
|
#-- cleaning: |
|
|
echo "======================" |
|
|
echo "Cleaning test directories:" |
|
|
if test $tt != $typ ; then |
|
|
cmdCLN="../tools/do_tst_2+2 -clean" |
|
|
echo " clean tst_2+2 running: $cmdCLN" |
|
|
$cmdCLN >> $tdir/output_2+2 2>&1 |
|
|
fi |
|
|
if test $tt != $last_Tst ; then |
|
|
cmdCLN="./testreport -clean" |
|
|
echo " clean dir running: $cmdCLN" |
|
|
$cmdCLN > /dev/null 2>&1 |
|
|
fi |
|
|
echo "======================" |
|
|
echo |
|
|
fi |
|
223 |
popd |
popd |
224 |
|
|
225 |
done |
done |