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

Diff of /MITgcm/tools/example_scripts/csail/test_dickens

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

revision 1.2 by jmc, Sat Apr 4 17:49:41 2009 UTC revision 1.14 by jmc, Sat Sep 18 00:07:53 2010 UTC
# Line 9  Line 9 
9    
10  # defaults  # defaults
11  export PATH="$PATH:/usr/local/bin"  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    #- method to acces CVS:
18     # export CVSROOT='/u/gcmpack'
19     # export CVSROOT=':ext:@mitgcm.org:/u/gcmpack'
20     # export CVS_RSH='ssh' ; cvs co -P MITgcm > /dev/null
21     # cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P MITgcm > /dev/null
22    cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack'
23    cmdCVS='cvs -d /u/gcmpack'
24    
25  TESTDIR="/tmp/jmc/test_"`hostname -s`  TESTDIR="/tmp/jmc/test_"`hostname -s`
26  MC=10  MC=10
27  checkOut=1  checkOut=1
28  sepDir=0  sepDir=0
29  #tst_list='adm g77 pgi gfo ifc mth'  option=
30  tst_list='adm g77 gfo mth'  #tst_list='g77 adm ifc mth pgi+rs'
31    tst_list='adm g77 gfo+rs mth'
32    
33  #  Turn off stack limit for FIZHI  #option="-nc" ; checkOut=0
34  #ulimit -s unlimited  <- this is the default  #option="-q"  ; checkOut=0
35    
36    TODAY=`date +%d`
37  tdir=$TESTDIR  tdir=$TESTDIR
38  if test $checkOut = '0' ; then  if test $checkOut = '0' ; then
39   if test -e $tdir/MITgcm/CVS ; then   if test -e $tdir/MITgcm/CVS ; then
40    echo $tdir/MITgcm/CVS 'exist'    echo $tdir/MITgcm/CVS 'exist'
41    echo -n "Update the MITgcm code from CVS pserver..."    echo -n "Update the MITgcm code using: $cmdCVS ..."
42    cd $tdir/MITgcm    cd $tdir/MITgcm
43    cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d > /dev/null    if test $sepDir = 1 ; then
44        $cmdCVS update -P -d > /dev/null
45      else
46        $cmdCVS update -P -d
47      fi
48    echo "  done"    echo "  done"
49    cd $tdir   else
  else  
50    echo -n $tdir/MITgcm 'missing ; '    echo -n $tdir/MITgcm 'missing ; '
51    checkOut=1    checkOut=1
52   fi   fi
53  fi  fi
54  if test $checkOut = '1' ; then  if test $checkOut = '1' ; then
55    echo -n "Creating a temp directory ..."    if test -e $tdir ; then
56    if test -e $tdir      echo -n "Removing working copy: $tdir/MITgcm ..."
57    then test -e $tdir/MITgcm  &&  rm -rf $tdir/MITgcm      test -e $tdir/MITgcm  &&  rm -rf $tdir/MITgcm
58    else mkdir $tdir    else
59        echo -n "Creating a working dir: $tdir ..."
60        mkdir $tdir
61    fi    fi
62    echo "  done"    echo "  done"
63    echo -n "Downloading the MITgcm code from CVS pserver..."    echo -n "Downloading the MITgcm code using: $cmdCVS ..."
64    cd $tdir    cd $tdir
65   #export CVSROOT='/u/gcmpack'    $cmdCVS co -P MITgcm > /dev/null
  #export CVSROOT=':ext:@mitgcm.org:/u/gcmpack'  
  #export CVS_RSH='ssh'  
  #cvs co -P MITgcm > /dev/null  
   cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P MITgcm > /dev/null  
66    echo "  done"    echo "  done"
67    else
68      cd $tdir
69  fi  fi
70    
71  #------------------------------------------------------------------------  #------------------------------------------------------------------------
72    
73    firstTst=`echo $tst_list | awk '{print $1}'`
74    last_Tst=`echo $tst_list | awk '{print $NF}'`
75  for tt in $tst_list  for tt in $tst_list
76  do  do
77    
78   echo "================================================================"   echo "================================================================"
79   typ=`echo $tt | sed 's/+rs//'`   typ=`echo $tt | sed 's/+rs//'`
80     #- check day and time:
81     curDay=`date +%d` ; curHour=`date +%H`
82     if [ $curDay -ne $TODAY ] ; then
83       date ; echo "day is over => skip test $typ"
84       continue
85     fi
86     if [ $curHour -ge 18 ] ; then
87       date ; echo "too late to run test $typ"
88       continue
89     fi
90   #- clean-up old output files   #- clean-up old output files
91   rm -f $tdir/output_${typ}*   rm -f $tdir/output_${typ}*
92   if test $sepDir = 1 ; then   if test $sepDir = 1 ; then
93    new_dir="MITgcm_$typ"    new_dir="MITgcm_$typ"
94    test -e $new_dir  &&  rm -rf $new_dir    if test -d $new_dir/CVS -a $checkOut = '0' ; then
95    mkdir $new_dir      pushd $new_dir
96    pushd $new_dir      echo -n "Update the MITgcm code using: $cmdCVS ..."
97    cp -ra ../MITgcm/* .      $cmdCVS update -P -d
98        echo "  done"
99      else
100        test -e $new_dir  &&  rm -rf $new_dir
101        mkdir $new_dir
102        pushd $new_dir
103        cp -ra ../MITgcm/* .
104      fi
105   else   else
106    pushd MITgcm    pushd MITgcm
107   fi   fi
# Line 76  do Line 113  do
113    'adm') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;;    'adm') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;;
114    'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort' ;;    'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort' ;;
115    'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;;    'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;;
116    'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran+mth'    'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran'
117           export GOMP_STACKSIZE=400m ;;           export GOMP_STACKSIZE=400m ;;
118     *) OPTFILE= ;;     *) OPTFILE= ;;
119   esac   esac
120    
121     if test $sepDir = 0 -a $checkOut = '1' -a  $tt = $firstTst ; then
122    #-- cleaning:
123      echo "======================"
124      echo "Cleaning test directories:"
125        cmdCLN="./testreport -clean"
126        echo " clean dir running: $cmdCLN"
127        $cmdCLN > /dev/null 2>&1
128      echo "======================"
129      echo
130     fi
131    
132   if test $typ = 'g77'   if test $typ = 'g77'
133   then   then
134    
135    echo "Running testreport using:"    echo "Running testreport using:"
136    comm="./testreport -a jmc@mitgcm.org"    comm="./testreport -a jmc@mitgcm.org"
137    # comm="$comm -match $MC"
138    if test "x$OPTFILE" != x ; then    if test "x$OPTFILE" != x ; then
139      comm="$comm -of=$OPTFILE"      comm="$comm -of=$OPTFILE"
140    fi    fi
141      if test "x$option" != x ; then comm="$comm $option" ; fi
142    echo "  \"$comm\""    echo "  \"$comm\""
143    echo "======================"    echo "======================"
144    $comm > $tdir/output_$typ 2>&1    $comm > $tdir/output_$typ 2>&1
145    tail -100 $tdir/output_$typ    tail -100 $tdir/output_$typ
146    echo    echo
 #-- also test restart (test 2+2=4)  
   if test $tt != $typ  
   then  
    echo "testing restart using:"  
    comm="../tools/do_tst_2+2 -a jmc@mitgcm.org"  
    echo "  \"$comm\""  
    echo "======================"  
    $comm > $tdir/output_2+2 2>&1  
   #tail -100 $tdir/output_2+2  
    echo ; cat tst_2+2_out.txt  
    echo  
   fi  
147    
148   fi   fi
149    
# Line 113  do Line 151  do
151   then   then
152    
153    echo "Running testreport using:"    echo "Running testreport using:"
154    comm="./testreport -match $MC -a jmc@mitgcm.org"    comm="./testreport -a jmc@mitgcm.org"
155      comm="$comm -match $MC"
156    if test "x$OPTFILE" != x ; then    if test "x$OPTFILE" != x ; then
157      comm="$comm -of=$OPTFILE"      comm="$comm -of=$OPTFILE"
158    fi    fi
159      if test "x$option" != x ; then comm="$comm $option" ; fi
160    echo "  \"$comm\""    echo "  \"$comm\""
161    echo "======================"    echo "======================"
162    $comm > $tdir/output_$typ 2>&1    $comm > $tdir/output_$typ 2>&1
163    tail -100 $tdir/output_$typ    tail -100 $tdir/output_$typ
164    echo    echo
 #-- also test restart (test 2+2=4)  
   if test $tt != $typ  
   then  
    echo "testing restart using:"  
    comm="../tools/do_tst_2+2 -a jmc@mitgcm.org"  
    echo "  \"$comm\""  
    echo "======================"  
    $comm > $tdir/output_2+2 2>&1  
   #tail -100 $tdir/output_2+2  
    echo ; cat tst_2+2_out.txt  
    echo  
   fi  
165    
166   fi   fi
167    
# Line 141  do Line 169  do
169   then   then
170    
171    echo "Running testreport using:"    echo "Running testreport using:"
172    comm="./testreport -adm -match $MC -a jmc@mitgcm.org"    comm="./testreport -adm -a jmc@mitgcm.org"
173      comm="$comm -match $MC"
174    if test "x$OPTFILE" != x ; then    if test "x$OPTFILE" != x ; then
175      comm="$comm -of=$OPTFILE"      comm="$comm -of=$OPTFILE"
176    fi    fi
177      if test "x$option" != x ; then comm="$comm $option" ; fi
178    echo "  \"$comm\""    echo "  \"$comm\""
179    echo "======================"    echo "======================"
180    $comm > $tdir/output_$typ 2>&1    $comm > $tdir/output_$typ 2>&1
# Line 157  do Line 187  do
187   then   then
188    
189    echo "Running testreport using:"    echo "Running testreport using:"
190    comm="./testreport -match $MC -a jmc@mitgcm.org"    comm="./testreport -a jmc@mitgcm.org"
191      comm="$comm -match $MC"
192    if test "x$OPTFILE" != x ; then    if test "x$OPTFILE" != x ; then
193      comm="$comm -of=$OPTFILE"      comm="$comm -of=$OPTFILE"
194    fi    fi
195      if test "x$option" != x ; then comm="$comm $option" ; fi
196    echo "  \"$comm\""    echo "  \"$comm\""
197    echo "======================"    echo "======================"
198    $comm > $tdir/output_$typ 2>&1    $comm > $tdir/output_$typ 2>&1
199    tail -100 $tdir/output_$typ    tail -100 $tdir/output_$typ
200    echo    echo
 #-- also test restart (test 2+2=4)  
   if test $tt != $typ  
   then  
    echo "testing restart using:"  
    comm="../tools/do_tst_2+2 -a jmc@mitgcm.org"  
    echo "  \"$comm\""  
    echo "======================"  
    $comm > $tdir/output_2+2 2>&1  
   #tail -100 $tdir/output_2+2  
    echo ; cat tst_2+2_out.txt  
    echo  
   fi  
201    
202   fi   fi
203    
# Line 186  do Line 206  do
206    
207    export OMP_NUM_THREADS=2    export OMP_NUM_THREADS=2
208    echo "Running testreport using:"    echo "Running testreport using:"
209    comm="./testreport -mth -match $MC -a jmc@mitgcm.org"    comm="./testreport -mth -a jmc@mitgcm.org"
210      comm="$comm -match $MC"
211    if test "x$OPTFILE" != x ; then    if test "x$OPTFILE" != x ; then
212      comm="$comm -of=$OPTFILE"      comm="$comm -of=$OPTFILE"
213    fi    fi
214      if test "x$option" != x ; then comm="$comm $option" ; fi
215    echo "  \"$comm\""    echo "  \"$comm\""
216    echo "======================"    echo "======================"
217    $comm > $tdir/output_$typ 2>&1    $comm > $tdir/output_$typ 2>&1
218    tail -100 $tdir/output_$typ    tail -100 $tdir/output_$typ
219    echo    echo
 #-- also test restart (test 2+2=4)  
   if test $tt != $typ  
   then  
    echo "testing restart using:"  
    comm="../tools/do_tst_2+2 -a jmc@mitgcm.org"  
    echo "  \"$comm\""  
    echo "======================"  
    $comm > $tdir/output_2+2 2>&1  
   #tail -100 $tdir/output_2+2  
    echo ; cat tst_2+2_out.txt  
    echo  
   fi  
   export OMP_NUM_THREADS=1  
220    
221   fi   fi
222    
# Line 216  do Line 225  do
225    
226    export PGI=/usr/local/pkg/pgi/pgi-6.1-5    export PGI=/usr/local/pkg/pgi/pgi-6.1-5
227    echo "Running testreport using:"    echo "Running testreport using:"
228    comm="./testreport -match $MC -dd"    comm="./testreport -dd"
229      comm="$comm -match $MC"
230      #comm="$comm -skd tutorial_advection_in_gyre"
231    if test "x$OPTFILE" != x ; then    if test "x$OPTFILE" != x ; then
232      comm="$comm -of=$OPTFILE"      comm="$comm -of=$OPTFILE"
233    fi    fi
234      if test "x$option" != x ; then comm="$comm $option" ; fi
235    echo "  \"$comm\""    echo "  \"$comm\""
236    echo "======================"    echo "======================"
237    $comm > $tdir/output_${typ}_1 2>&1    $comm > $tdir/output_${typ}_1 2>&1
238    tail -100 $tdir/output_${typ}_1    tail -100 $tdir/output_${typ}_1
239    echo    echo
240    echo "Running testreport using:"    echo "Running testreport using:"
241    comm="./testreport -match $MC -q -a jmc@mitgcm.org"    comm="./testreport -q -a jmc@mitgcm.org"
242      comm="$comm -match $MC"
243      #comm="$comm -skd tutorial_advection_in_gyre"
244    if test "x$OPTFILE" != x ; then    if test "x$OPTFILE" != x ; then
245      comm="$comm -of=$OPTFILE"      comm="$comm -of=$OPTFILE"
246    fi    fi
# Line 235  do Line 249  do
249    $comm > $tdir/output_${typ}_2 2>&1    $comm > $tdir/output_${typ}_2 2>&1
250    tail -100 $tdir/output_${typ}_2    tail -100 $tdir/output_${typ}_2
251    echo    echo
252    
253     fi
254    
255  #-- also test restart (test 2+2=4)  #-- also test restart (test 2+2=4)
256    if test $tt != $typ   if test $tt != $typ
257    then   then
258     echo "testing restart using:"     echo "testing restart using:"
259     comm="../tools/do_tst_2+2 -a jmc@mitgcm.org"     comm="../tools/do_tst_2+2 -a jmc@mitgcm.org"
260     echo "  \"$comm\""     echo "  \"$comm\""
# Line 246  do Line 263  do
263    #tail -100 $tdir/output_2+2    #tail -100 $tdir/output_2+2
264     echo ; cat tst_2+2_out.txt     echo ; cat tst_2+2_out.txt
265     echo     echo
   fi  
   
266   fi   fi
267     export OMP_NUM_THREADS=1
268    
269   if test $sepDir = 0 ; then   if test $sepDir = 0 ; then
270  #-- cleaning:  #-- cleaning:
271    echo "======================"    echo "======================"
272    echo "Cleaning test directories:"    echo "Cleaning test directories:"
273    ./testreport -clean > /dev/null 2>&1    if test $tt != $typ ; then
274        cmdCLN="../tools/do_tst_2+2 -clean"
275        echo " clean tst_2+2 running: $cmdCLN"
276        $cmdCLN >> $tdir/output_2+2 2>&1
277      fi
278      if test $tt != $last_Tst ; then
279        cmdCLN="./testreport -clean"
280        echo " clean dir running: $cmdCLN"
281        $cmdCLN > /dev/null 2>&1
282      fi
283    echo "======================"    echo "======================"
284    echo    echo
285   fi   fi

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.22