1 |
#! /usr/bin/env bash |
2 |
|
3 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/faulks/test_csail,v 1.18 2009/01/23 20:26:31 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 |
|
11 |
# defaults |
12 |
export PATH='/usr/local/bin:/bin:/usr/bin' |
13 |
OPTFILE= |
14 |
TESTDIR="/scratch/jmc/test_"`hostname` |
15 |
IEEE="-ieee" |
16 |
MC=10 |
17 |
checkOut=1 |
18 |
tst_list='g77 adm ifc pgi+rs' |
19 |
|
20 |
# Turn off stack limit for FIZHI |
21 |
ulimit -s unlimited |
22 |
|
23 |
mach=`hostname` |
24 |
tdir=$TESTDIR |
25 |
if test $checkOut = '0' ; then |
26 |
if test -e $tdir/MITgcm/CVS ; then |
27 |
echo $tdir/MITgcm/CVS 'exist' |
28 |
echo -n "Update the MITgcm code from CVS pserver..." |
29 |
cd $tdir/MITgcm |
30 |
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d > /dev/null |
31 |
echo " done" |
32 |
cd $tdir |
33 |
else |
34 |
echo -n $tdir/MITgcm 'missing ; ' |
35 |
checkOut=1 |
36 |
fi |
37 |
fi |
38 |
if test $checkOut = '1' ; then |
39 |
echo -n "Creating a temp directory ..." |
40 |
if test -e $tdir |
41 |
then test -e $tdir/MITgcm && rm -rf $tdir/MITgcm |
42 |
else mkdir $tdir |
43 |
fi |
44 |
echo " done" |
45 |
echo -n "Downloading the MITgcm code from CVS pserver..." |
46 |
cd $tdir |
47 |
#export CVSROOT='/u/gcmpack' |
48 |
#export CVSROOT=':ext:@mitgcm.org:/u/gcmpack' |
49 |
#export CVS_RSH='ssh' |
50 |
#cvs co -P MITgcm > /dev/null |
51 |
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P MITgcm > /dev/null |
52 |
echo " done" |
53 |
fi |
54 |
|
55 |
#------------------------------------------------------------------------ |
56 |
|
57 |
for tt in $tst_list |
58 |
do |
59 |
|
60 |
if test $tt = 'g77' -o $tt = 'g77+rs' |
61 |
then |
62 |
|
63 |
typ=`echo $tt | sed 's/+rs//'` |
64 |
#- clean-up old output files |
65 |
rm -f $tdir/output_${typ}* |
66 |
new_dir="MITgcm_$typ" |
67 |
test -e $new_dir && rm -rf $new_dir |
68 |
mkdir $new_dir |
69 |
echo "================================================================" |
70 |
pushd $new_dir |
71 |
cp -ra ../MITgcm/* . |
72 |
echo "Running testreport using:" |
73 |
cd verification |
74 |
comm="./testreport -a jmc@mitgcm.org" |
75 |
if test "x$OPTFILE" != x ; then |
76 |
comm="$comm -of=$OPTFILE" |
77 |
fi |
78 |
echo " \"$comm\"" |
79 |
echo "======================" |
80 |
$comm > $tdir/output_$typ 2>&1 |
81 |
tail -100 $tdir/output_$typ |
82 |
echo |
83 |
#-- also test restart (test 2+2=4) |
84 |
if test $tt != $typ |
85 |
then |
86 |
echo "testing restart using:" |
87 |
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
88 |
echo " \"$comm\"" |
89 |
echo "======================" |
90 |
$comm > $tdir/output_2+2 2>&1 |
91 |
#tail -100 $tdir/output_2+2 |
92 |
echo ; cat tst_2+2_out.txt |
93 |
echo |
94 |
fi |
95 |
popd |
96 |
|
97 |
fi |
98 |
|
99 |
if test $tt = 'adm' |
100 |
then |
101 |
|
102 |
typ=`echo $tt | sed 's/+rs//'` |
103 |
#- clean-up old output files |
104 |
rm -f $tdir/output_${typ}* |
105 |
new_dir="MITgcm_$typ" |
106 |
test -e $new_dir && rm -rf $new_dir |
107 |
mkdir $new_dir |
108 |
echo "================================================================" |
109 |
pushd $new_dir |
110 |
cp -ra ../MITgcm/* . |
111 |
echo "Running testreport using:" |
112 |
cd verification |
113 |
comm="./testreport -adm -a jmc@mitgcm.org" |
114 |
if test "x$OPTFILE" != x ; then |
115 |
comm="$comm -of=$OPTFILE" |
116 |
fi |
117 |
echo " \"$comm\"" |
118 |
echo "======================" |
119 |
$comm > $tdir/output_$typ 2>&1 |
120 |
tail -60 $tdir/output_$typ |
121 |
echo |
122 |
popd |
123 |
|
124 |
fi |
125 |
|
126 |
if test $tt = 'ifc' -o $tt = 'ifc+rs' |
127 |
then |
128 |
|
129 |
typ=`echo $tt | sed 's/+rs//'` |
130 |
#- clean-up old output files |
131 |
rm -f $tdir/output_${typ}* |
132 |
new_dir="MITgcm_$typ" |
133 |
test -e $new_dir && rm -rf $new_dir |
134 |
mkdir $new_dir |
135 |
echo "================================================================" |
136 |
pushd $new_dir |
137 |
cp -ra ../MITgcm/* . |
138 |
echo "Running testreport using:" |
139 |
cd verification |
140 |
comm="./testreport -match $MC -of ../tools/build_options/linux_ia32_ifort+authors_v9 -a jmc@mitgcm.org" |
141 |
echo " \"$comm\"" |
142 |
echo "======================" |
143 |
$comm > $tdir/output_$typ 2>&1 |
144 |
tail -100 $tdir/output_$typ |
145 |
echo |
146 |
#-- also test restart (test 2+2=4) |
147 |
if test $tt != $typ |
148 |
then |
149 |
echo "testing restart using:" |
150 |
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
151 |
echo " \"$comm\"" |
152 |
echo "======================" |
153 |
$comm > $tdir/output_2+2 2>&1 |
154 |
#tail -100 $tdir/output_2+2 |
155 |
echo ; cat tst_2+2_out.txt |
156 |
echo |
157 |
fi |
158 |
popd |
159 |
|
160 |
fi |
161 |
|
162 |
if test $tt = 'pgi' -o $tt = 'pgi+rs' |
163 |
then |
164 |
|
165 |
typ=`echo $tt | sed 's/+rs//'` |
166 |
#- clean-up old output files |
167 |
rm -f $tdir/output_${typ}* |
168 |
new_dir="MITgcm_$typ" |
169 |
test -e $new_dir && rm -rf $new_dir |
170 |
mkdir $new_dir |
171 |
echo "================================================================" |
172 |
pushd $new_dir |
173 |
cp -ra ../MITgcm/* . |
174 |
echo "Running testreport using:" |
175 |
export PGI=/usr/local/pkg/pgi/pgi-6.1-5 |
176 |
cd verification |
177 |
comm="./testreport -match $MC -of ../tools/build_options/linux_ia32_pgf77+authors_fc5 -dd" |
178 |
echo " \"$comm\"" |
179 |
echo "======================" |
180 |
$comm > $tdir/output_${typ}_1 2>&1 |
181 |
tail -100 $tdir/output_${typ}_1 |
182 |
echo |
183 |
echo "Running testreport using:" |
184 |
#cd verification |
185 |
comm="./testreport -match $MC -of ../tools/build_options/linux_ia32_pgf77+authors_fc5 -a jmc@mitgcm.org -q" |
186 |
echo " \"$comm\"" |
187 |
echo "======================" |
188 |
$comm > $tdir/output_${typ}_2 2>&1 |
189 |
tail -100 $tdir/output_${typ}_2 |
190 |
echo |
191 |
#-- also test restart (test 2+2=4) |
192 |
if test $tt != $typ |
193 |
then |
194 |
echo "testing restart using:" |
195 |
comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" |
196 |
echo " \"$comm\"" |
197 |
echo "======================" |
198 |
$comm > $tdir/output_2+2 2>&1 |
199 |
#tail -100 $tdir/output_2+2 |
200 |
echo ; cat tst_2+2_out.txt |
201 |
echo |
202 |
fi |
203 |
popd |
204 |
|
205 |
fi |
206 |
|
207 |
done |