/[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.3 by edhill, Fri Oct 3 04:15:34 2003 UTC revision 1.20 by edhill, Wed Nov 26 15:04:42 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                    # echo "  command=\"$command\""
202                fi
203                if test "x$IEEE" != x ; then
204                    command="$command -ieee"
205                fi
206                # echo "command: \"$command\""
207              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
208              # ../../../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  
209              RETVAL=$?              RETVAL=$?
210              for i in gm_state gm_optfile gm_local Makefile ; do              for i in genmake_state genmake_optfile genmake_local Makefile ; do
211                  if test -r $i ; then                  if test -r $i ; then
212                      cp $i $CDIR                      cp $i $CDIR
213                  fi                  fi
# Line 199  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 227  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 250  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 271  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 282  linkdata() Line 301  linkdata()
301      # linkdata flag      # linkdata flag
302      #      #
303      # symbolically link data files to run directory      # symbolically link data files to run directory
304      if [ $1 -ne 0 ]; then      if test "x$1" = x1 ; then
305          ( cd $2 ;  ln -sf ../input/* . )          (
306                cd $2
307                files=`( cd ../input ; ls -1 | grep -v CVS )`
308                for i in $files ; do
309                    if test ! -d "../input/"$i ; then
310                        ln -sf "../input/"$i $i
311                    fi
312                done
313            )
314      fi      fi
315  }  }
316    
# Line 295  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 383  $0 [-help] [-quick] [-verbose] dir1 [dir Line 414  $0 [-help] [-quick] [-verbose] dir1 [dir
414   -debug     Produce even more output which will mean nothing to most   -debug     Produce even more output which will mean nothing to most
415   -force     Do "make CLEAN" before compiling. This forces a complete rebuild.   -force     Do "make CLEAN" before compiling. This forces a complete rebuild.
416   -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.  
417   -cleanup   Aggresively removes all model output, executables and object files   -cleanup   Aggresively removes all model output, executables and object files
418              and then exits. Use with care.              and then exits. Use with care.
419    
# Line 416  clean=0 Line 446  clean=0
446  expts=''  expts=''
447  # ieee=1  # ieee=1
448    
449    IEEE=
450    if test "x$MITGCM_IEEE" != x ; then
451        IEEE=$MITGCM_IEEE
452    fi
453    
454    
455  CLEANUP=f  CLEANUP=f
456  QUICK=f  QUICK=f
457  NOGENMAKE=f  NOGENMAKE=f
# Line 423  NOCLEAN=f Line 459  NOCLEAN=f
459  NODEPEND=f  NODEPEND=f
460    
461  BASH=  BASH=
462  OPTFILES=  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 452  for ac_option ; do Line 489  for ac_option ; do
489              usage ;;              usage ;;
490                    
491          -optfile | --optfile | -of | --of)          -optfile | --optfile | -of | --of)
492              ac_prev=OPTFILES ;;              ac_prev=OPTFILE ;;
493          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
494              OPTFILES=$ac_optarg ;;              OPTFILE=$ac_optarg ;;
495                    
496          -addr | --addr | -a | --a)          -addr | --addr | -a | --a)
497              ac_prev=ADDRESSES ;;              ac_prev=ADDRESSES ;;
# Line 494  for ac_option ; do Line 531  for ac_option ; do
531              NODEPEND=t ;;              NODEPEND=t ;;
532    
533          -mpi) MPI=t ;;          -mpi) MPI=t ;;
534    
535            -ieee) IEEE=true ;;
536            -noieee) IEEE= ;;
537    
538          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
539          -debug) debug=1 ;;          -debug) debug=1 ;;
         -clean) clean=1 ;;  
540          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
541    
542          -*)          -*)
# Line 523  if test "x$TESTDIRS" = x ; then Line 563  if test "x$TESTDIRS" = x ; then
563      TESTDIRS=`scandirs`      TESTDIRS=`scandirs`
564  fi  fi
565    
566  if test "x$OPTFILES" = x ; then  if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then
567      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  
568  fi  fi
569    
570  echo "OK"  echo "OK"
# Line 555  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  date > $SUMMARY  echo -n "Start time:  " >> $SUMMARY
597  cat << EOF >> $SUMMARY  start_date=`date`
598    echo $start_date > $SUMMARY
599    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 571  EOF Line 607  EOF
607    
608  NDIR=0  NDIR=0
609    
610  #  For each optfile...  of_path=
611  for OPTFILE in $OPTFILES ; do  if test "x$OPTFILE" != xNONE ; then
612        if test -r $OPTFILE ; then
613      OPTFILE=`pwd`"/$OPTFILE"          # get the path
614      if test ! -r $OPTFILE ; then          path=${OPTFILE%/*}
615          echo "Error: can't read optfile \"$OPTFILE\""          if test "x$path" = x ; then
616          exit 1              of_path=`pwd`
     fi  
     echo  
     echo "OPTFILE=$OPTFILE" >> $SUMMARY  
     echo >> $SUMMARY  
       
     #  ...and each test directory...  
     for dir in $TESTDIRS ; do  
   
         #  Cleanup only!  
         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  
         fi  
   
         #  Verify that the testdir exists and contains previous  
         #  results in the correct location--or skip this directory!  
         if test ! -r $dir"/results/output.txt" ; then  
             echo | tee -a $SUMMARY  
             echo "can't read \"$dir/results/output.txt\" -- skipping $dir" \  
                 | tee -a $SUMMARY  
             continue  
         fi  
   
         #  Is this an MPI run?  
         if test "x$MPI" = xt ; then  
             if test ! -r $dir"/code/CPP_EEOPTIONS.h_mpi" -o ! -r $dir"/code/SIZE.h_mpi" ; then  
                 echo | tee -a $SUMMARY  
                 echo "can't read \"$dir/code/CPP_EEOPTIONS.h_mpi\" or \"$dir/code/SIZE.h_mpi\"" \  
                     | tee -a $SUMMARY  
                 continue  
             else  
                 cmp $dir"/code/CPP_EEOPTIONS.h_mpi" $dir"/code/CPP_EEOPTIONS.h"  
                 RETVAL=$?  
                 if test "x$RETVAL" != x0 ; then  
                     cp $dir"/code/CPP_EEOPTIONS.h_mpi" $dir"/code/CPP_EEOPTIONS.h"  
                 fi  
                 cmp $dir"/code/SIZE.h_mpi" $dir"/code/SIZE.h"  
                 RETVAL=$?  
                 if test "x$RETVAL" != x0 ; then  
                     cp $dir"/code/SIZE.h_mpi" $dir"/code/SIZE.h"  
                 fi  
             fi  
617          else          else
618              if test -r $dir"/code/CPP_EEOPTIONS.h_nompi" ; then              of_path=`( cd $path > /dev/null 2>&1 ; pwd )`
                 cmp $dir"/code/CPP_EEOPTIONS.h_nompi" $dir"/code/CPP_EEOPTIONS.h"  
                 RETVAL=$?  
                 if test "x$RETVAL" != x0 ; then  
                     cp $dir"/code/CPP_EEOPTIONS.h_nompi" $dir"/code/CPP_EEOPTIONS.h"  
                 fi  
             fi  
             if test -r $dir"/code/SIZE.h_nompi" ; then  
                 cmp $dir"/code/SIZE.h_nompi" $dir"/code/SIZE.h"  
                 RETVAL=$?  
                 if test "x$RETVAL" != x0 ; then  
                     cp $dir"/code/SIZE.h_nompi" $dir"/code/SIZE.h"  
                 fi  
             fi  
619          fi          fi
620            file=${OPTFILE##*/}
621          #  Create an output dir for each OPTFILE/tdir combination          OPTFILE=$of_path/$file
622          CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR      else
         mkdir $CDIR  
         CDIR=`pwd`"/$CDIR"  
   
         #  ...configue, make, run, and compare the output.  
         echo "-------------------------------------------------------------------------------"  
         echo  
         echo "Experiment:  $dir"  
623          echo          echo
624          unset genmake makedepend make run          echo "WARNING: can't read OPTFILE=\"$OPTFILE\" but will try to use it..."
625          results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'      fi
626    fi
627    echo
628    echo "OPTFILE=$OPTFILE" >> $SUMMARY
629    echo >> $SUMMARY
630    
631          if [ -r $dir/build ]; then  #  ...and each test directory...
632              seperatebuilddir=1  for dir in $TESTDIRS ; do
633              builddir=build      
634              rundir=build      #  Cleanup only!
635              ( cd $dir/build; ln -sf ../input/* . )      if test "x$CLEANUP" = xt ; then
636          else          if test -r $dir/build/Makefile ; then
637              seperatebuilddir=0              ( cd $dir/build ; make CLEAN )
             builddir=input  
             rundir=input  
638          fi          fi
639            if test -r $dir/input/Makefile ; then
640          if test "x$CLEANUP" = xt ; then              ( cd $dir/input ; make CLEAN )
             makeclean $dir/$builddir  
         else  
             genmakemodel $dir/$builddir && genmake=Y \  
                 && makeclean $dir/$builddir \  
                 && makedependmodel $dir/$builddir && makedepend=Y \  
                 && makemodel $dir/$builddir && make=Y \  
                 && linkdata $seperatebuilddir $dir/$rundir \  
                 && runmodel $dir/$builddir && run=Y \  
                 && results=`testoutput $dir $rundir`  
641          fi          fi
642            continue
643        fi
644    
645          echo      #  Verify that the testdir exists and contains previous
646          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \      #  results in the correct location--or skip this directory!
647              ${run:-N} $results      if test ! -r $dir"/results/output.txt" ; then
648          echo          echo "can't read \"$dir/results/output.txt\" -- skipping $dir"
649          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \          continue
650              ${run:-N} $results >> $SUMMARY      fi
         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"  
651    
652          (      echo "-------------------------------------------------------------------------------"
653              cd $DRESULTS      echo
654              tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1      echo "Experiment:  $dir"
655              gzip $NDIR".tar"      echo
656          )      unset genmake makedepend make run
657        results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
658    
659          if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then      builddir="input"
660              echo "No mail sent"      rundir="input"
661          else      use_seperate_build=0
662              $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES      if test -d $dir/build -a -r $dir/build ; then
663            builddir="build"
664            rundir="build"
665            use_seperate_build=1
666            linkdata $use_seperate_build $dir/$rundir
667        fi
668        
669        CODE_DIR=$dir/code
670        BUILD_DIR=$dir/$builddir
671        MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"
672        NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"
673    
674        #  Is this an MPI run?
675        if test "x$MPI" = xt ; then
676            FILES=$MPI_FILES
677            endings="_mpi"
678        else
679            FILES=$NOMPI_FILES
680            endings="_nompi"
681        fi
682        
683        #  Check to see that we have the files
684        have_files=t
685        for i in $FILES ; do
686            if test ! -r $CODE_DIR/$i ; then
687                echo "Warning: can't read file $CODE_DIR/$i"
688                have_files=f
689            fi
690        done
691        if test "x$have_files" != xt -a "x$MPI" = xt ; then
692            echo "Skipping $dir due to lack of input files (see above warning)"
693            continue
694        fi
695        
696        #  If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR
697        if test "x$have_files" = xt ; then
698            for i in $FILES ; do
699                sstr="s|$endings||"
700                name=`echo $i | sed -e $sstr `
701                cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1
702              RETVAL=$?              RETVAL=$?
703              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
704                  echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"                  cp $CODE_DIR/$i $BUILD_DIR/$name
             else  
                 rm -f $DRESULTS"/"$NDIR".tar*"  
705              fi              fi
706          fi          done
707        fi
708          NDIR=$(( $NDIR + 1 ))      
709                #  Create an output dir for each OPTFILE/tdir combination
710      done      rel_CDIR=$DRESULTS"/"$dir
711        mkdir $rel_CDIR
712        CDIR=`pwd`"/$rel_CDIR"
713        
714        if test "x$CLEANUP" = xt ; then
715            makeclean $dir/$builddir
716        else
717            genmakemodel $dir/$builddir && genmake=Y \
718                && makeclean $dir/$builddir \
719                && makedependmodel $dir/$builddir && makedepend=Y \
720                && makemodel $dir/$builddir && make=Y \
721                && linkdata $use_seperate_build $dir/$rundir \
722                && runmodel $dir/$rundir && run=Y \
723                && results=`testoutput $dir $rundir`
724        fi
725        
726        echo
727        formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
728            ${run:-N} $results
729        echo
730        formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
731            ${run:-N} $results >> $SUMMARY
732        echo "fresults='" > $CDIR"/summary.txt"
733        formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
734            ${run:-N} $results >> $CDIR"/summary.txt"
735        echo "'" >> $CDIR"/summary.txt"
736        echo "MACH='$MACH'" >> $CDIR"/summary.txt"
737        echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
738        echo "DATE='$DATE'" >> $CDIR"/summary.txt"
739        echo "tdir='$dir'" >> $CDIR"/summary.txt"
740        
741        echo "-------------------------------------------------------------------------------"
742        
743        NDIR=$(( $NDIR + 1 ))
744        
745  done  done
746    
747    echo -n "Start time:  " >> $SUMMARY
748    echo $start_date >> $SUMMARY
749    echo -n "End time:    " >> $SUMMARY
750    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  cat $SUMMARY  if test "x$CLEANUP" != xt ; then
782        cat $SUMMARY
783        if test -e tr.out ; then
784            mv tr.out tr.out.old
785        fi
786        cat $SUMMARY > tr.out
787    fi
788    

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

  ViewVC Help
Powered by ViewVC 1.1.22