/[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.2 by jmc, Tue Nov 2 13:44:39 2010 UTC revision 1.9 by jmc, Mon Aug 22 15:27:23 2011 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 24  cmdCVS='cvs -d :pserver:cvsanon@mitgcm.o Line 26  cmdCVS='cvs -d :pserver:cvsanon@mitgcm.o
26  cmdCVS='cvs -d /u/gcmpack'  cmdCVS='cvs -d /u/gcmpack'
27    
28  TESTDIR="/scratch/jmc/test_"`hostname -s`  TESTDIR="/scratch/jmc/test_"`hostname -s`
29  MC=10  MC=13
30  checkOut=1  checkOut=1
31  sepDir=1  sepDir=1
32  option=  option=
33  tst_list='g7a adm g77 gfo+rs mth ifc'  tst_list='g7a adm mpa g77 gfo+rs mth mp2+rs mpi ifc'
34  #tst_list='g77 adm gfo ifc mth pgi+rs'  #tst_list='g77 adm gfo ifc mth pgi+rs'
35  #tst_list='g77 gfo+rs mth'  #tst_list='adm gfo+rs mth'
36    
37  #option="-nc" ; checkOut=0  #option="-nc" ; checkOut=0
38  #option="-q"  ; checkOut=0  #option="-q"  ; checkOut=0
# Line 38  tst_list='g7a adm g77 gfo+rs mth ifc' Line 40  tst_list='g7a adm g77 gfo+rs mth ifc'
40  TODAY=`date +%d`  TODAY=`date +%d`
41  tdir=$TESTDIR  tdir=$TESTDIR
42  if test $checkOut = '0' ; then  if test $checkOut = '0' ; then
43   if test -e $tdir/MITgcm/CVS ; then    if test -e $tdir/MITgcm/CVS ; then
44    echo $tdir/MITgcm/CVS 'exist'      echo $tdir/MITgcm/CVS 'exist'
45    echo -n "Update the MITgcm code using: $cmdCVS ..."      echo -n "Update the MITgcm code using: $cmdCVS ..."
46    cd $tdir/MITgcm      cd $tdir/MITgcm
47    if test $sepDir = 1 ; then      if test $sepDir = 1 ; then
48      $cmdCVS update -P -d > /dev/null        $cmdCVS update -P -d > /dev/null
49        else
50          $cmdCVS update -P -d
51        fi
52        echo "  done"
53    else    else
54      $cmdCVS update -P -d      echo -n $tdir/MITgcm 'missing ; '
55        checkOut=1
56    fi    fi
   echo "  done"  
  else  
   echo -n $tdir/MITgcm 'missing ; '  
   checkOut=1  
  fi  
57  fi  fi
58  if test $checkOut = '1' ; then  if test $checkOut = '1' ; then
59    if test -e $tdir ; then    if test -e $tdir ; then
# Line 77  last_Tst=`echo $tst_list | awk '{print $ Line 79  last_Tst=`echo $tst_list | awk '{print $
79  for tt in $tst_list  for tt in $tst_list
80  do  do
81    
82   echo "================================================================"    echo "================================================================"
83   typ=`echo $tt | sed 's/+rs//'`    typ=`echo $tt | sed 's/+rs//'`
84   #- check day and time:    #- check day and time:
85   curDay=`date +%d` ; curHour=`date +%H`    curDay=`date +%d` ; curHour=`date +%H`
86   if [ $curDay -ne $TODAY ] ; then    if [ $curDay -ne $TODAY ] ; then
87     date ; echo "day is over => skip test $typ"      date ; echo "day is over => skip test $typ"
88     continue      continue
89   fi    fi
90   if [ $curHour -ge 18 ] ; then    if [ $curHour -ge 18 ] ; then
91     date ; echo "too late to run test $typ"      date ; echo "too late to run test $typ"
92     continue      continue
93   fi    fi
94   #- clean-up old output files    #- clean-up old output files
95   rm -f $tdir/output_${typ}*    rm -f $tdir/output_${typ}*
96   if test $sepDir = 1 ; then    if test $sepDir = 1 ; then
97    new_dir="MITgcm_$typ"      new_dir="MITgcm_$typ"
98    if test -d $new_dir/CVS -a $checkOut = '0' ; then      if test -d $new_dir/CVS -a $checkOut = '0' ; then
99      pushd $new_dir        pushd $new_dir
100      echo -n "Update the MITgcm code using: $cmdCVS ..."        echo -n "Update the MITgcm code using: $cmdCVS ..."
101      $cmdCVS update -P -d        $cmdCVS update -P -d
102      echo "  done"        echo "  done"
103        else
104          test -e $new_dir  &&  rm -rf $new_dir
105          mkdir $new_dir
106          pushd $new_dir
107          cp -ra ../MITgcm/* .
108        fi
109    else    else
110      test -e $new_dir  &&  rm -rf $new_dir      pushd MITgcm
111      mkdir $new_dir    fi
112      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  
113    
114   if test $sepDir = 0 -a $checkOut = '1' -a  $tt = $firstTst ; then  #-- set the testreport command:
115      nbl='-100'
116      comm="./testreport"
117      if test $typ = 'g7a' -o  $typ = 'adm' -o  $typ = 'mpa' ; then
118        nbl='-60'
119        comm="$comm -adm"
120      elif test $typ = 'mth' -o  $typ = 'mp2' ; then
121        export GOMP_STACKSIZE=400m
122        export OMP_NUM_THREADS=2
123        comm="$comm -mth"
124      fi
125      comm="$comm -a jmc@mitgcm.org"
126    #-- set the optfile (+ mpi & match-precision)
127      MPI=0
128      case $typ in
129       'g77'|'g7a')         OPTFILE='../tools/build_options/linux_amd64_g77' ;;
130       'gfo'|'adm'|'mth')   OPTFILE='../tools/build_options/linux_amd64_gfortran'
131                            comm="$comm -match $MC -devel" ;;
132       'ifc')               OPTFILE='../tools/build_options/linux_amd64_ifort11' ;;
133       'pgi')               OPTFILE='../tools/build_options/linux_amd64_pgf77' ;;
134       'mpa'|'mpi'|'mp2')   OPTFILE='../tools/build_options/linux_amd64_gfortran'
135                            comm="$comm -match $MC -devel" ; MPI=6 ;;
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' ; then
150        source /srv/software/intel/intel-11.1.073/bin/ifortvars.sh intel64
151      fi
152      if test $typ = 'pgi' ; then
153       #listT='fizhi-cs-32x32x40 fizhi-cs-aqualev20'
154        export PGI=/srv/software/pgi/pgi-10.9
155        export PATH="$PATH:$PGI/linux86-64/10.9/bin"
156        export LM_LICENSE_FILE=$PGI/license.dat
157      fi
158    
159      if test $sepDir = 0 -a $checkOut = '1' -a  $tt = $firstTst ; then
160  #-- cleaning:  #-- cleaning:
161    echo "======================"      echo "======================"
162    echo "Cleaning test directories:"      echo "Cleaning test directories:"
163      cmdCLN="./testreport -clean"      cmdCLN="./testreport -clean"
164      echo " clean dir running: $cmdCLN"      echo " clean dir running: $cmdCLN"
165      $cmdCLN > /dev/null 2>&1      $cmdCLN > /dev/null 2>&1
166    echo "======================"      echo "======================"
167    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"  
168    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  
169    
170   if test $typ = 'ifc'  #-- run the testreport command:
171   then    echo -n "Running testreport using:"
   
   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"  
172    if test "x$OPTFILE" != x ; then    if test "x$OPTFILE" != x ; then
173      comm="$comm -of=$OPTFILE"      comm="$comm -of=$OPTFILE"
174    fi    fi
175    if test "x$option" != x ; then comm="$comm $option" ; fi    if test $MPI = 0 ; then  echo ''
176    echo "  \"$comm\""    else echo " (EXE='$EXE')"
177    echo "======================"      comm="$comm -MPI $MPI -command \"\$EXE\""
   $comm > $tdir/output_$typ 2>&1  
   tail -100 $tdir/output_$typ  
   echo  
   
  fi  
   
  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"  
   if test "x$OPTFILE" != x ; then  
     comm="$comm -of=$OPTFILE"  
178    fi    fi
179    if test "x$option" != x ; then comm="$comm $option" ; fi    if test "x$option" != x ; then comm="$comm $option" ; fi
180    echo "  \"$comm\""   #if test $typ = 'pgi' ; then comm="$comm -t \"\$listT\"" ; fi
181      echo "  \"eval $comm\""
182    echo "======================"    echo "======================"
183    $comm > $tdir/output_$typ 2>&1    eval $comm > $tdir/output_$typ 2>&1
184    tail -100 $tdir/output_$typ    tail $nbl $tdir/output_$typ
185    echo    echo
186    
  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 -dd"  
   comm="$comm -match $MC"  
   #comm="$comm -skd tutorial_advection_in_gyre"  
   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}_1 2>&1  
   tail -100 $tdir/output_${typ}_1  
   echo  
   echo "Running testreport using:"  
   comm="./testreport -q -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"  
   fi  
   echo "  \"$comm\""  
   echo "======================"  
   $comm > $tdir/output_${typ}_2 2>&1  
   tail -100 $tdir/output_${typ}_2  
   echo  
   
  fi  
   
187  #-- also test restart (test 2+2=4)  #-- also test restart (test 2+2=4)
188   if test $tt != $typ    if test $tt != $typ
189   then    then
190     echo "testing restart using:"      echo "testing restart using:"
191     comm="../tools/do_tst_2+2 -a jmc@mitgcm.org"      comm="../tools/do_tst_2+2 -a jmc@mitgcm.org"
192     echo "  \"$comm\""      if test $MPI = 0 ; then
193     echo "======================"        echo "  \"$comm\""
194     $comm > $tdir/output_2+2 2>&1        echo "======================"
195    #tail -100 $tdir/output_2+2        $comm > $tdir/output_2+2 2>&1
196     echo ; cat tst_2+2_out.txt      else
197     echo        echo "  \"$comm -mpi -exe $EXE\""
198   fi        echo "======================"
199   export OMP_NUM_THREADS=1        $comm -mpi -exe "$EXE" > $tdir/output_2+2 2>&1
200        fi
201       #tail $nbl $tdir/output_2+2
202        echo ; cat tst_2+2_out.txt
203        echo
204      fi
205      export OMP_NUM_THREADS=1
206    
207   if test $sepDir = 0 ; then    if test $sepDir = 0 ; then
208  #-- cleaning:  #-- cleaning:
209    echo "======================"      echo "======================"
210    echo "Cleaning test directories:"      echo "Cleaning test directories:"
211    if test $tt != $typ ; then      if test $tt != $typ ; then
212      cmdCLN="../tools/do_tst_2+2 -clean"        cmdCLN="../tools/do_tst_2+2 -clean"
213      echo " clean tst_2+2 running: $cmdCLN"        echo " clean tst_2+2 running: $cmdCLN"
214      $cmdCLN >> $tdir/output_2+2 2>&1        $cmdCLN >> $tdir/output_2+2 2>&1
215    fi      fi
216    if test $tt != $last_Tst ; then      if test $tt != $last_Tst ; then
217      cmdCLN="./testreport -clean"        cmdCLN="./testreport -clean"
218      echo " clean dir running: $cmdCLN"        echo " clean dir running: $cmdCLN"
219      $cmdCLN > /dev/null 2>&1        $cmdCLN > /dev/null 2>&1
220        fi
221        echo "======================"
222        echo
223    fi    fi
224    echo "======================"    popd
   echo  
  fi  
  popd  
225    
226  done  done

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

  ViewVC Help
Powered by ViewVC 1.1.22