/[MITgcm]/MITgcm/tools/example_scripts/csail/test_baudelaire
ViewVC logotype

Annotation of /MITgcm/tools/example_scripts/csail/test_baudelaire

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Tue Nov 2 13:44:39 2010 UTC (13 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.1: +32 -16 lines
- prepare for reference output switch (from faulks:g77 to baudelaire:gfortran):
  relax matching of g77 test to 10 ; default matching with gfortran.
- add a daily AD test with g77 ; switch optfile (ifort11) for ifort testing.

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

  ViewVC Help
Powered by ViewVC 1.1.22