/[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.16 - (hide annotations) (download)
Wed Feb 20 19:05:16 2013 UTC (11 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64e, checkpoint64f
Changes since 1.15: +2 -2 lines
fix an unnecessary cleaning

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

  ViewVC Help
Powered by ViewVC 1.1.22