/[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.1 by edhill, Wed Aug 27 22:12:31 2003 UTC revision 1.6 by edhill, Wed Sep 10 02:30:37 2003 UTC
# Line 10  usage() Line 10  usage()
10      echo      echo
11      echo "where possible OPTIONS are:"      echo "where possible OPTIONS are:"
12      echo "  (-help|-h)               print usage"      echo "  (-help|-h)               print usage"
13      echo "  (-optfile=|-of=)STRING   list of genmake2 \"optfiles\""      echo "  (-optfile=|-of=)STRING   list of optfiles to use"
14      echo "  (-a|-addr)STRING         list of email recipients"      echo "  (-a|-addr)STRING         list of email recipients"
15      echo "  (-t|-tdir)STRING         list of \"test\" dirs"      echo "                             (DEF=\"edhill@mitgcm.org\")"
16        echo "  (-t|-tdir)STRING         list of test dirs to use"
17        echo "                             (DEF=\"\" which builds all)"
18        echo "  (-b|-bash)STRING         location of \"bash\" executable"
19        echo "                             (DEF=\"\" for \"/bin/bash\")"
20        echo "  (-c|-command)STRING      command to run"
21        echo "                             (DEF=\"make output.txt\")"
22        echo
23        echo "and where STRING follows a whitespace-delimited format"
24        echo "such as:"
25        echo "  -t 'exp0 exp2 exp3' "
26        echo "  -addr='abc@123.com testing@home.org'"
27      echo      echo
28      exit 1      exit 1
29  }  }
# Line 160  testoutput() Line 171  testoutput()
171  genmakemodel()  genmakemodel()
172  {  {
173      # genmakemodel directory      # genmakemodel directory
174      GENMAKE2="../../../tools/genmake2"      GENMAKE2="$BASH ../../../tools/genmake2"
175      (      (
176          cd $1;          cd $1;
177          printf 'genmake ... ' 1>&2          printf 'genmake ... ' 1>&2
# Line 188  makeclean() Line 199  makeclean()
199      # makeclean directory      # makeclean directory
200      (      (
201          cd $1;          cd $1;
202          rm -f output.txt          if test -e output.txt ; then
203                rm -f output.txt
204            fi
205          printf 'make CLEAN ... ' 2>&1          printf 'make CLEAN ... ' 2>&1
206          if test -r Makefile ; then          if test -r Makefile ; then
207              make CLEAN >> make.log 2>&1              make CLEAN >> make.log 2>&1
# Line 257  linkdata() Line 270  linkdata()
270    
271  runmodel()  runmodel()
272  {  {
273      # runmodel directory exe      # runmodel directory
274      #      #
275      #  runs the model "exe" in "directory" (exe is relative to directory)      #  runs "$COMMAND" in "directory"
276        #  (where "$COMMAND" is relative to "directory")
277      (      (
278          cd $1          cd $1
279          if [ -x $2 ]; then          printf 'runmodel: ' 1>&2
280              if [ $quick -eq 0 ]; then          # make output.txt
281                  rm -f output.txt          $COMMAND
282              fi          RETVAL=$?
283              printf 'runmodel: ' 1>&2          if test "x$RETVAL" = x0 ; then
284              make output.txt              cp output.txt $CDIR"/output.txt"
285              RETVAL=$?              return 0
286              if test "x$RETVAL" = x0 ; then          else
287                  cp output.txt $CDIR"/output.txt"              return 1
                 return 0  
             else  
                 return 1  
             fi  
288          fi          fi
289      )      )
290  }  }
# Line 315  EOFA Line 325  EOFA
325          return 0          return 0
326      else      else
327          echo          echo
328          echo "createcodelet: failed to compile codelet" | tee          echo "createcodelet: failed to compile codelet"
329          exit 1          exit 1
330      fi      fi
331  }  }
# Line 383  scandirs() Line 393  scandirs()
393  #  Default properties  #  Default properties
394  debug=0  debug=0
395  verbose=1  verbose=1
 quick=0  
396  clean=0  clean=0
 ieee=1  
397  expts=''  expts=''
398    # ieee=1
399    # quick=0
400    
401    BASH=
402  OPTFILES=  OPTFILES=
403  ADDRESSES=edhill@mitgcm.org  ADDRESSES=edhill@mitgcm.org
404  TESTDIRS=  TESTDIRS=
405  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
406  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
407    COMMAND="make output.txt"
408    
409  echo -n "parsing options...  "  echo -n "parsing options...  "
410    
# Line 413  for ac_option ; do Line 425  for ac_option ; do
425          -help | --help | -h | --h)          -help | --help | -h | --h)
426              usage ;;              usage ;;
427                    
428          -optfile | --optfile | -f | --f)          -optfile | --optfile | -of | --of)
429              ac_prev=OPTFILES ;;              ac_prev=OPTFILES ;;
430          -optfile=* | --optfile=*)          -optfile=* | --optfile=* | -of=* | --of=*)
431              OPTFILES=$ac_optarg ;;              OPTFILES=$ac_optarg ;;
432                    
433          -addr | --addr | -a | --a)          -addr | --addr | -a | --a)
# Line 428  for ac_option ; do Line 440  for ac_option ; do
440          -tdir=* | --tdir=*)          -tdir=* | --tdir=*)
441              TESTDIRS=$ac_optarg ;;              TESTDIRS=$ac_optarg ;;
442    
443          -quick) quick=1 ;;          -bash | --bash | -b | --b)
444                ac_prev=BASH ;;
445            -bash=* | --bash=*)
446                BASH=$ac_optarg ;;
447    
448            -command | --command | -c | --c)
449                ac_prev=COMMAND ;;
450            -command=* | --command=*)
451                COMMAND=$ac_optarg ;;
452    
453          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
454          -debug) debug=1 ;;          -debug) debug=1 ;;
455          -clean) clean=1 ;;          -clean) clean=1 ;;
         -noieee) ieee=0 ;;  
456          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
457    
458          -*)          -*)
# Line 463  build_mpack Line 483  build_mpack
483    
484  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
485  MACH=`hostname`  MACH=`hostname`
486    UNAMEA=`uname -a`
487  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
488  BASE=$MACH"_"$DATE"_"  BASE=$MACH"_"$DATE"_"
489  DNUM=0  DNUM=0
# Line 504  for OPTFILE in $OPTFILES ; do Line 525  for OPTFILE in $OPTFILES ; do
525            
526      #  ...and each test directory...      #  ...and each test directory...
527      for dir in $TESTDIRS ; do      for dir in $TESTDIRS ; do
528    
529            #  Verify that the testdir exists and contains previous
530            #  results in the correct location--or skip this directory!
531            if test ! -r $dir"/results/output.txt" ; then
532                echo | tee -a $SUMMARY
533                echo "can't read \"$dir/results/output.txt\" -- skipping $dir" \
534                    | tee -a $SUMMARY
535                continue
536            fi
537                    
538          #  Create an output dir for each OPTFILE/tdir combination          #  Create an output dir for each OPTFILE/tdir combination
539          CDIR=$DRESULTS"/"$NDIR          CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR
540          mkdir $CDIR          mkdir $CDIR
541          CDIR=`pwd`"/$CDIR"          CDIR=`pwd`"/$CDIR"
542    
# Line 528  for OPTFILE in $OPTFILES ; do Line 558  for OPTFILE in $OPTFILES ; do
558              builddir=input              builddir=input
559              rundir=input              rundir=input
560          fi          fi
561    
562          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
563              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
564              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
565              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
566              && linkdata $seperatebuilddir $dir/$rundir \              && linkdata $seperatebuilddir $dir/$rundir \
567              && runmodel $dir/$builddir mitgcmuv && run=Y \              && runmodel $dir/$builddir && run=Y \
568              && results=`testoutput $dir $rundir`              && results=`testoutput $dir $rundir`
569          echo          echo
570          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
571                ${run:-N} $results
572          echo          echo
573          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results >> $SUMMARY          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
574                ${run:-N} $results >> $SUMMARY
575          ( cd $DRESULTS"/"$NDIR ; gzip * )          echo "fresults='" > $CDIR"/summary.txt"
576            formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
577                ${run:-N} $results >> $CDIR"/summary.txt"
578            echo "'" >> $CDIR"/summary.txt"
579            echo "MACH='$MACH'" >> $CDIR"/summary.txt"
580            echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
581            echo "DATE='$DATE'" >> $CDIR"/summary.txt"
582            echo "tdir='$dir'" >> $CDIR"/summary.txt"
583    
584            (
585                cd $DRESULTS
586                tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1
587                gzip $NDIR".tar"
588            )
589    
590          tar -cf $DRESULTS"/"$NDIR".tar" $DRESULTS"/"$NDIR          $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES
591          $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar" $ADDRESSES          RETVAL=$?
592            if test "x$RETVAL" != x0 ; then
593                echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"
594            else
595                rm -f $DRESULTS"/"$NDIR".tar*"
596            fi
597    
598          NDIR=$(( $NDIR + 1 ))          NDIR=$(( $NDIR + 1 ))
599                    
600      done      done
601  done  done
602    
603  # rm tmp_cmpnum.f a.out  rm tmp_cmpnum.f a.out
604    
 echo -------------------------------------------------------------------------------  
 echo  
 echo >> $SUMMARY  
 date >> $SUMMARY  
605  cat $SUMMARY  cat $SUMMARY
606    
 # tar -cf $DRESULTS".tar" $DRESULTS  
 #  
 # $MPACK -s MITgcm-test -m 1000000 $DRESULTS".tar" $ADDRESSES  
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22