/[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.9.2.6 by edhill, Fri Oct 3 18:55:29 2003 UTC
# Line 185  genmakemodel() Line 185  genmakemodel()
185          (          (
186              cd $1;              cd $1;
187              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
188              # ../../../tools/genmake -ieee -mods=../code > make.log 2>&1              command="$GENMAKE2  -ds -m $MAKE --mods=../code"
189              $GENMAKE2  -ds -m $MAKE --mods=../code "--optfile="$OPTFILE > make.log 2>&1              if test "x$OPTFILE" != xNONE ; then
190                    command="$command --optfile=$OPTFILE"
191                    # echo "  command=\"$command\""
192                fi
193                $command > make.log 2>&1
194              RETVAL=$?              RETVAL=$?
195              for i in gm_state gm_optfile gm_local Makefile ; do              for i in gm_state gm_optfile gm_local Makefile ; do
196                  if test -r $i ; then                  if test -r $i ; then
# Line 423  NOCLEAN=f Line 427  NOCLEAN=f
427  NODEPEND=f  NODEPEND=f
428    
429  BASH=  BASH=
430  OPTFILES=  OPTFILE=NONE
431  ADDRESSES=  ADDRESSES=
432  TESTDIRS=  TESTDIRS=
433  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
# Line 452  for ac_option ; do Line 456  for ac_option ; do
456              usage ;;              usage ;;
457                    
458          -optfile | --optfile | -of | --of)          -optfile | --optfile | -of | --of)
459              ac_prev=OPTFILES ;;              ac_prev=OPTFILE ;;
460          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
461              OPTFILES=$ac_optarg ;;              OPTFILE=$ac_optarg ;;
462                    
463          -addr | --addr | -a | --a)          -addr | --addr | -a | --a)
464              ac_prev=ADDRESSES ;;              ac_prev=ADDRESSES ;;
# Line 523  if test "x$TESTDIRS" = x ; then Line 527  if test "x$TESTDIRS" = x ; then
527      TESTDIRS=`scandirs`      TESTDIRS=`scandirs`
528  fi  fi
529    
530  if test "x$OPTFILES" = x ; then  if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then
531      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  
532  fi  fi
533    
534  echo "OK"  echo "OK"
# Line 571  EOF Line 569  EOF
569    
570  NDIR=0  NDIR=0
571    
572  #  For each optfile...  if test "x$OPTFILE" != xNONE ; then
573  for OPTFILE in $OPTFILES ; do      if test -r $OPTFILE ; then
574            OPTFILE=`pwd`"/$OPTFILE"
     OPTFILE=`pwd`"/$OPTFILE"  
     if test ! -r $OPTFILE ; then  
         echo "Error: can't read optfile \"$OPTFILE\""  
         exit 1  
575      fi      fi
576      echo  fi
577      echo "OPTFILE=$OPTFILE" >> $SUMMARY  echo
578      echo >> $SUMMARY  echo "OPTFILE=$OPTFILE" >> $SUMMARY
579        echo >> $SUMMARY
     #  ...and each test directory...  
     for dir in $TESTDIRS ; do  
580    
581          #  Cleanup only!  #  ...and each test directory...
582          if test "x$CLEANUP" = xt ; then  for dir in $TESTDIRS ; do
583              if test -r $dir/build/Makefile ; then      
584                  ( cd $dir/build ; make CLEAN )      #  Cleanup only!
585              fi      if test "x$CLEANUP" = xt ; then
586              if test -r $dir/input/Makefile ; then          if test -r $dir/build/Makefile ; then
587                  ( cd $dir/input ; make CLEAN )              ( cd $dir/build ; make CLEAN )
             fi  
             continue  
588          fi          fi
589            if test -r $dir/input/Makefile ; then
590          #  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  
591          fi          fi
592            continue
593        fi
594    
595          echo "-------------------------------------------------------------------------------"      #  Verify that the testdir exists and contains previous
596        #  results in the correct location--or skip this directory!
597        if test ! -r $dir"/results/output.txt" ; then
598          echo          echo
599          echo "Experiment:  $dir"          echo "can't read \"$dir/results/output.txt\" -- skipping $dir"
600          echo          echo
601          unset genmake makedepend make run          continue
602          results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'      fi
603    
604          if [ -r $dir/build ]; then      echo "-------------------------------------------------------------------------------"
605              seperatebuilddir=1      echo
606              builddir=build      echo "Experiment:  $dir"
607              rundir=build      echo
608              ( cd $dir/build; ln -sf ../input/* . )      unset genmake makedepend make run
609          else      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
             seperatebuilddir=0  
             builddir=input  
             rundir=input  
         fi  
610    
611          CODE_DIR=$dir/code      if [ -r $dir/build ]; then
612          BUILD_DIR=$dir/$builddir          seperatebuilddir=1
613          MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"          builddir=build
614          NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"          rundir=build
615          #  Is this an MPI run?          ( cd $dir/build; ln -sf ../input/* . )
616          if test "x$MPI" = xt ; then      else
617              FILES=$MPI_FILES          seperatebuilddir=0
618          else          builddir=input
619              FILES=$NOMPI_FILES          rundir=input
620        fi
621        
622        CODE_DIR=$dir/code
623        BUILD_DIR=$dir/$builddir
624        MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"
625        NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"
626    
627        #  Is this an MPI run?
628        if test "x$MPI" = xt ; then
629            FILES=$MPI_FILES
630        else
631            FILES=$NOMPI_FILES
632        fi
633        
634        #  Check to see that we have the files
635        have_files=t
636        for i in $FILES ; do
637            if test ! -r $CODE_DIR/$i ; then
638                echo "Warning: can't read file $CODE_DIR/$i"
639                have_files=f
640          fi          fi
641        done
642          #  Check to see that we have the files      if test "x$have_files" != xt -a "x$MPI" = xt ; then
643          have_files=t          echo "Skipping $dir due to lack of input files (see above warning)"
644            continue
645        fi
646        
647        #  If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR
648        if test "x$have_files" = xt ; then
649          for i in $FILES ; do          for i in $FILES ; do
650              if test ! -r $CODE_DIR/$i ; then              cmp $CODE_DIR/$i $BUILD_DIR/$i > /dev/null 2>&1
                 echo "Warning: can't read file $CODE_DIR/$i" | tee -a $SUMMARY  
                 have_files=f  
             fi  
         done  
         if test "x$have_files" != xt -a "x$MPI" = xt ; then  
             echo "Skipping $dir due to lack of input files (see above warning)" \  
                 | tee -a $SUMMARY  
             continue  
         fi  
   
         #  If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR  
         if "x$have_files" = xt ; then  
             for i in $FILES ; do  
                 cmp $CODE_DIR/$i $BUILD_DIR/$i > /dev/null 2>&1  
                 RETVAL=$?  
                 if test "x$RETVAL" != x0 ; then  
                     cp $CODE_DIR/$i $BUILD_DIR/$i  
                 fi  
             done  
         fi  
   
         #  Create an output dir for each OPTFILE/tdir combination  
         CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR  
         mkdir $CDIR  
         CDIR=`pwd`"/$CDIR"  
   
         if test "x$CLEANUP" = xt ; then  
             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`  
         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"  
         )  
   
         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  
651              RETVAL=$?              RETVAL=$?
652              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
653                  echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"                  cp $CODE_DIR/$i $BUILD_DIR/$i
             else  
                 rm -f $DRESULTS"/"$NDIR".tar*"  
654              fi              fi
655            done
656        fi
657        
658        #  Create an output dir for each OPTFILE/tdir combination
659        CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR
660        mkdir $CDIR
661        CDIR=`pwd`"/$CDIR"
662        
663        if test "x$CLEANUP" = xt ; then
664            makeclean $dir/$builddir
665        else
666            genmakemodel $dir/$builddir && genmake=Y \
667                && makeclean $dir/$builddir \
668                && makedependmodel $dir/$builddir && makedepend=Y \
669                && makemodel $dir/$builddir && make=Y \
670                && linkdata $seperatebuilddir $dir/$rundir \
671                && runmodel $dir/$builddir && run=Y \
672                && results=`testoutput $dir $rundir`
673        fi
674        
675        echo
676        formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
677            ${run:-N} $results
678        echo
679        formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
680            ${run:-N} $results >> $SUMMARY
681        echo "fresults='" > $CDIR"/summary.txt"
682        formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
683            ${run:-N} $results >> $CDIR"/summary.txt"
684        echo "'" >> $CDIR"/summary.txt"
685        echo "MACH='$MACH'" >> $CDIR"/summary.txt"
686        echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
687        echo "DATE='$DATE'" >> $CDIR"/summary.txt"
688        echo "tdir='$dir'" >> $CDIR"/summary.txt"
689        
690        (
691            cd $DRESULTS
692            tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1
693            gzip $NDIR".tar"
694        )
695        
696        if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
697            echo "No mail sent"
698        else
699            $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES
700            RETVAL=$?
701            if test "x$RETVAL" != x0 ; then
702                echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"
703            else
704                rm -f $DRESULTS"/"$NDIR".tar*"
705          fi          fi
706        fi
707          NDIR=$(( $NDIR + 1 ))      
708                NDIR=$(( $NDIR + 1 ))
709      done      
710  done  done
711    
712  rm tmp_cmpnum.f a.out  rm tmp_cmpnum.f a.out

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

  ViewVC Help
Powered by ViewVC 1.1.22