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

Contents of /MITgcm/tools/example_scripts/csail/test_faulks

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


Revision 1.22 - (show annotations) (download)
Wed Sep 7 21:42:52 2011 UTC (12 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63c, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.21: +10 -8 lines
use standard optfiles for ifort & pgi test

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

  ViewVC Help
Powered by ViewVC 1.1.22