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