/[MITgcm]/MITgcm/tools/do_tst_2+2
ViewVC logotype

Diff of /MITgcm/tools/do_tst_2+2

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

revision 1.18 by jmc, Sun Sep 22 23:37:12 2013 UTC revision 1.21 by jmc, Wed Nov 18 22:18:41 2015 UTC
# Line 32  SKIPDIRS= Line 32  SKIPDIRS=
32  SCRIPT='../tools/tst_2+2'  SCRIPT='../tools/tst_2+2'
33  LOGFILE='tst_2+2_out.log'  LOGFILE='tst_2+2_out.log'
34  scrArg='All'  scrArg='All'
35    bldDir='build'
36  COMMAND=  COMMAND=
37  mpi=0  mpi=0
38  MPI_MFILE=  MPI_MFILE=
39  OUTDIR=`hostname | sed 's/\..*$//'`  OUTDIR=`hostname -s | tr '[:upper:]' '[:lower:]'`
40  SAVELOG=0  SAVELOG=0
41  ADDRESS=  ADDRESS=
42  MPACK="../tools/mpack-1.6/mpack"  MPACK="../tools/mpack-1.6/mpack"
# Line 125  for xx in "$@" ; do nw=`echo $xx | wc -w Line 126  for xx in "$@" ; do nw=`echo $xx | wc -w
126      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
127                          else CMDLINE="$CMDLINE '$xx'" ; fi                          else CMDLINE="$CMDLINE '$xx'" ; fi
128  done  done
 #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  
129  DATE=''  DATE=''
130  if test -f tr_out.txt ; then  if test -f tr_out.txt ; then
131  #  try to use the date corresponding to 'Start time:' in file "tr_out.txt" :  #  try to use the date corresponding to 'Start time:' in file "tr_out.txt" :
# Line 179  do Line 179  do
179      rCommand=$COMMAND      rCommand=$COMMAND
180    else    else
181      LOC_NPROC=2      LOC_NPROC=2
182      mpi_size=$xx/build/SIZE.h.mpi      mpi_size=$xx/$bldDir/SIZE.h.mpi
183      if test -f $mpi_size ; then      if test -f $mpi_size ; then
184        px=`grep '^     & *nPx *=' $mpi_size | sed 's/^     & *nPx *= *//' | sed 's/, *$//'`        px=`grep '^     & *nPx *=' $mpi_size | sed 's/^     & *nPx *= *//' | sed 's/, *$//'`
185        py=`grep '^     & *nPy *=' $mpi_size | sed 's/^     & *nPy *= *//' | sed 's/, *$//'`        py=`grep '^     & *nPy *=' $mpi_size | sed 's/^     & *nPy *= *//' | sed 's/, *$//'`
# Line 204  do Line 204  do
204    for yy in $listD    for yy in $listD
205    do    do
206      if test -f $xx/$yy/$RUNOUTP ; then      if test -f $xx/$yy/$RUNOUTP ; then
207        if test "x$OPTFILE" = x -a -f $xx/build/Makefile ; then        if test "x$OPTFILE" = x -a -f $xx/$bldDir/Makefile ; then
208          comm=`grep '^# OPTFILE=' $xx/build/Makefile 2>/dev/null | head -1 | sed 's/^# //'`          comm=`grep '^# OPTFILE=' $xx/$bldDir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`
209          echo "from '$xx/build/Makefile', extract:" > $DRESULTS/genmake_state          echo "from '$xx/$bldDir/Makefile', extract:" > $DRESULTS/genmake_state
210          sed -n '/^# executed by:/,+1 p' $xx/build/Makefile >> $DRESULTS/genmake_state          sed -n '/^# executed by:/,+1 p' $xx/$bldDir/Makefile >> $DRESULTS/genmake_state
211          echo " $comm" >> $DRESULTS/genmake_state          echo " $comm" >> $DRESULTS/genmake_state
212          eval $comm          eval $comm
213          gmkLog=$xx/build/genmake.log          gmkLog=$xx/$bldDir/genmake.log
214          grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1          grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1
215          out=$?          out=$?
216          if test "x$out" = x0 ; then          if test "x$out" = x0 ; then
# Line 269  if test "x$ADDRESS" != xNONE -a "x$ADDRE Line 269  if test "x$ADDRESS" != xNONE -a "x$ADDRE
269        # if Send-Command is empty and mpack exist, then send email using mpack.        # if Send-Command is empty and mpack exist, then send email using mpack.
270        if test -x $MPACK ; then SENDCMD=$MPACK        if test -x $MPACK ; then SENDCMD=$MPACK
271        else        else
         echo "Warning: $MPACK is not executable => no email was sent"  
272          echo          echo
273            echo "Warning: $MPACK is not executable => no email was sent"
274        fi        fi
275      fi      fi
276      if test "x$SENDCMD" != x ; then      if test "x$SENDCMD" != x ; then
# Line 284  if test "x$ADDRESS" != xNONE -a "x$ADDRE Line 284  if test "x$ADDRESS" != xNONE -a "x$ADDRE
284              echo "Warning: The tar, gzip, & mpack step failed.  Please send email"              echo "Warning: The tar, gzip, & mpack step failed.  Please send email"
285              echo "  to <MITgcm-support@mitgcm.org> for help.  You may copy the "              echo "  to <MITgcm-support@mitgcm.org> for help.  You may copy the "
286              echo "  summary of results from the directory \"$DRESULTS\"."              echo "  summary of results from the directory \"$DRESULTS\"."
             echo  
287          else          else
288              echo              echo
289              echo "An email containing results was sent to the following address:"              echo "An email containing results was sent to the following address:"
290              echo "  \"$ADDRESS\""              echo "  \"$ADDRESS\""
             echo  
291          fi          fi
292          test -f ${SAVDIR}/${DRESULTS}".tar" &&  rm -f ${SAVDIR}/${DRESULTS}".tar"          test -f ${SAVDIR}/${DRESULTS}".tar" &&  rm -f ${SAVDIR}/${DRESULTS}".tar"
293          test -f ${SAVDIR}/${DRESULTS}".tar.gz" &&  rm -f ${SAVDIR}/${DRESULTS}".tar.gz"          test -f ${SAVDIR}/${DRESULTS}".tar.gz" &&  rm -f ${SAVDIR}/${DRESULTS}".tar.gz"
294      fi      fi
295  fi  fi
296    echo '' ; echo '=====  Summary (tst_2+2_out.txt):  ======'
297    cat $SUMMARY
298    
299  # save output and remove output Dir (if no address was provided)  # save output and remove output Dir (if no address was provided)
300  # note: to keep the output Dir without sending email, use option "-a NONE"  # note: to keep the output Dir without sending email, use option "-a NONE"

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.22