/[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.7 by edhill, Wed Sep 10 04:02:39 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 "  (-mpi)                   use MPI input files"
14        echo "  (-optfile=|-of=)STRING   list of optfiles to use"
15      echo "  (-a|-addr)STRING         list of email recipients"      echo "  (-a|-addr)STRING         list of email recipients"
16      echo "  (-t|-tdir)STRING         list of \"test\" dirs"      echo "                             (DEF=\"edhill@mitgcm.org\")"
17        echo "  (-t|-tdir)STRING         list of test dirs to use"
18        echo "                             (DEF=\"\" which builds all)"
19        echo "  (-b|-bash)STRING         location of \"bash\" executable"
20        echo "                             (DEF=\"\" for \"/bin/bash\")"
21        echo "  (-c|-command)STRING      command to run"
22        echo "                             (DEF=\"make output.txt\")"
23        echo
24        echo "and where STRING follows a whitespace-delimited format"
25        echo "such as:"
26        echo "  -t 'exp0 exp2 exp3' "
27        echo "  -addr='abc@123.com testing@home.org'"
28      echo      echo
29      exit 1      exit 1
30  }  }
# Line 160  testoutput() Line 172  testoutput()
172  genmakemodel()  genmakemodel()
173  {  {
174      # genmakemodel directory      # genmakemodel directory
175      GENMAKE2="../../../tools/genmake2"      GENMAKE2="$BASH ../../../tools/genmake2"
176      (      (
177          cd $1;          cd $1;
178          printf 'genmake ... ' 1>&2          printf 'genmake ... ' 1>&2
# Line 188  makeclean() Line 200  makeclean()
200      # makeclean directory      # makeclean directory
201      (      (
202          cd $1;          cd $1;
203          rm -f output.txt          if test -e output.txt ; then
204                rm -f output.txt
205            fi
206          printf 'make CLEAN ... ' 2>&1          printf 'make CLEAN ... ' 2>&1
207          if test -r Makefile ; then          if test -r Makefile ; then
208              make CLEAN >> make.log 2>&1              make CLEAN >> make.log 2>&1
# Line 257  linkdata() Line 271  linkdata()
271    
272  runmodel()  runmodel()
273  {  {
274      # runmodel directory exe      # runmodel directory
275      #      #
276      #  runs the model "exe" in "directory" (exe is relative to directory)      #  runs "$COMMAND" in "directory"
277        #  (where "$COMMAND" is relative to "directory")
278      (      (
279          cd $1          cd $1
280          if [ -x $2 ]; then          printf 'runmodel: ' 1>&2
281              if [ $quick -eq 0 ]; then          # make output.txt
282                  rm -f output.txt          $COMMAND
283              fi          RETVAL=$?
284              printf 'runmodel: ' 1>&2          if test "x$RETVAL" = x0 ; then
285              make output.txt              cp output.txt $CDIR"/output.txt"
286              RETVAL=$?              return 0
287              if test "x$RETVAL" = x0 ; then          else
288                  cp output.txt $CDIR"/output.txt"              return 1
                 return 0  
             else  
                 return 1  
             fi  
289          fi          fi
290      )      )
291  }  }
# Line 315  EOFA Line 326  EOFA
326          return 0          return 0
327      else      else
328          echo          echo
329          echo "createcodelet: failed to compile codelet" | tee          echo "createcodelet: failed to compile codelet"
330          exit 1          exit 1
331      fi      fi
332  }  }
# Line 383  scandirs() Line 394  scandirs()
394  #  Default properties  #  Default properties
395  debug=0  debug=0
396  verbose=1  verbose=1
 quick=0  
397  clean=0  clean=0
 ieee=1  
398  expts=''  expts=''
399    # ieee=1
400    # quick=0
401    
402    BASH=
403  OPTFILES=  OPTFILES=
404  ADDRESSES=edhill@mitgcm.org  ADDRESSES=edhill@mitgcm.org
405  TESTDIRS=  TESTDIRS=
406  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
407  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
408    COMMAND="make output.txt"
409    MPI=f
410    
411  echo -n "parsing options...  "  echo -n "parsing options...  "
412    
# Line 413  for ac_option ; do Line 427  for ac_option ; do
427          -help | --help | -h | --h)          -help | --help | -h | --h)
428              usage ;;              usage ;;
429                    
430          -optfile | --optfile | -f | --f)          -optfile | --optfile | -of | --of)
431              ac_prev=OPTFILES ;;              ac_prev=OPTFILES ;;
432          -optfile=* | --optfile=*)          -optfile=* | --optfile=* | -of=* | --of=*)
433              OPTFILES=$ac_optarg ;;              OPTFILES=$ac_optarg ;;
434                    
435          -addr | --addr | -a | --a)          -addr | --addr | -a | --a)
# Line 428  for ac_option ; do Line 442  for ac_option ; do
442          -tdir=* | --tdir=*)          -tdir=* | --tdir=*)
443              TESTDIRS=$ac_optarg ;;              TESTDIRS=$ac_optarg ;;
444    
445          -quick) quick=1 ;;          -bash | --bash | -b | --b)
446                ac_prev=BASH ;;
447            -bash=* | --bash=*)
448                BASH=$ac_optarg ;;
449    
450            -command | --command | -c | --c)
451                ac_prev=COMMAND ;;
452            -command=* | --command=*)
453                COMMAND=$ac_optarg ;;
454    
455            -mpi) MPI=t ;;
456          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
457          -debug) debug=1 ;;          -debug) debug=1 ;;
458          -clean) clean=1 ;;          -clean) clean=1 ;;
         -noieee) ieee=0 ;;  
459          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
460    
461          -*)          -*)
# Line 463  build_mpack Line 486  build_mpack
486    
487  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
488  MACH=`hostname`  MACH=`hostname`
489    UNAMEA=`uname -a`
490  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
491  BASE=$MACH"_"$DATE"_"  BASE=$MACH"_"$DATE"_"
492  DNUM=0  DNUM=0
# Line 504  for OPTFILE in $OPTFILES ; do Line 528  for OPTFILE in $OPTFILES ; do
528            
529      #  ...and each test directory...      #  ...and each test directory...
530      for dir in $TESTDIRS ; do      for dir in $TESTDIRS ; do
531            
532            #  Verify that the testdir exists and contains previous
533            #  results in the correct location--or skip this directory!
534            if test ! -r $dir"/results/output.txt" ; then
535                echo | tee -a $SUMMARY
536                echo "can't read \"$dir/results/output.txt\" -- skipping $dir" \
537                    | tee -a $SUMMARY
538                continue
539            fi
540    
541            #  Is this an MPI run?
542            if test "x$MPI" = xt ; then
543                if test ! -r $dir"/code/CPP_EEOPTIONS.h_mpi" -o ! -r $dir"/code/SIZE.h_mpi" ; then
544                    echo | tee -a $SUMMARY
545                    echo "can't read \"$dir/code/CPP_EEOPTIONS.h_mpi\" or \"$dir/code/SIZE.h_mpi\"" \
546                        | tee -a $SUMMARY
547                    continue
548                else
549                    cp $dir"/code/CPP_EEOPTIONS.h_mpi" $dir"/code/CPP_EEOPTIONS.h"
550                    cp $dir"/code/SIZE.h_mpi" $dir"/code/SIZE.h"
551                fi
552            else
553                if test -r $dir"/code/CPP_EEOPTIONS.h_nompi" ; then
554                    cp $dir"/code/CPP_EEOPTIONS.h_nompi" $dir"/code/CPP_EEOPTIONS.h"
555                fi
556                if test -r $dir"/code/SIZE.h_nompi" ; then
557                    cp $dir"/code/SIZE.h_nompi" $dir"/code/SIZE.h"
558                fi
559            fi
560    
561          #  Create an output dir for each OPTFILE/tdir combination          #  Create an output dir for each OPTFILE/tdir combination
562          CDIR=$DRESULTS"/"$NDIR          CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR
563          mkdir $CDIR          mkdir $CDIR
564          CDIR=`pwd`"/$CDIR"          CDIR=`pwd`"/$CDIR"
565    
# Line 528  for OPTFILE in $OPTFILES ; do Line 581  for OPTFILE in $OPTFILES ; do
581              builddir=input              builddir=input
582              rundir=input              rundir=input
583          fi          fi
584    
585          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
586              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
587              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
588              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
589              && linkdata $seperatebuilddir $dir/$rundir \              && linkdata $seperatebuilddir $dir/$rundir \
590              && runmodel $dir/$builddir mitgcmuv && run=Y \              && runmodel $dir/$builddir && run=Y \
591              && results=`testoutput $dir $rundir`              && results=`testoutput $dir $rundir`
592          echo          echo
593          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
594                ${run:-N} $results
595          echo          echo
596          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results >> $SUMMARY          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
597                ${run:-N} $results >> $SUMMARY
598            echo "fresults='" > $CDIR"/summary.txt"
599            formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
600                ${run:-N} $results >> $CDIR"/summary.txt"
601            echo "'" >> $CDIR"/summary.txt"
602            echo "MACH='$MACH'" >> $CDIR"/summary.txt"
603            echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
604            echo "DATE='$DATE'" >> $CDIR"/summary.txt"
605            echo "tdir='$dir'" >> $CDIR"/summary.txt"
606    
607            (
608                cd $DRESULTS
609                tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1
610                gzip $NDIR".tar"
611            )
612    
613          ( cd $DRESULTS"/"$NDIR ; gzip * )          $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES
614            RETVAL=$?
615          tar -cf $DRESULTS"/"$NDIR".tar" $DRESULTS"/"$NDIR          if test "x$RETVAL" != x0 ; then
616          $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar" $ADDRESSES              echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"
617            else
618                rm -f $DRESULTS"/"$NDIR".tar*"
619            fi
620    
621          NDIR=$(( $NDIR + 1 ))          NDIR=$(( $NDIR + 1 ))
622                    
623      done      done
624  done  done
625    
626  # rm tmp_cmpnum.f a.out  rm tmp_cmpnum.f a.out
627    
 echo -------------------------------------------------------------------------------  
 echo  
 echo >> $SUMMARY  
 date >> $SUMMARY  
628  cat $SUMMARY  cat $SUMMARY
629    
 # 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.7

  ViewVC Help
Powered by ViewVC 1.1.22