1 |
jmc |
1.1 |
#! /usr/bin/env bash |
2 |
|
|
|
3 |
jmc |
1.8 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/csail/test_dickens,v 1.7 2009/06/02 17:08:48 jmc Exp $ |
4 |
jmc |
1.1 |
|
5 |
|
|
# Ed Hill |
6 |
|
|
|
7 |
|
|
# Test script for MITgcm that should work on most of the csail.mit.edu |
8 |
|
|
# Linux machines. |
9 |
|
|
|
10 |
|
|
# defaults |
11 |
|
|
export PATH="$PATH:/usr/local/bin" |
12 |
|
|
TESTDIR="/tmp/jmc/test_"`hostname -s` |
13 |
|
|
MC=10 |
14 |
|
|
checkOut=1 |
15 |
|
|
sepDir=0 |
16 |
jmc |
1.8 |
option= |
17 |
jmc |
1.1 |
#tst_list='adm g77 pgi gfo ifc mth' |
18 |
jmc |
1.5 |
tst_list='adm g77 gfo+rs mth' |
19 |
jmc |
1.1 |
|
20 |
jmc |
1.8 |
#option="-nc" ; checkOut=0 |
21 |
|
|
#option="-q" ; checkOut=0 |
22 |
|
|
|
23 |
jmc |
1.1 |
# Turn off stack limit for FIZHI |
24 |
jmc |
1.3 |
ulimit -s unlimited |
25 |
jmc |
1.1 |
|
26 |
|
|
tdir=$TESTDIR |
27 |
|
|
if test $checkOut = '0' ; then |
28 |
|
|
if test -e $tdir/MITgcm/CVS ; then |
29 |
|
|
echo $tdir/MITgcm/CVS 'exist' |
30 |
|
|
echo -n "Update the MITgcm code from CVS pserver..." |
31 |
|
|
cd $tdir/MITgcm |
32 |
jmc |
1.8 |
if test $sepDir = 1 ; then |
33 |
|
|
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d > /dev/null |
34 |
|
|
else |
35 |
|
|
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d |
36 |
|
|
fi |
37 |
jmc |
1.1 |
echo " done" |
38 |
|
|
cd $tdir |
39 |
|
|
else |
40 |
|
|
echo -n $tdir/MITgcm 'missing ; ' |
41 |
|
|
checkOut=1 |
42 |
|
|
fi |
43 |
|
|
fi |
44 |
|
|
if test $checkOut = '1' ; then |
45 |
|
|
echo -n "Creating a temp directory ..." |
46 |
|
|
if test -e $tdir |
47 |
|
|
then test -e $tdir/MITgcm && rm -rf $tdir/MITgcm |
48 |
|
|
else mkdir $tdir |
49 |
|
|
fi |
50 |
|
|
echo " done" |
51 |
|
|
echo -n "Downloading the MITgcm code from CVS pserver..." |
52 |
|
|
cd $tdir |
53 |
|
|
#export CVSROOT='/u/gcmpack' |
54 |
|
|
#export CVSROOT=':ext:@mitgcm.org:/u/gcmpack' |
55 |
|
|
#export CVS_RSH='ssh' |
56 |
|
|
#cvs co -P MITgcm > /dev/null |
57 |
|
|
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P MITgcm > /dev/null |
58 |
|
|
echo " done" |
59 |
|
|
fi |
60 |
|
|
|
61 |
|
|
#------------------------------------------------------------------------ |
62 |
|
|
|
63 |
|
|
for tt in $tst_list |
64 |
|
|
do |
65 |
|
|
|
66 |
|
|
echo "================================================================" |
67 |
|
|
typ=`echo $tt | sed 's/+rs//'` |
68 |
|
|
#- clean-up old output files |
69 |
|
|
rm -f $tdir/output_${typ}* |
70 |
|
|
if test $sepDir = 1 ; then |
71 |
|
|
new_dir="MITgcm_$typ" |
72 |
jmc |
1.8 |
if test -d $new_dir/CVS -a $checkOut = '0' ; then |
73 |
|
|
pushd $new_dir |
74 |
|
|
echo -n "Update the MITgcm code from CVS pserver..." |
75 |
|
|
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d |
76 |
|
|
echo " done" |
77 |
|
|
else |
78 |
|
|
test -e $new_dir && rm -rf $new_dir |
79 |
|
|
mkdir $new_dir |
80 |
|
|
pushd $new_dir |
81 |
|
|
cp -ra ../MITgcm/* . |
82 |
|
|
fi |
83 |
jmc |
1.1 |
else |
84 |
|
|
pushd MITgcm |
85 |
|
|
fi |
86 |
|
|
cd verification |
87 |
|
|
|
88 |
|
|
case $typ in |
89 |
|
|
'g77') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
90 |
|
|
'gfo') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
91 |
|
|
'adm') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
92 |
|
|
'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort' ;; |
93 |
|
|
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
94 |
jmc |
1.4 |
'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran' |
95 |
jmc |
1.2 |
export GOMP_STACKSIZE=400m ;; |
96 |
jmc |
1.1 |
*) OPTFILE= ;; |
97 |
|
|
esac |
98 |
|
|
|
99 |
|
|
if test $typ = 'g77' |
100 |
|
|
then |
101 |
|
|
|
102 |
|
|
echo "Running testreport using:" |
103 |
|
|
comm="./testreport -a jmc@mitgcm.org" |
104 |
|
|
if test "x$OPTFILE" != x ; then |
105 |
|
|
comm="$comm -of=$OPTFILE" |
106 |
|
|
fi |
107 |
jmc |
1.8 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
108 |
jmc |
1.1 |
echo " \"$comm\"" |
109 |
|
|
echo "======================" |
110 |
|
|
$comm > $tdir/output_$typ 2>&1 |
111 |
|
|
tail -100 $tdir/output_$typ |
112 |
|
|
echo |
113 |
|
|
#-- also test restart (test 2+2=4) |
114 |
|
|
if test $tt != $typ |
115 |
|
|
then |
116 |
|
|
echo "testing restart using:" |
117 |
|
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
118 |
|
|
echo " \"$comm\"" |
119 |
|
|
echo "======================" |
120 |
|
|
$comm > $tdir/output_2+2 2>&1 |
121 |
|
|
#tail -100 $tdir/output_2+2 |
122 |
|
|
echo ; cat tst_2+2_out.txt |
123 |
|
|
echo |
124 |
|
|
fi |
125 |
|
|
|
126 |
|
|
fi |
127 |
|
|
|
128 |
|
|
if test $typ = 'gfo' |
129 |
|
|
then |
130 |
|
|
|
131 |
|
|
echo "Running testreport using:" |
132 |
|
|
comm="./testreport -match $MC -a jmc@mitgcm.org" |
133 |
|
|
if test "x$OPTFILE" != x ; then |
134 |
|
|
comm="$comm -of=$OPTFILE" |
135 |
|
|
fi |
136 |
jmc |
1.8 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
137 |
jmc |
1.1 |
echo " \"$comm\"" |
138 |
|
|
echo "======================" |
139 |
|
|
$comm > $tdir/output_$typ 2>&1 |
140 |
|
|
tail -100 $tdir/output_$typ |
141 |
|
|
echo |
142 |
|
|
#-- also test restart (test 2+2=4) |
143 |
|
|
if test $tt != $typ |
144 |
|
|
then |
145 |
|
|
echo "testing restart using:" |
146 |
|
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
147 |
|
|
echo " \"$comm\"" |
148 |
|
|
echo "======================" |
149 |
|
|
$comm > $tdir/output_2+2 2>&1 |
150 |
|
|
#tail -100 $tdir/output_2+2 |
151 |
|
|
echo ; cat tst_2+2_out.txt |
152 |
|
|
echo |
153 |
|
|
fi |
154 |
|
|
|
155 |
|
|
fi |
156 |
|
|
|
157 |
|
|
if test $typ = 'adm' |
158 |
|
|
then |
159 |
|
|
|
160 |
|
|
echo "Running testreport using:" |
161 |
jmc |
1.7 |
comm="./testreport -adm -match $MC -a jmc@mitgcm.org" |
162 |
jmc |
1.1 |
if test "x$OPTFILE" != x ; then |
163 |
|
|
comm="$comm -of=$OPTFILE" |
164 |
|
|
fi |
165 |
jmc |
1.8 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
166 |
jmc |
1.1 |
echo " \"$comm\"" |
167 |
|
|
echo "======================" |
168 |
|
|
$comm > $tdir/output_$typ 2>&1 |
169 |
|
|
tail -60 $tdir/output_$typ |
170 |
|
|
echo |
171 |
|
|
|
172 |
|
|
fi |
173 |
|
|
|
174 |
|
|
if test $typ = 'ifc' |
175 |
|
|
then |
176 |
|
|
|
177 |
|
|
echo "Running testreport using:" |
178 |
|
|
comm="./testreport -match $MC -a jmc@mitgcm.org" |
179 |
|
|
if test "x$OPTFILE" != x ; then |
180 |
|
|
comm="$comm -of=$OPTFILE" |
181 |
|
|
fi |
182 |
jmc |
1.8 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
183 |
jmc |
1.1 |
echo " \"$comm\"" |
184 |
|
|
echo "======================" |
185 |
|
|
$comm > $tdir/output_$typ 2>&1 |
186 |
|
|
tail -100 $tdir/output_$typ |
187 |
|
|
echo |
188 |
|
|
#-- also test restart (test 2+2=4) |
189 |
|
|
if test $tt != $typ |
190 |
|
|
then |
191 |
|
|
echo "testing restart using:" |
192 |
|
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
193 |
|
|
echo " \"$comm\"" |
194 |
|
|
echo "======================" |
195 |
|
|
$comm > $tdir/output_2+2 2>&1 |
196 |
|
|
#tail -100 $tdir/output_2+2 |
197 |
|
|
echo ; cat tst_2+2_out.txt |
198 |
|
|
echo |
199 |
|
|
fi |
200 |
|
|
|
201 |
|
|
fi |
202 |
|
|
|
203 |
|
|
if test $typ = 'mth' |
204 |
|
|
then |
205 |
|
|
|
206 |
|
|
export OMP_NUM_THREADS=2 |
207 |
|
|
echo "Running testreport using:" |
208 |
|
|
comm="./testreport -mth -match $MC -a jmc@mitgcm.org" |
209 |
|
|
if test "x$OPTFILE" != x ; then |
210 |
|
|
comm="$comm -of=$OPTFILE" |
211 |
|
|
fi |
212 |
jmc |
1.8 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
213 |
jmc |
1.1 |
echo " \"$comm\"" |
214 |
|
|
echo "======================" |
215 |
|
|
$comm > $tdir/output_$typ 2>&1 |
216 |
|
|
tail -100 $tdir/output_$typ |
217 |
|
|
echo |
218 |
|
|
#-- also test restart (test 2+2=4) |
219 |
|
|
if test $tt != $typ |
220 |
|
|
then |
221 |
|
|
echo "testing restart using:" |
222 |
|
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
223 |
|
|
echo " \"$comm\"" |
224 |
|
|
echo "======================" |
225 |
|
|
$comm > $tdir/output_2+2 2>&1 |
226 |
|
|
#tail -100 $tdir/output_2+2 |
227 |
|
|
echo ; cat tst_2+2_out.txt |
228 |
|
|
echo |
229 |
|
|
fi |
230 |
|
|
export OMP_NUM_THREADS=1 |
231 |
|
|
|
232 |
|
|
fi |
233 |
|
|
|
234 |
|
|
if test $typ = 'pgi' |
235 |
|
|
then |
236 |
|
|
|
237 |
|
|
export PGI=/usr/local/pkg/pgi/pgi-6.1-5 |
238 |
|
|
echo "Running testreport using:" |
239 |
|
|
comm="./testreport -match $MC -dd" |
240 |
|
|
if test "x$OPTFILE" != x ; then |
241 |
|
|
comm="$comm -of=$OPTFILE" |
242 |
|
|
fi |
243 |
jmc |
1.8 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
244 |
jmc |
1.1 |
echo " \"$comm\"" |
245 |
|
|
echo "======================" |
246 |
|
|
$comm > $tdir/output_${typ}_1 2>&1 |
247 |
|
|
tail -100 $tdir/output_${typ}_1 |
248 |
|
|
echo |
249 |
|
|
echo "Running testreport using:" |
250 |
|
|
comm="./testreport -match $MC -q -a jmc@mitgcm.org" |
251 |
|
|
if test "x$OPTFILE" != x ; then |
252 |
|
|
comm="$comm -of=$OPTFILE" |
253 |
|
|
fi |
254 |
|
|
echo " \"$comm\"" |
255 |
|
|
echo "======================" |
256 |
|
|
$comm > $tdir/output_${typ}_2 2>&1 |
257 |
|
|
tail -100 $tdir/output_${typ}_2 |
258 |
|
|
echo |
259 |
|
|
#-- also test restart (test 2+2=4) |
260 |
|
|
if test $tt != $typ |
261 |
|
|
then |
262 |
|
|
echo "testing restart using:" |
263 |
|
|
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
264 |
|
|
echo " \"$comm\"" |
265 |
|
|
echo "======================" |
266 |
|
|
$comm > $tdir/output_2+2 2>&1 |
267 |
|
|
#tail -100 $tdir/output_2+2 |
268 |
|
|
echo ; cat tst_2+2_out.txt |
269 |
|
|
echo |
270 |
|
|
fi |
271 |
|
|
|
272 |
|
|
fi |
273 |
|
|
|
274 |
|
|
if test $sepDir = 0 ; then |
275 |
|
|
#-- cleaning: |
276 |
|
|
echo "======================" |
277 |
|
|
echo "Cleaning test directories:" |
278 |
jmc |
1.5 |
if test $tt != $typ ; then |
279 |
|
|
cmdCLN="../tools/do_tst_2+2 -clean" |
280 |
|
|
echo " clean tst_2+2 running: $cmdCLN" |
281 |
|
|
$cmdCLN >> $tdir/output_2+2 2>&1 |
282 |
|
|
fi |
283 |
|
|
cmdCLN="./testreport -clean" |
284 |
|
|
echo " clean dir running: $cmdCLN" |
285 |
|
|
$cmdCLN > /dev/null 2>&1 |
286 |
jmc |
1.1 |
echo "======================" |
287 |
|
|
echo |
288 |
|
|
fi |
289 |
|
|
popd |
290 |
|
|
|
291 |
|
|
done |