/[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.35 by edhill, Fri Mar 12 16:45:38 2004 UTC revision 1.45 by edhill, Sat Jul 17 02:08:45 2004 UTC
# Line 13  usage() Line 13  usage()
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"      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"
16      echo "                             (DEF=\"noieee\")"      echo "                             (DEF=\"-ieee\")"
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\")"
# Line 27  usage() Line 27  usage()
27      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
28      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-m|-make) STRING        command to use for \"make\""
29      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
30        echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
31      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
32      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
33      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
34      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
35      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
36        echo "  (-deldir|-dd)            on success, delete the output directory"
37      echo      echo
38      echo "and where STRING follows a whitespace-delimited format"      echo "and where STRING follows a whitespace-delimited format"
39      echo "such as:"      echo "such as:"
# Line 234  genmakemodel() Line 236  genmakemodel()
236              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
237              $command > make.log 2>&1              $command > make.log 2>&1
238              RETVAL=$?              RETVAL=$?
239              cp Makefile $CDIR              #  Reduce the size of the testing emails!
240                #  cp Makefile $CDIR
241              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
242                  tail make.log                  tail make.log
243                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed" 1>&2
# Line 306  makemodel() Line 309  makemodel()
309          if test -r Makefile ; then          if test -r Makefile ; then
310              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
311              if test "x$ADM" = x ; then              if test "x$ADM" = x ; then
312                  $MAKE >> make.log 2>&1                  if test "x$JOBS" = x ; then
313                        $MAKE >> make.log 2>&1
314                    else
315                        $MAKE -j $JOBS >> make.log 2>&1
316                    fi
317              else              else
318                  $MAKE adall >> make.log 2>&1                  $MAKE adall >> make.log 2>&1
319              fi              fi
# Line 333  symlink_mpifiles() Line 340  symlink_mpifiles()
340      code_dir=$2      code_dir=$2
341      BUILD_DIR=$dir/$3      BUILD_DIR=$dir/$3
342      CODE_DIR=$dir/$code_dir      CODE_DIR=$dir/$code_dir
343        
344      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
345      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`
346    
# Line 348  symlink_mpifiles() Line 355  symlink_mpifiles()
355              RETVAL=$?              RETVAL=$?
356              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
357                  if ! test -f $BUILD_DIR/$i ; then                  if ! test -f $BUILD_DIR/$i ; then
358                  #echo Linking $name to $i                      #echo Linking $name to $i
359                      (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)                      (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)
360                  fi                  fi
361              fi              fi
362          done          done
363      else      else
364      # NO: We undo any _mpi symbolically linked files          # NO: We undo any _mpi symbolically linked files
365          for ii in $MPI_FILES ; do          for ii in $MPI_FILES ; do
366              i=`echo $ii | sed 's:^\./::'`              i=`echo $ii | sed 's:^\./::'`
367              name=`echo $i | sed 's:_mpi::' `              name=`echo $i | sed 's:_mpi::' `
368              if test -L $BUILD_DIR/$name ; then              if test -L $BUILD_DIR/$name ; then
369                  linktarg=`(cd $BUILD_DIR; readlink $name)`                  cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1
370                  if test $linktarg = "../$code_dir/$name"_mpi ; then                  RETVAL=$?
371                  #echo Un-linking $name from $linktarg                  if test "x$RETVAL" = x0 ; then
372                        #echo Un-linking $name from $linktarg
373                      rm -f $BUILD_DIR/$name                      rm -f $BUILD_DIR/$name
374                  fi                  fi
375              fi              fi
# Line 413  runmodel() Line 421  runmodel()
421          cd $1          cd $1
422          printf 'runmodel ... ' 1>&2          printf 'runmodel ... ' 1>&2
423          # make output.txt          # make output.txt
424          $COMMAND >> run.log 2>&1          echo
425            # echo "COMMAND='$COMMAND'"
426            # echo "pwd='"`pwd`"'"
427            ( eval $COMMAND ) >> run.log 2>&1
428          RETVAL=$?          RETVAL=$?
429          if test "x$RETVAL" = x0 ; then          if test "x$RETVAL" = x0 ; then
430              echo successful 1>&2              echo successful 1>&2
431              if test "x$ADM" = x ; then              # === Reduce the size of the testing emails!
432                  cp output.txt $CDIR"/output.txt"              # if test "x$ADM" = x ; then
433              else              #   cp output.txt $CDIR"/output.txt"
434                  cp output.txt_adm $CDIR"/output.txt_adm"              # else
435              fi              #   cp output.txt_adm $CDIR"/output.txt_adm"
436                # fi
437              return 0              return 0
438          else          else
439              tail run.log              tail run.log
# Line 542  clean=0 Line 554  clean=0
554  expts=''  expts=''
555  # ieee=1  # ieee=1
556    
557  IEEE=  IEEE=true
558  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
559      IEEE=$MITGCM_IEEE      IEEE=$MITGCM_IEEE
560  fi  fi
# Line 563  HAVE_MPACK= Line 575  HAVE_MPACK=
575  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
576  COMMAND=  COMMAND=
577  MAKE=make  MAKE=make
578    JOBS=
579  MPI=f  MPI=f
580    DELDIR=
581    
582  ADM=  ADM=
583    
# Line 616  for ac_option ; do Line 630  for ac_option ; do
630          -make=* | --make=*)          -make=* | --make=*)
631              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
632    
633            -j) ac_prev=JOBS ;;
634            -j=*) JOBS=$ac_optarg ;;
635    
636          -clean | --clean)          -clean | --clean)
637              CLEANUP=t ;;              CLEANUP=t ;;
638    
# Line 639  for ac_option ; do Line 656  for ac_option ; do
656          -debug) debug=1 ;;          -debug) debug=1 ;;
657          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
658    
659            -deldir | -dd) DELDIR=t ;;
660    
661          -*)          -*)
662              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
663              usage              usage
# Line 672  if test "x$ADM" = xt -a "x$COMMAND" = x Line 691  if test "x$ADM" = xt -a "x$COMMAND" = x
691  fi  fi
692    
693  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
694      COMMAND="make output.txt"      COMMAND="$MAKE output.txt"
695  fi  fi
696    
697  echo "OK"  echo "OK"
# Line 861  for dir in $TESTDIRS ; do Line 880  for dir in $TESTDIRS ; do
880          OLD_COMMAND=$COMMAND          OLD_COMMAND=$COMMAND
881          COMMAND="./mitgcmuv > output.txt"          COMMAND="./mitgcmuv > output.txt"
882          for ex in $extra_runs ; do          for ex in $extra_runs ; do
883              test -e "$dir/tr_run" && rm -rf "$dir/tr_run"              test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex"
884              mkdir "$dir/tr_run"              mkdir "$dir/tr_run.$ex"
885              ( cd "$dir/input" ; links=`ls -1 | grep -v CVS` )              links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`
886              (              (
887                  cd "$dir/tr_run"                  cd "$dir/tr_run.$ex"
888                  for i in $links; do                  for i in $links; do
889                      ln -s ../input/$i $i                      ln -s ../input/$i $i
890                  done                  done
891              )              )
892              ( cd "$dir/input.$ex" ; links=`ls -1 | grep -v CVS` )              links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`
893              (              (
894                  cd "$dir/tr_run"                  cd "$dir/tr_run.$ex"
895                  for i in $links; do                  for i in $links; do
896                      test -e $i  &&  rm -f $i                      test -e $i  &&  rm -f $i
897                      ln -s ../input.$ex/$i $i                      ln -s ../input.$ex/$i $i
898                  done                  done
899                  ln -s ../$builddir/mitgcmuv mitgcmuv                  ln -s ../$builddir/mitgcmuv mitgcmuv
900              )              )
901              runmodel $dir/tr_run && run=Y \              runmodel $dir/tr_run.$ex && run=Y \
902                  && results=`testoutput $dir $rundir "."$ex`                  && results=`testoutput $dir tr_run.$ex "."$ex`
903              fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`              fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
904              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
905              fres="$fres.$ex"              fres="$fres.$ex"
# Line 922  else Line 941  else
941      if test "x$HAVE_MPACK" = xt ; then      if test "x$HAVE_MPACK" = xt ; then
942          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \
943              && gzip $DRESULTS".tar" \              && gzip $DRESULTS".tar" \
944              && $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES              && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES
945          RETVAL=$?          RETVAL=$?
946          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
947              echo              echo
# Line 952  if test "x$CLEANUP" != xt ; then Line 971  if test "x$CLEANUP" != xt ; then
971      cat $SUMMARY > tr_out.txt      cat $SUMMARY > tr_out.txt
972  fi  fi
973    
974    if test "x$DELDIR" = xt ; then
975        rm -rf $DRESULTS
976    fi
977    

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.45

  ViewVC Help
Powered by ViewVC 1.1.22