/[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.9.2.5 by edhill, Fri Oct 3 16:03:00 2003 UTC revision 1.21 by edhill, Thu Nov 27 16:15:39 2003 UTC
# Line 1  Line 1 
1  #!/bin/bash  #! /usr/bin/env bash
2  #  #
3  #  $Header$  #  $Header$
4    #  $Name$
5  #  #
6    
7  usage()  usage()
# Line 11  usage() Line 12  usage()
12      echo "where possible OPTIONS are:"      echo "where possible OPTIONS are:"
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"
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 "  (-c|-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\""
30      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
31      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
32      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
# Line 41  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 52  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 78  testoutput_for_prop() Line 90  testoutput_for_prop()
90          echo testoutput_for_prop: grep "$2" $1/$4/output.txt 1>&2          echo testoutput_for_prop: grep "$2" $1/$4/output.txt 1>&2
91      fi      fi
92      if [ -r $1/$4/output.txt ]; then      if [ -r $1/$4/output.txt ]; then
93          grep "$2" $1/$4/output.txt | sed 's/.*=//' | nl > tmp1.txt          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt
94          lncnt=`wc -l tmp1.txt | awk '{print $1}' `          lncnt=`wc -l tmp1.txt | awk '{print $1}' `
95          if [ $lncnt -lt 3 ]; then          if [ $lncnt -lt 3 ]; then
96              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
# Line 93  testoutput_for_prop() Line 105  testoutput_for_prop()
105      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
106          echo testoutput_for_prop: grep "$2" $1/results/output.txt 1>&2          echo testoutput_for_prop: grep "$2" $1/results/output.txt 1>&2
107      fi      fi
108      grep "$2" $1/results/output.txt | sed 's/.*=//' | nl > tmp2.txt      grep "$2" $1/results/output.txt | sed 's/.*=//' | cat -n > tmp2.txt
109      lncnt=`wc -l tmp2.txt | awk '{print $1}' `      lncnt=`wc -l tmp2.txt | awk '{print $1}' `
110      if [ $lncnt -lt 3 ]; then      if [ $lncnt -lt 3 ]; then
111          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
# Line 153  testoutput() Line 165  testoutput()
165      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
166          echo testoutput: cg2dres=$cg2dres 1>&2          echo testoutput: cg2dres=$cg2dres 1>&2
167      fi      fi
       
168      testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?      testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?
169      testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?      testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?
170      testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?      testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?
# Line 184  genmakemodel() Line 195  genmakemodel()
195          GENMAKE2="$BASH ../../../tools/genmake2"          GENMAKE2="$BASH ../../../tools/genmake2"
196          (          (
197              cd $1;              cd $1;
198                command="$GENMAKE2  -ds -m $MAKE --mods=../code"
199                if test "x$OPTFILE" != xNONE ; then
200                    command="$command --optfile=$OPTFILE"
201                fi
202                if test "x$IEEE" != x ; then
203                    command="$command -ieee"
204                fi
205              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
206              # ../../../tools/genmake -ieee -mods=../code > make.log 2>&1              $command > make.log 2>&1
             $GENMAKE2  -ds -m $MAKE --mods=../code "--optfile="$OPTFILE > make.log 2>&1  
207              RETVAL=$?              RETVAL=$?
208              for i in gm_state gm_optfile gm_local Makefile ; do              cp Makefile $CDIR
                 if test -r $i ; then  
                     cp $i $CDIR  
                 fi  
             done  
209              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
210                  tail make.log                  tail make.log
211                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed" 1>&2
212                  cp make.log $CDIR                  cp genmake_* make.log $CDIR
213                  return 1                  return 1
214              else              else
215                  echo "succesful" 1>&2                  echo "successful" 1>&2
216              fi              fi
217          )          )
218      fi      fi
# Line 227  makeclean() Line 240  makeclean()
240                      return 1                      return 1
241                  fi                  fi
242              fi              fi
243              echo succesful 1>&2              echo successful 1>&2
244              exit 0              exit 0
245          )          )
246      fi      fi
# Line 250  makedependmodel() Line 263  makedependmodel()
263                  cp make.log $CDIR"/make.log"                  cp make.log $CDIR"/make.log"
264                  return 1                  return 1
265              else              else
266                  echo succesful 1>&2                  echo successful 1>&2
267              fi              fi
268          )          )
269      fi      fi
# Line 271  makemodel() Line 284  makemodel()
284                  cp make.log $CDIR"/make.log"                  cp make.log $CDIR"/make.log"
285                  return 1                  return 1
286              else              else
287                  echo succesful 1>&2                  echo successful 1>&2
288              fi              fi
289          fi          fi
290      )      )
# Line 282  linkdata() Line 295  linkdata()
295      # linkdata flag      # linkdata flag
296      #      #
297      # symbolically link data files to run directory      # symbolically link data files to run directory
298      if [ $1 -ne 0 ]; then      if test "x$1" = x1 ; then
299          ( cd $2 ;  ln -sf ../input/* . )          (
300                cd $2
301                files=`( cd ../input ; ls -1 | grep -v CVS )`
302                for i in $files ; do
303                    if test ! -d "../input/"$i ; then
304                        ln -sf "../input/"$i $i
305                    fi
306                done
307            )
308      fi      fi
309  }  }
310    
# Line 295  runmodel() Line 316  runmodel()
316      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
317      (      (
318          cd $1          cd $1
319          printf 'runmodel: ' 1>&2          printf 'runmodel ... ' 1>&2
320          # make output.txt          # make output.txt
321          $COMMAND          $COMMAND >> run.log 2>&1
322          RETVAL=$?          RETVAL=$?
323          if test "x$RETVAL" = x0 ; then          if test "x$RETVAL" = x0 ; then
324                echo successful 1>&2
325              cp output.txt $CDIR"/output.txt"              cp output.txt $CDIR"/output.txt"
326              return 0              return 0
327          else          else
328                tail run.log
329                echo failed 1>&2
330                cp run.log $CDIR"/run.log"
331              return 1              return 1
332          fi          fi
333      )      )
# Line 338  c         print *,int(log10(diff)),diff Line 363  c         print *,int(log10(diff)),diff
363        end        end
364  EOFA  EOFA
365    
366      f77 tmp_cmpnum.f      f77 -o a.out tmp_cmpnum.f
367      if [ -x ./a.out ]; then      if [ -x ./a.out ]; then
368          echo "OK"          echo "OK"
369          return 0          return 0
370      else      else
371          echo          echo
372          echo "createcodelet: failed to compile codelet"          echo "ERROR: failed to compile comparison code"
373          exit 1          exit 1
374      fi      fi
375  }  }
# Line 383  $0 [-help] [-quick] [-verbose] dir1 [dir Line 408  $0 [-help] [-quick] [-verbose] dir1 [dir
408   -debug     Produce even more output which will mean nothing to most   -debug     Produce even more output which will mean nothing to most
409   -force     Do "make CLEAN" before compiling. This forces a complete rebuild.   -force     Do "make CLEAN" before compiling. This forces a complete rebuild.
410   -clean     Do "make CLEAN" after compiling and testing.   -clean     Do "make CLEAN" after compiling and testing.
  -noieee    By default, $0 uses the -ieee option for genmake. This turns it off.  
411   -cleanup   Aggresively removes all model output, executables and object files   -cleanup   Aggresively removes all model output, executables and object files
412              and then exits. Use with care.              and then exits. Use with care.
413    
# Line 405  scandirs() Line 429  scandirs()
429    
430    
431  ###############################################################################  ###############################################################################
 ###############################################################################  
 ###############################################################################  
432    
433    
434  #  Default properties  #  Default properties
# Line 416  clean=0 Line 438  clean=0
438  expts=''  expts=''
439  # ieee=1  # ieee=1
440    
441    IEEE=
442    if test "x$MITGCM_IEEE" != x ; then
443        IEEE=$MITGCM_IEEE
444    fi
445    
446    
447  CLEANUP=f  CLEANUP=f
448  QUICK=f  QUICK=f
449  NOGENMAKE=f  NOGENMAKE=f
# Line 423  NOCLEAN=f Line 451  NOCLEAN=f
451  NODEPEND=f  NODEPEND=f
452    
453  BASH=  BASH=
454  OPTFILES=  OPTFILE=NONE
455  ADDRESSES=  ADDRESSES=
456  TESTDIRS=  TESTDIRS=
457  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
458    HAVE_MPACK=
459  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
460  COMMAND="make output.txt"  COMMAND="make output.txt"
461  MAKE=make  MAKE=make
# Line 452  for ac_option ; do Line 481  for ac_option ; do
481              usage ;;              usage ;;
482                    
483          -optfile | --optfile | -of | --of)          -optfile | --optfile | -of | --of)
484              ac_prev=OPTFILES ;;              ac_prev=OPTFILE ;;
485          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
486              OPTFILES=$ac_optarg ;;              OPTFILE=$ac_optarg ;;
487                    
488          -addr | --addr | -a | --a)          -addr | --addr | -a | --a)
489              ac_prev=ADDRESSES ;;              ac_prev=ADDRESSES ;;
# Line 494  for ac_option ; do Line 523  for ac_option ; do
523              NODEPEND=t ;;              NODEPEND=t ;;
524    
525          -mpi) MPI=t ;;          -mpi) MPI=t ;;
526    
527            -ieee) IEEE=true ;;
528            -noieee) IEEE= ;;
529    
530          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
531          -debug) debug=1 ;;          -debug) debug=1 ;;
         -clean) clean=1 ;;  
532          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
533    
534          -*)          -*)
# Line 523  if test "x$TESTDIRS" = x ; then Line 555  if test "x$TESTDIRS" = x ; then
555      TESTDIRS=`scandirs`      TESTDIRS=`scandirs`
556  fi  fi
557    
558  if test "x$OPTFILES" = x ; then  if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then
559      OPTFILES=$MITGCM_OF      OPTFILE=$MITGCM_OF
 fi  
 if test "x$OPTFILES" = x ; then  
     echo "Error: please specify an optfile using either the command-line or"  
     echo "  the MITGCM_OF environment variable.  Also, examples are located "  
     echo "  in \$ROOTDIR/tools/build_options"  
     exit 1  
560  fi  fi
561    
562  echo "OK"  echo "OK"
# Line 555  done Line 581  done
581  mkdir $DRESULTS  mkdir $DRESULTS
582  RETVAL=$?  RETVAL=$?
583  if test "x$RETVAL" != x0 ; then  if test "x$RETVAL" != x0 ; then
584      echo "Error: can't create results directory \"./$DRESULTS\""      echo "ERROR: Can't create results directory \"./$DRESULTS\""
585      exit 1      exit 1
586  fi  fi
587  SUMMARY="$DRESULTS/summary.txt"  SUMMARY="$DRESULTS/summary.txt"
588  date > $SUMMARY  echo -n "Start time:  " >> $SUMMARY
589  cat << EOF >> $SUMMARY  start_date=`date`
590    echo $start_date > $SUMMARY
591    
592    of_path=
593    if test "x$OPTFILE" != xNONE ; then
594        if test -r $OPTFILE ; then
595            # get the path
596            path=${OPTFILE%/*}
597            if test "x$path" = x ; then
598                of_path=`pwd`
599            else
600                of_path=`( cd $path > /dev/null 2>&1 ; pwd )`
601            fi
602            file=${OPTFILE##*/}
603            OPTFILE=$of_path/$file
604            cp $OPTFILE $DRESULTS
605            echo >> $SUMMARY
606            echo "  OPTFILE=$OPTFILE" >> $SUMMARY
607        else
608            echo | tee $SUMMARY
609            echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee $SUMMARY
610            exit 1
611        fi
612    else
613        echo >> $SUMMARY
614        echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY
615        echo "   so the genmake default will be used." >> $SUMMARY
616    fi
617    echo
618    echo >> $SUMMARY
619    cat << EOF | tee -a $SUMMARY
620                  T           S           U           V                  T           S           U           V
621  G D M    c        m  s        m  s        m  s        m  s  G D M    c        m  s        m  s        m  s        m  s
622  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 569  N n k u  2  i  a  a  d  i  a  a  d  i  a Line 625  N n k u  2  i  a  a  d  i  a  a  d  i  a
625    
626  EOF  EOF
627    
628  NDIR=0  #  ...and each test directory...
629    for dir in $TESTDIRS ; do
 #  For each optfile...  
 for OPTFILE in $OPTFILES ; do  
   
     OPTFILE=`pwd`"/$OPTFILE"  
     if test ! -r $OPTFILE ; then  
         echo "Error: can't read optfile \"$OPTFILE\""  
         exit 1  
     fi  
     echo  
     echo "OPTFILE=$OPTFILE" >> $SUMMARY  
     echo >> $SUMMARY  
630            
631      #  ...and each test directory...      #  Cleanup only!
632      for dir in $TESTDIRS ; do      if test "x$CLEANUP" = xt ; then
633            if test -r $dir/build/Makefile ; then
634          #  Cleanup only!              ( cd $dir/build ; make CLEAN )
         if test "x$CLEANUP" = xt ; then  
             if test -r $dir/build/Makefile ; then  
                 ( cd $dir/build ; make CLEAN )  
             fi  
             if test -r $dir/input/Makefile ; then  
                 ( cd $dir/input ; make CLEAN )  
             fi  
             continue  
635          fi          fi
636            if test -r $dir/input/Makefile ; then
637          #  Verify that the testdir exists and contains previous              ( cd $dir/input ; make CLEAN )
         #  results in the correct location--or skip this directory!  
         if test ! -r $dir"/results/output.txt" ; then  
             echo  
             echo "can't read \"$dir/results/output.txt\" -- skipping $dir"  
             echo  
             continue  
638          fi          fi
639            continue
640        fi
641    
642          echo "-------------------------------------------------------------------------------"      #  Verify that the testdir exists and contains previous
643          echo      #  results in the correct location--or skip this directory!
644          echo "Experiment:  $dir"      if test ! -r $dir"/results/output.txt" ; then
645          echo          echo "can't read \"$dir/results/output.txt\" -- skipping $dir"
646          unset genmake makedepend make run          continue
647          results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'      fi
648    
649          if [ -r $dir/build ]; then      echo "-------------------------------------------------------------------------------"
650              seperatebuilddir=1      echo
651              builddir=build      echo "Experiment:  $dir"
652              rundir=build      echo
653              ( cd $dir/build; ln -sf ../input/* . )      unset genmake makedepend make run
654          else      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
             seperatebuilddir=0  
             builddir=input  
             rundir=input  
         fi  
655    
656          CODE_DIR=$dir/code      builddir="input"
657          BUILD_DIR=$dir/$builddir      rundir="input"
658          MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"      use_seperate_build=0
659          NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"      if test -d $dir/build -a -r $dir/build ; then
660          #  Is this an MPI run?          builddir="build"
661          if test "x$MPI" = xt ; then          rundir="build"
662              FILES=$MPI_FILES          use_seperate_build=1
663          else          linkdata $use_seperate_build $dir/$rundir
664              FILES=$NOMPI_FILES      fi
665        
666        CODE_DIR=$dir/code
667        BUILD_DIR=$dir/$builddir
668        MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"
669        NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"
670    
671        #  Is this an MPI run?
672        if test "x$MPI" = xt ; then
673            FILES=$MPI_FILES
674            endings="_mpi"
675        else
676            FILES=$NOMPI_FILES
677            endings="_nompi"
678        fi
679        
680        #  Check to see that we have the files
681        have_files=t
682        for i in $FILES ; do
683            if test ! -r $CODE_DIR/$i ; then
684                echo "Warning: can't read file $CODE_DIR/$i"
685                have_files=f
686          fi          fi
687        done
688          #  Check to see that we have the files      if test "x$have_files" != xt -a "x$MPI" = xt ; then
689          have_files=t          echo "Skipping $dir due to lack of input files (see above warning)"
690            continue
691        fi
692        
693        #  If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR
694        if test "x$have_files" = xt ; then
695          for i in $FILES ; do          for i in $FILES ; do
696              if test ! -r $CODE_DIR/$i ; then              sstr="s|$endings||"
697                  echo "Warning: can't read file $CODE_DIR/$i" | tee -a $SUMMARY              name=`echo $i | sed -e $sstr `
698                  have_files=f              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1
699                RETVAL=$?
700                if test "x$RETVAL" != x0 ; then
701                    cp $CODE_DIR/$i $BUILD_DIR/$name
702              fi              fi
703          done          done
704          if test "x$have_files" != xt -a "x$MPI" = xt ; then      fi
705              echo "Skipping $dir due to lack of input files (see above warning)" \      
706                  | tee -a $SUMMARY      #  Create an output dir for each OPTFILE/tdir combination
707              continue      rel_CDIR=$DRESULTS"/"$dir
708          fi      mkdir $rel_CDIR
709        CDIR=`pwd`"/$rel_CDIR"
710          #  If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR      
711          if "x$have_files" = xt ; then      if test "x$CLEANUP" = xt ; then
712              for i in $FILES ; do          makeclean $dir/$builddir
713                  cmp $CODE_DIR/$i $BUILD_DIR/$i > /dev/null 2>&1      else
714                  RETVAL=$?          genmakemodel $dir/$builddir && genmake=Y \
715                  if test "x$RETVAL" != x0 ; then              && makeclean $dir/$builddir \
716                      cp $CODE_DIR/$i $BUILD_DIR/$i              && makedependmodel $dir/$builddir && makedepend=Y \
717                  fi              && makemodel $dir/$builddir && make=Y \
718              done              && linkdata $use_seperate_build $dir/$rundir \
719          fi              && runmodel $dir/$rundir && run=Y \
720                && results=`testoutput $dir $rundir`
721          #  Create an output dir for each OPTFILE/tdir combination      fi
722          CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR      
723          mkdir $CDIR      echo
724          CDIR=`pwd`"/$CDIR"      fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
725        echo
726          if test "x$CLEANUP" = xt ; then      echo "$fres" >> $SUMMARY
727              makeclean $dir/$builddir      echo "fresults='$fres'" > $CDIR"/summary.txt"
728          else      echo "MACH='$MACH'" >> $CDIR"/summary.txt"
729              genmakemodel $dir/$builddir && genmake=Y \      echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
730                  && makeclean $dir/$builddir \      echo "DATE='$DATE'" >> $CDIR"/summary.txt"
731                  && makedependmodel $dir/$builddir && makedepend=Y \      echo "tdir='$dir'" >> $CDIR"/summary.txt"
732                  && makemodel $dir/$builddir && make=Y \      
733                  && linkdata $seperatebuilddir $dir/$rundir \      echo "-------------------------------------------------------------------------------"
734                  && runmodel $dir/$builddir && run=Y \      
735                  && results=`testoutput $dir $rundir`  done
         fi  
   
         echo  
         formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \  
             ${run:-N} $results  
         echo  
         formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \  
             ${run:-N} $results >> $SUMMARY  
         echo "fresults='" > $CDIR"/summary.txt"  
         formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \  
             ${run:-N} $results >> $CDIR"/summary.txt"  
         echo "'" >> $CDIR"/summary.txt"  
         echo "MACH='$MACH'" >> $CDIR"/summary.txt"  
         echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"  
         echo "DATE='$DATE'" >> $CDIR"/summary.txt"  
         echo "tdir='$dir'" >> $CDIR"/summary.txt"  
   
         (  
             cd $DRESULTS  
             tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1  
             gzip $NDIR".tar"  
         )  
736    
737          if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then  echo -n "Start time:  " >> $SUMMARY
738              echo "No mail sent"  echo $start_date >> $SUMMARY
739    echo -n "End time:    " >> $SUMMARY
740    date >> $SUMMARY
741    
742    #  If addresses were supplied and mpack built successfully, then try
743    #  to send email using mpack.
744    if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
745        echo "No results email was sent."
746    else
747        if test "x$HAVE_MPACK" = xt ; then
748            tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \
749                && gzip $DRESULTS".tar" \
750                && $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES
751            RETVAL=$?
752            if test "x$RETVAL" != x0 ; then
753                echo
754                echo "Warning: The tar, gzip, & mpack step failed.  Please send email"
755                echo "  to <MITgcm-support@mitgcm.org> for help.  You may copy the "
756                echo "  summary of results from the directory \"$DRESULTS\"."
757                echo
758          else          else
759              $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES              echo
760              RETVAL=$?              echo "An email containing results was sent to the following addresses:"
761              if test "x$RETVAL" != x0 ; then              echo "  \"$ADDRESSES\""
762                  echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"              echo
             else  
                 rm -f $DRESULTS"/"$NDIR".tar*"  
             fi  
763          fi          fi
764            test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"
765          NDIR=$(( $NDIR + 1 ))          test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"
766                fi
767      done  fi
 done  
768    
769  rm tmp_cmpnum.f a.out  rm tmp_cmpnum.f a.out
770    
771  cat $SUMMARY  if test "x$CLEANUP" != xt ; then
772        cat $SUMMARY
773        if test -e tr.out ; then
774            mv tr.out tr.out.old
775        fi
776        cat $SUMMARY > tr.out
777    fi
778    

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

  ViewVC Help
Powered by ViewVC 1.1.22