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

Diff of /MITgcm/tools/example_scripts/csail/test_baudelaire

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

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

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22