/[MITgcm]/MITgcm/verification/testreport
ViewVC logotype

Diff of /MITgcm/verification/testreport

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

revision 1.19 by edhill, Tue Nov 25 17:22:47 2003 UTC revision 1.20 by edhill, Wed Nov 26 15:04:42 2003 UTC
# Line 13  usage() Line 13  usage()
13      echo "  (-help|-h)               print usage"      echo "  (-help|-h)               print usage"
14      echo "  (-mpi)                   use MPI input files"      echo "  (-mpi)                   use MPI input files"
15      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"
16        echo "                             (DEF=\"noieee\")"
17      echo "  (-optfile=|-of=)STRING   list of optfiles to use"      echo "  (-optfile=|-of=)STRING   list of optfiles to use"
18      echo "  (-a|-addr)STRING         list of email recipients"      echo "  (-a|-addr) STRING        list of email recipients"
19      echo "                             (DEF=\"edhill@mitgcm.org\")"      echo "                             (DEF=\"edhill@mitgcm.org\")"
20      echo "  (-t|-tdir)STRING         list of test dirs to use"      echo "  (-t|-tdir) STRING        list of test dirs to use"
21      echo "                             (DEF=\"\" which builds all)"      echo "                             (DEF=\"\" which builds all)"
22      echo "  (-b|-bash)STRING         location of \"bash\" executable"      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"
23      echo "                             (DEF=\"\" for \"/bin/bash\")"      echo "                             Bourne-compatible \"sh\" shell"
24      echo "  (-command)STRING         command to run"      echo "                             (DEF=\"\" for \"bash\")"
25        echo "  (-command) STRING        command to run"
26      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
27      echo "  (-m|-make)STRING         command to use for \"make\""      echo "  (-m|-make) STRING        command to use for \"make\""
28      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
29      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
30      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
# Line 44  build_mpack() Line 46  build_mpack()
46      echo -n "building the mpack utility...  "      echo -n "building the mpack utility...  "
47      if test ! -x "$MPACKDIR/mpack" ; then      if test ! -x "$MPACKDIR/mpack" ; then
48          if test ! -d $MPACKDIR ; then          if test ! -d $MPACKDIR ; then
49                echo
50              echo "Error: can't find \"$MPACKDIR\""              echo "Error: can't find \"$MPACKDIR\""
51              echo "  are you sure this program is being run in the correct "              echo "  are you sure this program is being run in the correct "
52              echo "  (that is, \"MITGCM_ROOT\verification\") directory?"              echo "  (that is, \"MITGCM_ROOT\verification\") directory?"
53              exit 1              echo
54                HAVE_MPACK=f
55          fi          fi
56          echo -n "building mpack...  "          echo -n "building mpack...  "
57          ( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1          ( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1
# Line 55  build_mpack() Line 59  build_mpack()
59          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
60              echo              echo
61              echo "Error building the mpack tools at: $MPACK_DIR"              echo "Error building the mpack tools at: $MPACK_DIR"
62              exit 1              echo
63                HAVE_MPACK=f
64            else
65                HAVE_MPACK=t
66          fi          fi
67        else
68            HAVE_MPACK=t
69      fi      fi
70      echo "OK"      echo "OK"
71  }  }
# Line 209  genmakemodel() Line 218  genmakemodel()
218                  cp make.log $CDIR                  cp make.log $CDIR
219                  return 1                  return 1
220              else              else
221                  echo "succesful" 1>&2                  echo "successful" 1>&2
222              fi              fi
223          )          )
224      fi      fi
# Line 237  makeclean() Line 246  makeclean()
246                      return 1                      return 1
247                  fi                  fi
248              fi              fi
249              echo succesful 1>&2              echo successful 1>&2
250              exit 0              exit 0
251          )          )
252      fi      fi
# Line 260  makedependmodel() Line 269  makedependmodel()
269                  cp make.log $CDIR"/make.log"                  cp make.log $CDIR"/make.log"
270                  return 1                  return 1
271              else              else
272                  echo succesful 1>&2                  echo successful 1>&2
273              fi              fi
274          )          )
275      fi      fi
# Line 281  makemodel() Line 290  makemodel()
290                  cp make.log $CDIR"/make.log"                  cp make.log $CDIR"/make.log"
291                  return 1                  return 1
292              else              else
293                  echo succesful 1>&2                  echo successful 1>&2
294              fi              fi
295          fi          fi
296      )      )
# Line 313  runmodel() Line 322  runmodel()
322      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
323      (      (
324          cd $1          cd $1
325          printf 'runmodel: ' 1>&2          printf 'runmodel ... ' 1>&2
326          # make output.txt          # make output.txt
327          $COMMAND          $COMMAND >> run.log 2>&1
328          RETVAL=$?          RETVAL=$?
329          if test "x$RETVAL" = x0 ; then          if test "x$RETVAL" = x0 ; then
330                echo successful 1>&2
331              cp output.txt $CDIR"/output.txt"              cp output.txt $CDIR"/output.txt"
332              return 0              return 0
333          else          else
334                tail run.log
335                echo failed 1>&2
336                cp run.log $CDIR"/run.log"
337              return 1              return 1
338          fi          fi
339      )      )
# Line 450  OPTFILE=NONE Line 463  OPTFILE=NONE
463  ADDRESSES=  ADDRESSES=
464  TESTDIRS=  TESTDIRS=
465  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
466    HAVE_MPACK=
467  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
468  COMMAND="make output.txt"  COMMAND="make output.txt"
469  MAKE=make  MAKE=make
# Line 575  done Line 589  done
589  mkdir $DRESULTS  mkdir $DRESULTS
590  RETVAL=$?  RETVAL=$?
591  if test "x$RETVAL" != x0 ; then  if test "x$RETVAL" != x0 ; then
592      echo "Error: can't create results directory \"./$DRESULTS\""      echo "ERROR: Can't create results directory \"./$DRESULTS\""
593      exit 1      exit 1
594  fi  fi
595  SUMMARY="$DRESULTS/summary.txt"  SUMMARY="$DRESULTS/summary.txt"
596  echo -n "Start time:  " >> $SUMMARY  echo -n "Start time:  " >> $SUMMARY
597  start_date=`date`  start_date=`date`
598  echo $start_date > $SUMMARY  echo $start_date > $SUMMARY
599  cat << EOF >> $SUMMARY  cat << EOF | tee -a $SUMMARY
600                  T           S           U           V                  T           S           U           V
601  G D M    c        m  s        m  s        m  s        m  s  G D M    c        m  s        m  s        m  s        m  s
602  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
# Line 693  for dir in $TESTDIRS ; do Line 707  for dir in $TESTDIRS ; do
707      fi      fi
708            
709      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir for each OPTFILE/tdir combination
710      CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR      rel_CDIR=$DRESULTS"/"$dir
711      mkdir $CDIR      mkdir $rel_CDIR
712      CDIR=`pwd`"/$CDIR"      CDIR=`pwd`"/$rel_CDIR"
713            
714      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
715          makeclean $dir/$builddir          makeclean $dir/$builddir
# Line 724  for dir in $TESTDIRS ; do Line 738  for dir in $TESTDIRS ; do
738      echo "DATE='$DATE'" >> $CDIR"/summary.txt"      echo "DATE='$DATE'" >> $CDIR"/summary.txt"
739      echo "tdir='$dir'" >> $CDIR"/summary.txt"      echo "tdir='$dir'" >> $CDIR"/summary.txt"
740            
     (  
         cd $DRESULTS  
         tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1  
         gzip $NDIR".tar"  
     )  
       
     if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then  
         echo "No mail sent"  
     else  
         $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES  
         RETVAL=$?  
         if test "x$RETVAL" != x0 ; then  
             echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"  
         else  
             rm -f $DRESULTS"/"$NDIR".tar*"  
         fi  
     fi  
   
741      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
742            
743      NDIR=$(( $NDIR + 1 ))      NDIR=$(( $NDIR + 1 ))
# Line 753  echo $start_date >> $SUMMARY Line 749  echo $start_date >> $SUMMARY
749  echo -n "End time:    " >> $SUMMARY  echo -n "End time:    " >> $SUMMARY
750  date >> $SUMMARY  date >> $SUMMARY
751    
752    #  If addresses were supplied and mpack built successfully, then try
753    #  to send email using mpack.
754    if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
755        echo "No results email was sent."
756    else
757        if test "x$HAVE_MPACK" = xt ; then
758            tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \
759                && gzip $DRESULTS".tar" \
760                && $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES
761            RETVAL=$?
762            if test "x$RETVAL" != x0 ; then
763                echo
764                echo "Warning: The tar, gzip, & mpack step failed.  Please send email"
765                echo "  to <MITgcm-support@mitgcm.org> for help.  You may copy the "
766                echo "  summary of results from the directory \"$DRESULTS\"."
767                echo
768            else
769                echo
770                echo "An email containing results was sent to the following addresses:"
771                echo "  \"$ADDRESSES\""
772                echo
773            fi
774            test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"
775            test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"
776        fi
777    fi
778    
779  rm tmp_cmpnum.f a.out  rm tmp_cmpnum.f a.out
780    
781  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.22