2 |
|
|
3 |
# $Header$ |
# $Header$ |
4 |
|
|
|
# Ed Hill |
|
|
|
|
5 |
# Test script for MITgcm that should work on most of the csail.mit.edu |
# Test script for MITgcm that should work on most of the csail.mit.edu |
6 |
# Linux machines. |
# Linux machines. |
7 |
|
|
8 |
# defaults |
# defaults |
9 |
export PATH="$PATH:/usr/local/bin" |
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 |
TESTDIR="/tmp/jmc/test_"`hostname -s` |
TESTDIR="/tmp/jmc/test_"`hostname -s` |
29 |
MC=10 |
MC=13 |
30 |
checkOut=1 |
checkOut=1 |
31 |
sepDir=0 |
sepDir=0 |
32 |
#tst_list='adm g77 pgi gfo ifc mth' |
option= |
33 |
tst_list='adm g77 gfo+rs mth' |
#tst_list='g7a adm mpa g77 gfo+rs mth mp2+rs mpi ifc' |
34 |
|
#tst_list='g77 adm gfo ifc mth pgi+rs' |
35 |
|
tst_list='g77 gfo+rs mth' |
36 |
|
|
37 |
# Turn off stack limit for FIZHI |
#option="-nc" ; checkOut=0 |
38 |
ulimit -s unlimited |
#option="-q" ; checkOut=0 |
39 |
|
|
40 |
|
TODAY=`date +%d` |
41 |
tdir=$TESTDIR |
tdir=$TESTDIR |
42 |
if test $checkOut = '0' ; then |
if test $checkOut = '0' ; then |
43 |
if test -e $tdir/MITgcm/CVS ; then |
if test -e $tdir/MITgcm/CVS ; then |
44 |
echo $tdir/MITgcm/CVS 'exist' |
echo $tdir/MITgcm/CVS 'exist' |
45 |
echo -n "Update the MITgcm code from CVS pserver..." |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
46 |
cd $tdir/MITgcm |
cd $tdir/MITgcm |
47 |
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d > /dev/null |
if test $sepDir = 1 ; then |
48 |
echo " done" |
$cmdCVS update -P -d > /dev/null |
49 |
cd $tdir |
else |
50 |
else |
$cmdCVS update -P -d |
51 |
echo -n $tdir/MITgcm 'missing ; ' |
fi |
52 |
checkOut=1 |
echo " done" |
53 |
fi |
else |
54 |
|
echo -n $tdir/MITgcm 'missing ; ' |
55 |
|
checkOut=1 |
56 |
|
fi |
57 |
fi |
fi |
58 |
if test $checkOut = '1' ; then |
if test $checkOut = '1' ; then |
59 |
echo -n "Creating a temp directory ..." |
if test -e $tdir ; then |
60 |
if test -e $tdir |
echo -n "Removing working copy: $tdir/MITgcm ..." |
61 |
then test -e $tdir/MITgcm && rm -rf $tdir/MITgcm |
test -e $tdir/MITgcm && rm -rf $tdir/MITgcm |
62 |
else mkdir $tdir |
else |
63 |
|
echo -n "Creating a working dir: $tdir ..." |
64 |
|
mkdir $tdir |
65 |
fi |
fi |
66 |
echo " done" |
echo " done" |
67 |
echo -n "Downloading the MITgcm code from CVS pserver..." |
echo -n "Downloading the MITgcm code using: $cmdCVS ..." |
68 |
cd $tdir |
cd $tdir |
69 |
#export CVSROOT='/u/gcmpack' |
$cmdCVS co -P MITgcm > /dev/null |
|
#export CVSROOT=':ext:@mitgcm.org:/u/gcmpack' |
|
|
#export CVS_RSH='ssh' |
|
|
#cvs co -P MITgcm > /dev/null |
|
|
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P MITgcm > /dev/null |
|
70 |
echo " done" |
echo " done" |
71 |
|
else |
72 |
|
cd $tdir |
73 |
fi |
fi |
74 |
|
|
75 |
#------------------------------------------------------------------------ |
#------------------------------------------------------------------------ |
76 |
|
|
77 |
|
firstTst=`echo $tst_list | awk '{print $1}'` |
78 |
|
last_Tst=`echo $tst_list | awk '{print $NF}'` |
79 |
for tt in $tst_list |
for tt in $tst_list |
80 |
do |
do |
81 |
|
|
82 |
echo "================================================================" |
echo "================================================================" |
83 |
typ=`echo $tt | sed 's/+rs//'` |
typ=`echo $tt | sed 's/+rs//'` |
84 |
#- clean-up old output files |
#- check day and time: |
85 |
rm -f $tdir/output_${typ}* |
curDay=`date +%d` ; curHour=`date +%H` |
86 |
if test $sepDir = 1 ; then |
if [ $curDay -ne $TODAY ] ; then |
87 |
new_dir="MITgcm_$typ" |
date ; echo "day is over => skip test $typ" |
88 |
test -e $new_dir && rm -rf $new_dir |
continue |
89 |
mkdir $new_dir |
fi |
90 |
pushd $new_dir |
if [ $curHour -ge 18 ] ; then |
91 |
cp -ra ../MITgcm/* . |
date ; echo "too late to run test $typ" |
92 |
else |
continue |
93 |
pushd MITgcm |
fi |
94 |
fi |
#- clean-up old output files |
95 |
cd verification |
rm -f $tdir/output_${typ}* |
96 |
|
if test $sepDir = 1 ; then |
97 |
case $typ in |
new_dir="MITgcm_$typ" |
98 |
'g77') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
if test -d $new_dir/CVS -a $checkOut = '0' ; then |
99 |
'gfo') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
pushd $new_dir |
100 |
'adm') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
101 |
'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort' ;; |
$cmdCVS update -P -d |
102 |
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
echo " done" |
103 |
'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran' |
else |
104 |
export GOMP_STACKSIZE=400m ;; |
test -e $new_dir && rm -rf $new_dir |
105 |
*) OPTFILE= ;; |
mkdir $new_dir |
106 |
esac |
pushd $new_dir |
107 |
|
cp -ra ../MITgcm/* . |
108 |
if test $typ = 'g77' |
fi |
109 |
then |
else |
110 |
|
pushd MITgcm |
111 |
echo "Running testreport using:" |
fi |
112 |
comm="./testreport -a jmc@mitgcm.org" |
cd verification |
113 |
if test "x$OPTFILE" != x ; then |
|
114 |
comm="$comm -of=$OPTFILE" |
#-- set the testreport command: |
115 |
|
nbl='-100' |
116 |
|
comm="./testreport" |
117 |
|
if test $typ = 'g7a' -o $typ = 'adm' -o $typ = 'mpa' ; then |
118 |
|
nbl='-60' |
119 |
|
comm="$comm -adm" |
120 |
|
elif test $typ = 'mth' -o $typ = 'mp2' ; then |
121 |
|
export GOMP_STACKSIZE=400m |
122 |
|
export OMP_NUM_THREADS=2 |
123 |
|
comm="$comm -mth" |
124 |
|
fi |
125 |
|
comm="$comm -a jmc@mitgcm.org" |
126 |
|
#-- set the optfile (+ mpi & match-precision) |
127 |
|
MPI=0 |
128 |
|
case $typ in |
129 |
|
'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
130 |
|
'gfo'|'adm'|'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran' |
131 |
|
comm="$comm -match $MC" ;; |
132 |
|
'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort11' ;; |
133 |
|
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
134 |
|
'mpa'|'mpi'|'mp2') OPTFILE='../tools/build_options/linux_amd64_gfortran+mpi_generic' |
135 |
|
comm="$comm -match $MC" ; MPI=1 ;; |
136 |
|
*) OPTFILE= ;; |
137 |
|
esac |
138 |
|
#-- set MPI command: |
139 |
|
if test $MPI = 1 ; then |
140 |
|
if test $typ = 'mpa' ; then |
141 |
|
EXE="mpirun -np TR_NPROC ./mitgcmuv_ad" |
142 |
|
else |
143 |
|
EXE="mpirun -np TR_NPROC ./mitgcmuv" |
144 |
|
fi |
145 |
|
fi |
146 |
|
|
147 |
|
#-- set specific Env Vars: |
148 |
|
if test $typ = 'ifc' ; then |
149 |
|
source /srv/software/intel/intel-11.1.073/bin/ifortvars.sh intel64 |
150 |
|
fi |
151 |
|
if test $typ = 'pgi' ; then |
152 |
|
export PGI=/srv/software/pgi/pgi-10.9 |
153 |
|
export PATH="$PATH:$PGI/linux86-64/10.9/bin" |
154 |
|
export LM_LICENSE_FILE=$PGI/license.dat |
155 |
fi |
fi |
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_$typ 2>&1 |
|
|
tail -100 $tdir/output_$typ |
|
|
echo |
|
|
#-- also test restart (test 2+2=4) |
|
|
if test $tt != $typ |
|
|
then |
|
|
echo "testing restart using:" |
|
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_2+2 2>&1 |
|
|
#tail -100 $tdir/output_2+2 |
|
|
echo ; cat tst_2+2_out.txt |
|
|
echo |
|
|
fi |
|
|
|
|
|
fi |
|
156 |
|
|
157 |
if test $typ = 'gfo' |
if test $sepDir = 0 -a $checkOut = '1' -a $tt = $firstTst ; then |
158 |
then |
#-- cleaning: |
159 |
|
echo "======================" |
160 |
echo "Running testreport using:" |
echo "Cleaning test directories:" |
161 |
comm="./testreport -match $MC -a jmc@mitgcm.org" |
cmdCLN="./testreport -clean" |
162 |
if test "x$OPTFILE" != x ; then |
echo " clean dir running: $cmdCLN" |
163 |
comm="$comm -of=$OPTFILE" |
$cmdCLN > /dev/null 2>&1 |
164 |
fi |
echo "======================" |
165 |
echo " \"$comm\"" |
echo |
|
echo "======================" |
|
|
$comm > $tdir/output_$typ 2>&1 |
|
|
tail -100 $tdir/output_$typ |
|
|
echo |
|
|
#-- also test restart (test 2+2=4) |
|
|
if test $tt != $typ |
|
|
then |
|
|
echo "testing restart using:" |
|
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_2+2 2>&1 |
|
|
#tail -100 $tdir/output_2+2 |
|
|
echo ; cat tst_2+2_out.txt |
|
|
echo |
|
166 |
fi |
fi |
167 |
|
|
168 |
fi |
#-- run the testreport command: |
169 |
|
echo -n "Running testreport using:" |
|
if test $typ = 'adm' |
|
|
then |
|
|
|
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -adm -match $MC -a jmc@mitgcm.org" |
|
170 |
if test "x$OPTFILE" != x ; then |
if test "x$OPTFILE" != x ; then |
171 |
comm="$comm -of=$OPTFILE" |
comm="$comm -of=$OPTFILE" |
172 |
fi |
fi |
173 |
echo " \"$comm\"" |
if test $MPI = 1 ; then echo " (EXE='$EXE')" |
174 |
|
comm="$comm -MPI 6 -command \"\$EXE\"" |
175 |
|
else echo '' ; fi |
176 |
|
if test "x$option" != x ; then comm="$comm $option" ; fi |
177 |
|
#if test $typ = 'pgi' ; then comm="$comm -skd tutorial_advection_in_gyre" ; fi |
178 |
|
echo " \"eval $comm\"" |
179 |
echo "======================" |
echo "======================" |
180 |
$comm > $tdir/output_$typ 2>&1 |
eval $comm > $tdir/output_$typ 2>&1 |
181 |
tail -60 $tdir/output_$typ |
tail $nbl $tdir/output_$typ |
182 |
echo |
echo |
183 |
|
|
|
fi |
|
|
|
|
|
if test $typ = 'ifc' |
|
|
then |
|
|
|
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -match $MC -a jmc@mitgcm.org" |
|
|
if test "x$OPTFILE" != x ; then |
|
|
comm="$comm -of=$OPTFILE" |
|
|
fi |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_$typ 2>&1 |
|
|
tail -100 $tdir/output_$typ |
|
|
echo |
|
|
#-- also test restart (test 2+2=4) |
|
|
if test $tt != $typ |
|
|
then |
|
|
echo "testing restart using:" |
|
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_2+2 2>&1 |
|
|
#tail -100 $tdir/output_2+2 |
|
|
echo ; cat tst_2+2_out.txt |
|
|
echo |
|
|
fi |
|
|
|
|
|
fi |
|
|
|
|
|
if test $typ = 'mth' |
|
|
then |
|
|
|
|
|
export OMP_NUM_THREADS=2 |
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -mth -match $MC -a jmc@mitgcm.org" |
|
|
if test "x$OPTFILE" != x ; then |
|
|
comm="$comm -of=$OPTFILE" |
|
|
fi |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_$typ 2>&1 |
|
|
tail -100 $tdir/output_$typ |
|
|
echo |
|
184 |
#-- also test restart (test 2+2=4) |
#-- also test restart (test 2+2=4) |
185 |
if test $tt != $typ |
if test $tt != $typ |
186 |
then |
then |
187 |
echo "testing restart using:" |
echo "testing restart using:" |
188 |
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
189 |
echo " \"$comm\"" |
if test $MPI = 1 ; then |
190 |
echo "======================" |
echo " \"$comm -mpi -exe $EXE\"" |
191 |
$comm > $tdir/output_2+2 2>&1 |
echo "======================" |
192 |
#tail -100 $tdir/output_2+2 |
$comm -mpi -exe "$EXE" > $tdir/output_2+2 2>&1 |
193 |
echo ; cat tst_2+2_out.txt |
else |
194 |
echo |
echo " \"$comm\"" |
195 |
|
echo "======================" |
196 |
|
$comm > $tdir/output_2+2 2>&1 |
197 |
|
fi |
198 |
|
#tail $nbl $tdir/output_2+2 |
199 |
|
echo ; cat tst_2+2_out.txt |
200 |
|
echo |
201 |
fi |
fi |
202 |
export OMP_NUM_THREADS=1 |
export OMP_NUM_THREADS=1 |
203 |
|
|
204 |
fi |
if test $sepDir = 0 ; then |
|
|
|
|
if test $typ = 'pgi' |
|
|
then |
|
|
|
|
|
export PGI=/usr/local/pkg/pgi/pgi-6.1-5 |
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -match $MC -dd" |
|
|
if test "x$OPTFILE" != x ; then |
|
|
comm="$comm -of=$OPTFILE" |
|
|
fi |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_${typ}_1 2>&1 |
|
|
tail -100 $tdir/output_${typ}_1 |
|
|
echo |
|
|
echo "Running testreport using:" |
|
|
comm="./testreport -match $MC -q -a jmc@mitgcm.org" |
|
|
if test "x$OPTFILE" != x ; then |
|
|
comm="$comm -of=$OPTFILE" |
|
|
fi |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_${typ}_2 2>&1 |
|
|
tail -100 $tdir/output_${typ}_2 |
|
|
echo |
|
|
#-- also test restart (test 2+2=4) |
|
|
if test $tt != $typ |
|
|
then |
|
|
echo "testing restart using:" |
|
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
|
|
echo " \"$comm\"" |
|
|
echo "======================" |
|
|
$comm > $tdir/output_2+2 2>&1 |
|
|
#tail -100 $tdir/output_2+2 |
|
|
echo ; cat tst_2+2_out.txt |
|
|
echo |
|
|
fi |
|
|
|
|
|
fi |
|
|
|
|
|
if test $sepDir = 0 ; then |
|
205 |
#-- cleaning: |
#-- cleaning: |
206 |
echo "======================" |
echo "======================" |
207 |
echo "Cleaning test directories:" |
echo "Cleaning test directories:" |
208 |
if test $tt != $typ ; then |
if test $tt != $typ ; then |
209 |
cmdCLN="../tools/do_tst_2+2 -clean" |
cmdCLN="../tools/do_tst_2+2 -clean" |
210 |
echo " clean tst_2+2 running: $cmdCLN" |
echo " clean tst_2+2 running: $cmdCLN" |
211 |
$cmdCLN >> $tdir/output_2+2 2>&1 |
$cmdCLN >> $tdir/output_2+2 2>&1 |
212 |
|
fi |
213 |
|
if test $tt != $last_Tst ; then |
214 |
|
cmdCLN="./testreport -clean" |
215 |
|
echo " clean dir running: $cmdCLN" |
216 |
|
$cmdCLN > /dev/null 2>&1 |
217 |
|
fi |
218 |
|
echo "======================" |
219 |
|
echo |
220 |
fi |
fi |
221 |
cmdCLN="./testreport -clean" |
popd |
|
echo " clean dir running: $cmdCLN" |
|
|
$cmdCLN > /dev/null 2>&1 |
|
|
echo "======================" |
|
|
echo |
|
|
fi |
|
|
popd |
|
222 |
|
|
223 |
done |
done |