/[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.146 by jmc, Tue Nov 2 22:53:11 2010 UTC revision 1.156 by jmc, Thu Jan 20 21:55:52 2011 UTC
# Line 12  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 "  (-mth)                   run multi-threaded (using eedata.mth)"      echo "  (-mth)                   run multi-threaded (using eedata.mth)"
15      echo "  (-mpi)                   compile and run using MPI"      echo "  (-mpi)                   use MPI to compile and run on 2 processors"
16        echo "  (-MPI)  NUMBER           use MPI to compile and run on max NUMBER procs"
17        echo "  (-mfile|-mf) STRING      MPI: file with list of possible machines to run on"
18      echo "  (-ieee/-noieee)          if possible, use IEEE compiler flags"      echo "  (-ieee/-noieee)          if possible, use IEEE compiler flags"
19      echo "                             (DEF=\"-ieee\")"      echo "                             (DEF=\"-ieee\")"
20      echo "  (-gsl)                   compile with \"-gsl\" flag"      echo "  (-gsl)                   compile with \"-gsl\" flag"
# Line 25  usage() Line 27  usage()
27      echo "  (-tdir|-t) STRING        list of group and/or exp. dirs to test"      echo "  (-tdir|-t) STRING        list of group and/or exp. dirs to test"
28      echo "                             (recognized groups: basic, tutorials)"      echo "                             (recognized groups: basic, tutorials)"
29      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
30        echo "                             (if list= 'start_from THIS_EXP' then"
31        echo "                              test THIS_EXP + all the following)"
32      echo "  (-skipdir|-skd) STRING   list of exp. dirs to skip"      echo "  (-skipdir|-skd) STRING   list of exp. dirs to skip"
33      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
34      echo "  (-bash|-b) STRING        preferred location of a \"bash\" or"      echo "  (-bash|-b) STRING        preferred location of a \"bash\" or"
# Line 38  usage() Line 42  usage()
42      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
43      echo "  (-odir) STRING           used to build output directory name"      echo "  (-odir) STRING           used to build output directory name"
44      echo "                             (DEF=\"hostname\")"      echo "                             (DEF=\"hostname\")"
45      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"  #   echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
46      echo "                             (DEF=\"1 2 3 4 5\")"  #   echo "                             (DEF=\"1 2 3 4 5\")"
47      echo "  (-match) NUMBER          Matching Criteria (number of digits)"      echo "  (-match) NUMBER          Matching Criteria (number of digits)"
48      echo "                             (DEF=\"$MATCH_CRIT\")"      echo "                             (DEF=\"$MATCH_CRIT\")"
49      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
50      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\" & clean run-dir"
51      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"
52      echo "  (-runonly|-ro)           *ONLY* run stage (=\"-quick\" without make)"      echo "  (-runonly|-ro)           *ONLY* run stage (=\"-quick\" without make)"
53      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
54      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
55      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
56      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
57        echo "  (-postclean|-pc)         after each exp. test, clean build-dir & run-dir"
58        echo "  (-deloutp|-do)           delete output files after successful run"
59      echo "  (-deldir|-dd)            on success, delete the output directory"      echo "  (-deldir|-dd)            on success, delete the output directory"
60      echo "  (-ts)                    provide timing information per timestep"      echo "  (-ts)                    provide timing information per timestep"
61      echo "  (-papis)                 provide MFlop/s per timestep using PAPI"      echo "  (-papis)                 provide MFlop/s per timestep using PAPI"
# Line 232  testoutput_run() Line 238  testoutput_run()
238            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`
239          fi          fi
240          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi
241          echo "listVar='$listVar'" > $locDIR"/summary.txt"          #- report to this experiment local summary file ---
242            echo "MACH='$MACH'" > $locDIR"/summary.txt"
243            echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"
244            echo "DATE='$DATE'" >> $locDIR"/summary.txt"
245            grep '(PID\.TID 0000\.0001)      n.. =' $1/$2/$OUTPUTFILE \
246             | sed 's/(PID.TID 0000.0001)     //' >> $locDIR"/summary.txt"
247            echo "listVar='$listVar'" >> $locDIR"/summary.txt"
248            #---
249          allargs=""          allargs=""
250          for xx in $listVar          for xx in $listVar
251          do          do
# Line 337  genmakemodel() Line 350  genmakemodel()
350              if test "x$GSL" = xt ; then              if test "x$GSL" = xt ; then
351                  command="$command -gsl"                  command="$command -gsl"
352              fi              fi
353              if test "x$MPI" = xt ; then              if test "x$MPI" != x0 ; then
354                  command="$command -mpi"                  command="$command -mpi"
355              fi              fi
356              if test "x$MULTI_THREAD" = xt ; then              if test "x$MULTI_THREAD" = xt ; then
# Line 365  genmakemodel() Line 378  genmakemodel()
378              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
379                  tail genmake.tr_log                  tail genmake.tr_log
380                  echo "genmakemodel: genmake failed"                  echo "genmakemodel: genmake failed"
381                  cp genmake_* genmake.tr_log $CDIR                  cp genmake.log genmake_* genmake.tr_log $CDIR
382                  return 1                  return 1
383              else              else
384                  echo "successful"                  echo "successful"
# Line 386  makeclean() Line 399  makeclean()
399              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi
400              if test -r Makefile ; then              if test -r Makefile ; then
401                  printf 'clean build-dir: make Clean ... '                  printf 'clean build-dir: make Clean ... '
                 rm -f Makefile.old  
402                  $MAKE Clean >> make.tr_log 2>&1                  $MAKE Clean >> make.tr_log 2>&1
403                  RETVAL=$?                  RETVAL=$?
404                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
405                      tail make.tr_log                      tail make.tr_log
406                      echo "makeclean: \"make Clean\" failed"                      echo "makeclean: \"make Clean\" failed"
407                      cp make.tr_log $CDIR"/make.tr_log"                      cp make.tr_log genmake.log genmake.tr_log $CDIR
408                      return 1                      return 1
409                  fi                  fi
410                  echo successful                  echo successful
# Line 441  makedependmodel() Line 453  makedependmodel()
453              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
454                  tail make.tr_log                  tail make.tr_log
455                  echo "makedependmodel: make depend failed"                  echo "makedependmodel: make depend failed"
456                  cp make.tr_log $CDIR"/make.tr_log"                  cp make.tr_log genmake.log genmake.tr_log $CDIR
457                  return 1                  return 1
458              else              else
459                  echo successful                  echo successful
# Line 481  makemodel() Line 493  makemodel()
493              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
494                  tail make.tr_log                  tail make.tr_log
495                  echo failed                  echo failed
496                  cp make.tr_log $CDIR"/make.tr_log"                  cp make.tr_log genmake.log genmake.tr_log $CDIR
497                  rm -f $EXECUTABLE                  rm -f $EXECUTABLE
498                  return 1                  return 1
499              else              else
# Line 492  makemodel() Line 504  makemodel()
504      )      )
505  }  }
506    
507    mk_mpi_size()
508    {
509        # mk_mpi_size input_file output_file proc_Nb
510        #
511        # make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file)
512        #     for an MPI build with no more than proc_Nb processors ;
513        # return the effective number of processors.
514    
515        inp=$1
516        out=$2
517        np=$3
518        tmp=TTT.$$
519    
520        px=`grep "^     & *nPx *=" $inp | sed "s/^     & *nPx *= *//" | sed 's/, *$//'`
521        py=`grep "^     & *nPy *=" $inp | sed "s/^     & *nPy *= *//" | sed 's/, *$//'`
522        sx=`grep "^     & *nSx *=" $inp | sed "s/^     & *nSx *= *//" | sed 's/, *$//'`
523        sy=`grep "^     & *nSy *=" $inp | sed "s/^     & *nSy *= *//" | sed 's/, *$//'`
524    
525        #- find the largest divisor of input_file proc Nb, but not larger than $np
526        pp=0
527        i=1
528        while [ $i -le $px ] ; do
529          if [ `expr $px % $i` -eq 0 ] ; then
530            j=1
531            while [ $j -le $py ] ; do
532              if [ `expr $py % $j` -eq 0 ] ; then
533                ij=`expr $i \* $j`
534                if [ $ij -gt $pp ] ; then
535                  if [ $ij -le $np ] ; then
536                    ix=$i ; jy=$j ; pp=$ij
537                    #echo "  ix,jy= $ix,$jy"
538                  fi
539                fi
540              fi
541              j=`expr $j + 1`
542            done
543          fi
544          i=`expr $i + 1`
545        done
546    
547        #- create new SIZE.h type file:
548        sx=`expr $sx \* $px / $ix`
549        sy=`expr $sy \* $py / $jy`
550        if [ $verbose -gt 1 ]; then
551            echo " px,py,np= $px,$py,$np : New MPI size: px,py= $ix,$jy : sx,sy= $sx,$sy"
552        fi
553        sed "/^     \& *nPx *=/s/[0-9]*,/$ix,/" $inp > $tmp
554        sed "/^     \& *nPy *=/s/[0-9]*,/$jy,/" $tmp > $out
555        sed "/^     \& *nSx *=/s/[0-9]*,/$sx,/" $out > $tmp
556        sed "/^     \& *nSy *=/s/[0-9]*,/$sy,/" $tmp > $out
557        rm -f $tmp
558        return $pp
559    }
560    
561  symlink_mpifiles()  symlink_mpifiles()
562  {  {
563      # Put special links so that MPI specific files are used      # Put special links so that MPI specific files are used
# Line 500  symlink_mpifiles() Line 566  symlink_mpifiles()
566    
567      dir=$1      dir=$1
568      code_dir=$2      code_dir=$2
569      BUILD_DIR=$dir/$3      build_dir=$dir/$3
     CODE_DIR=$dir/$code_dir  
570    
571      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
572      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)`      MPI_FILES=`(cd $dir/$code_dir; find . -name "*_mpi" -print)`
573    
574      #  Is this an MPI run?      for ii in $MPI_FILES ; do
575      if test "x$MPI" = xt ; then          i=`echo $ii | sed 's:^\./::'`
576          # YES: We symbolically link these files to the build          name=`echo $i | sed 's:_mpi::'`
577          # dir so long as there is no real file in place          file="../$code_dir/$i"
578          for ii in $MPI_FILES ; do          if test $name = 'SIZE.h' ; then file="SIZE.h.mpi" ; fi
579              i=`echo $ii | sed 's:^\./::'`  
580              name=`echo $i | sed 's:_mpi::' `          #  Is this an MPI run?
581              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1          if test "x$MPI" = x0 ; then
582              RETVAL=$?              # NO: We undo any _mpi symbolically linked files
583              if test "x$RETVAL" != x0 ; then              if test -L $build_dir/$name ; then
584                  if ! test -f $BUILD_DIR/$i ; then                  ( cd $build_dir ; cmp $name $file > /dev/null 2>&1 )
                     #echo Linking $name to $i  
                     (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)  
                 fi  
             fi  
         done  
     else  
         # NO: We undo any _mpi symbolically linked files  
         for ii in $MPI_FILES ; do  
             i=`echo $ii | sed 's:^\./::'`  
             name=`echo $i | sed 's:_mpi::' `  
             if test -L $BUILD_DIR/$name ; then  
                 cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1  
585                  RETVAL=$?                  RETVAL=$?
586                  if test "x$RETVAL" = x0 ; then                  if test "x$RETVAL" = x0 ; then
587                      #echo Un-linking $name from $linktarg                      if [ $verbose -gt 1 ]; then
588                      rm -f $BUILD_DIR/$name                          echo "  Un-linking $name from ../$code_dir" ; fi
589                        rm -f $build_dir/$name
590                  fi                  fi
591              fi              fi
592          done          else
593      fi              # YES: We symbolically link these files to the build
594                # dir so long as there is no real file in place
595                ( cd $build_dir ; cmp $name $file > /dev/null 2>&1 )
596                RETVAL=$?
597                if [ $verbose -gt 1 ]; then echo "  cmp $name $file returns: $RETVAL" ; fi
598                if test "x$RETVAL" != x0 ; then
599                    if test -h $build_dir/$name ; then rm -f $build_dir/$name ; fi
600                    if test ! -r $build_dir/$name ; then
601                        if [ $verbose -gt 1 ]; then echo "  Linking $name to $file" ; fi
602                        (cd $build_dir; ln -sf $file $name)
603                    fi
604                fi
605            fi
606        done
607  }  }
608    
609  linkdata()  linkdata()
# Line 554  linkdata() Line 620  linkdata()
620                if test -r "../"$1"/"$xx ; then                if test -r "../"$1"/"$xx ; then
621                  # found 1 _mpi sfx file in 1rst input dir and it is readable                  # found 1 _mpi sfx file in 1rst input dir and it is readable
622                  yy=`echo $xx | sed 's:\.mpi$::'`                  yy=`echo $xx | sed 's:\.mpi$::'`
623                  if test "x$MPI" = "xt" ; then                  if test "x$MPI" = "x0" ; then
624                  # mpi test: remove symbolic link & link _mpi sfx file                      # not mpi test: remove symbolic link
625                        if test -h $yy ; then rm -f $yy ; fi
626                    else
627                        # mpi test: remove symbolic link & link .mpi sfx file
628                      if test -h $yy ; then rm -f $yy ; fi                      if test -h $yy ; then rm -f $yy ; fi
629                      if test ! -r $yy ; then                      if test ! -r $yy ; then
630                          ln -sf "../"$1"/"$xx $yy ;                          ln -sf "../"$1"/"$xx $yy ;
631                          printf " $xx" 1>&2                          printf " $xx" 1>&2
632                      fi                      fi
                 else  
                 # not mpi test: remove symbolic link  
                     if test -h $yy ; then rm -f $yy ; fi  
633                  fi                  fi
634                fi                fi
635              done              done
# Line 611  runmodel() Line 677  runmodel()
677  {  {
678      # runmodel directory      # runmodel directory
679      #      #
680      #  runs "$COMMAND in "directory"      #  runs $COMMAND in "directory"
681      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
682      (      (
683          cd $1          cd $1
684          printf 'runmodel in %s ... ' $1          printf 'runmodel in %s ... ' $1
685          if test -L $EXECUTABLE ; then          if test -L $EXECUTABLE ; then
686            if test -x "../"$builddir"/"$EXECUTABLE ; then            if test -x "../"$builddir"/"$EXECUTABLE ; then
687              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1              cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
688              outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi              outD=$? ; if test "x$outD" != x0 ; then rm -f $EXECUTABLE ; fi
689            else rm -f $EXECUTABLE            else rm -f $EXECUTABLE
690            fi            fi
691          fi          fi
# Line 627  runmodel() Line 693  runmodel()
693              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp
694              ln -sf "../"$builddir"/"$EXECUTABLE .              ln -sf "../"$builddir"/"$EXECUTABLE .
695          fi          fi
696            if test "x$MPI" != x0 ; then
697                #- adjust the MPI run command with the right number of Procs
698                #echo '' ; echo "  COMMAND='$COMMAND'"
699                COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"`
700                if test "x$MPI_MFILE" != x ; then
701                  COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`
702                fi
703                #echo "  COMMAND='$COMMAND'"
704            fi
705          if test ! -x $EXECUTABLE ; then          if test ! -x $EXECUTABLE ; then
706                  rm -f $RUNLOG ; touch $RUNLOG              rm -f $RUNLOG ; touch $RUNLOG
707                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi              if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
708                  echo " no executable:" $EXECUTABLE >> $RUNLOG              echo " no executable:" $EXECUTABLE >> $RUNLOG
709                  RETVAL=8              RETVAL=8
710                  ENDVAL=-1              ENDVAL=-1
711          else          else
712              if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then            if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then
713                # output do not exist or is older than executable:              # output do not exist or is older than executable:
714                  rm -f $RUNLOG ; touch $RUNLOG              rm -f $RUNLOG ; touch $RUNLOG
715                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi              if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
716                  ( eval $COMMAND ) >> $RUNLOG 2>&1              ( eval $COMMAND ) >> $RUNLOG 2>&1
717                  RETVAL=$?              RETVAL=$?
718              else              ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
719                  RETVAL=0              if [ $POSTCLEAN -eq 1 -a $ENDVAL -gt 0 ] ; then
720                  if test -f $RUNLOG ; then                  find . -name "*.meta" -exec rm {} \;
721                      if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi                  find . -name "*.data" -exec rm {} \;
722                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1                  rm -rf mnc_test_*
                 else  
                     touch $RUNLOG  
                     if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi  
                     echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1  
                     echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1  
                 fi  
723              fi              fi
724              ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`            else
725                RETVAL=0
726                ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
727                touch $RUNLOG
728                if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
729                echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
730              fi
731          fi          fi
732          rm -f run.log_tmp          rm -f run.log_tmp
733          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
# Line 809  check_eedata() Line 884  check_eedata()
884  #  Default properties  #  Default properties
885  debug=0  debug=0
886  verbose=1  verbose=1
 clean=0  
887    
888  IEEE=true  IEEE=true
889  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
# Line 824  NOMAKE=f Line 898  NOMAKE=f
898  NOGENMAKE=f  NOGENMAKE=f
899  NOCLEAN=f  NOCLEAN=f
900  NODEPEND=f  NODEPEND=f
901  POSTCLEAN=f  POSTCLEAN=0
902    
903  BASH=  BASH=
904  OPTFILE=NONE  OPTFILE=NONE
# Line 843  if test "x$CC" = x ; then Line 917  if test "x$CC" = x ; then
917      CC=cc      CC=cc
918  fi  fi
919  JOBS=  JOBS=
920  MPI=f  MPI=0
921    MPI_MFILE=
922  MULTI_THREAD=f  MULTI_THREAD=f
923  OUTDIR=  OUTDIR=
924  DELDIR=  DELDIR=
# Line 855  OADM= Line 930  OADM=
930  # list of pTracers to check for monitor output  # list of pTracers to check for monitor output
931  PTRACERS_NUM="1 2 3 4 5"  PTRACERS_NUM="1 2 3 4 5"
932    
933  MATCH_CRIT=13  MATCH_CRIT=10
934    
935  printf "parsing options...  "  printf "parsing options...  "
936    
# Line 873  for ac_option ; do Line 948  for ac_option ; do
948    
949      case $ac_option in      case $ac_option in
950                    
951          -help | --help | -h | --h)          -help | --help | -h | --h) usage ;;
952              usage ;;  
953                    -optfile | --optfile | -of | --of) ac_prev=OPTFILE ;;
954          -optfile | --optfile | -of | --of)          -optfile=* | --optfile=* | -of=* | --of=*) OPTFILE=$ac_optarg ;;
955              ac_prev=OPTFILE ;;  
956          -optfile=* | --optfile=* | -of=* | --of=*)          -addr | --addr | -a | --a) ac_prev=ADDRESSES ;;
957              OPTFILE=$ac_optarg ;;          -addr=* | --addr=* | -a=* | --a=*) ADDRESSES=$ac_optarg ;;
958                    -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;
959          -addr | --addr | -a | --a)          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;
960              ac_prev=ADDRESSES ;;  
961          -addr=* | --addr=* | -a=* | --a=*)          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;
962              ADDRESSES=$ac_optarg ;;          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;
963          -mpackdir | --mpackdir | -mpd | --mpd)          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;
964              ac_prev=MPACKDIR ;;          -skipdir=* | --skipdir=* | -skd=* | --skd=*) SKIPDIRS=$ac_optarg ;;
965          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*)  
966              MPACKDIR=$ac_optarg ;;          -bash | --bash | -b | --b) ac_prev=BASH ;;
967            -bash=* | --bash=* | -b=* | --b=*) BASH=$ac_optarg ;;
968          -tdir | --tdir | -t | --t)  
969              ac_prev=TESTDIRS ;;          -command | --command | -c | --c) ac_prev=COMMAND ;;
970          -tdir=* | --tdir=* | -t=* | --t=*)          -command=* | --command=* | -c=* | --c=*) COMMAND=$ac_optarg ;;
971              TESTDIRS=$ac_optarg ;;  
972            -makedepend | --makedepend | -md | --md) ac_prev=MKDEPEND ;;
973          -skipdir | --skipdir | -skd | --skd)          -makedepend=* | --makedepend=* | -md=* | --md=*) MKDEPEND=$ac_optarg ;;
974              ac_prev=SKIPDIRS ;;  
975          -skipdir=* | --skipdir=* | -skd=* | --skd=*)          -make | --make | -m | --m) ac_prev=MAKE ;;
976              SKIPDIRS=$ac_optarg ;;          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;
977    
978          -bash | --bash | -b | --b)          -odir | --odir) ac_prev=OUTDIR ;;
979              ac_prev=BASH ;;          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;
980          -bash=* | --bash=* | -b=* | --b=*)  
981              BASH=$ac_optarg ;;          -ptracers | --ptracers | -ptr | --ptr) ac_prev=PTRACERS_NUM ;;
982            -ptracers=* | --ptracers=* | -ptr=* | --ptr=*) PTRACERS_NUM=$ac_optarg ;;
         -command | --command | -c | --c)  
             ac_prev=COMMAND ;;  
         -command=* | --command=* | -c=* | --c=*)  
             COMMAND=$ac_optarg ;;  
   
         -makedepend | --makedepend | -md | --md)  
             ac_prev=MKDEPEND ;;  
         -makedepend=* | --makedepend=* | -md=* | --md=*)  
             MKDEPEND=$ac_optarg ;;  
   
         -make | --make | -m | --m)  
             ac_prev=MAKE ;;  
         -make=* | --make=* | -m=* | --m=*)  
             MAKE=$ac_optarg ;;  
   
         -odir | --odir)  
             ac_prev=OUTDIR ;;  
         -odir=* | --odir=*)  
             OUTDIR=$ac_optarg ;;  
   
         -ptracers | --ptracers | -ptr | --ptr)  
             ac_prev=PTRACERS_NUM ;;  
         -ptracers=* | --ptracers=* | -ptr=* | --ptr=*)  
             PTRACERS_NUM=$ac_optarg ;;  
983    
984          -match | --match ) ac_prev=MATCH_CRIT ;;          -match | --match ) ac_prev=MATCH_CRIT ;;
985          -match=* | --match=* ) MATCH_CRIT=$ac_optarg ;;          -match=* | --match=* ) MATCH_CRIT=$ac_optarg ;;
# Line 936  for ac_option ; do Line 987  for ac_option ; do
987          -j | --j) ac_prev=JOBS ;;          -j | --j) ac_prev=JOBS ;;
988          -j=* | --j=*) JOBS=$ac_optarg ;;          -j=* | --j=*) JOBS=$ac_optarg ;;
989    
990          -clean | --clean)          -clean | --clean) CLEANUP=t ; DELDIR=t ;;
             CLEANUP=t ; DELDIR=t ;;  
991    
992          -norun | --norun | -nr | --nr)          -norun | --norun | -nr | --nr) NORUN=t ;;
993              NORUN=t ;;          -runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;;
994          -runonly | --runonly | -ro | --ro)          -quick | --quick | -q | --q) QUICK=t ;;
995              QUICK=t ; NOMAKE=t ;;          -nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;;
996          -quick | --quick | -q | --q)          -noclean | --noclean | -nc | --nc) NOCLEAN=t ;;
997              QUICK=t ;;          -nodepend | --nodepend | -nd | --nd) NODEPEND=t ;;
998          -nogenmake | --nogenmake | -ng | --ng)  
999              NOGENMAKE=t ;;          -postclean | --postclean | -pc | --pc) POSTCLEAN=2 ;;
1000          -noclean | --noclean | -nc | --nc)          -deloutp | --deloutp | -do | --do) POSTCLEAN=1 ;;
1001              NOCLEAN=t ;;  
1002          -nodepend | --nodepend | -nd | --nd)          -mpi | --mpi) MPI=2 ;;
1003              NODEPEND=t ;;          -MPI | --MPI) ac_prev=MPI ;;
1004            -MPI=* | --MPI=*) MPI=$ac_optarg ;;
1005    
1006          -postclean | --postclean | -pc | --pc)          -mfile | --mfile | -mf | --mf) ac_prev=MPI_MFILE ;;
1007              POSTCLEAN=t ;;          -mfile=* | --mfile=* | -mf=* | --mf=*) MPI_MFILE=$ac_optarg ;;
   
         -mpi) MPI=t ;;  
1008    
1009          -mth) MULTI_THREAD=t ;;          -mth) MULTI_THREAD=t ;;
1010    
1011          -adm | -ad) ADM=t ;;          -adm | -ad) ADM=t ;;
   
1012          -oad) OADM=t; NODEPEND=t ;;          -oad) OADM=t; NODEPEND=t ;;
1013    
1014          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
1015          -noieee) IEEE= ;;          -noieee) IEEE= ;;
1016          -gsl) GSL=t ;;          -gsl) GSL=t ;;
1017    
1018          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
1019          -debug) debug=1 ;;          -debug) debug=1 ;;
# Line 979  for ac_option ; do Line 1027  for ac_option ; do
1027          -papis) PAPIS=t;;          -papis) PAPIS=t;;
1028          -pcls) PCL=t;;          -pcls) PCL=t;;
1029    
1030          -*)          -*) echo "Error: unrecognized option: "$ac_option
1031              echo "Error: unrecognized option: "$ac_option              usage ;;
1032              usage          *)  echo "Error: unrecognized argument: "$ac_option
1033              ;;              usage ;;
   
         *)  
             echo "Error: unrecognized argument: "$ac_option  
             usage  
             ;;  
1034    
1035       esac       esac
1036    
# Line 999  if test "x$QUICK" = xt ; then Line 1042  if test "x$QUICK" = xt ; then
1042      NODEPEND=t      NODEPEND=t
1043  fi  fi
1044    
1045    #- check length of MPI machine file:
1046    if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then
1047        if test -r $MPI_MFILE ; then
1048            nl=`wc -l $MPI_MFILE | awk '{print $1}'`
1049            if [ $nl -lt $MPI ] ; then
1050              echo "Error: need at least $MPI nodes (currently only $nl) in MPI_MFILE=$MPI_FILE"
1051              usage
1052            fi
1053            if [ $verbose -gt 1 ]; then
1054                echo " MPI_MFILE=$MPI_MFILE : $nl procs for MPI=$MPI run"
1055            fi
1056        else
1057              echo "Error: cannot access MPI_MFILE=$MPI_FILE"
1058              usage
1059        fi
1060    fi
1061    
1062  #- setting for forward or ADM testing  #- setting for forward or ADM testing
1063  if test "x$ADM" = xt ; then  if test "x$ADM" = xt ; then
1064      code_dir=code_ad      code_dir=code_ad
# Line 1066  if test "x$OPTFILE" = xNONE -a "x$MITGCM Line 1126  if test "x$OPTFILE" = xNONE -a "x$MITGCM
1126      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
1127  fi  fi
1128    
1129    LOC_MFILE='tr_mpi_mfile'
1130  RUNLOG="run.tr_log"  RUNLOG="run.tr_log"
1131  OUTPUTFILE=$ref_outp  OUTPUTFILE=$ref_outp
1132  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
1133      COMMAND="./$EXECUTABLE > $OUTPUTFILE"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
1134  fi  fi
1135  if test "x$MPI" = xt ; then  if test "x$MPI" != x0 ; then
1136      OUTPUTFILE="STDOUT.0000"      OUTPUTFILE="STDOUT.0000"
1137  fi  fi
1138    
# Line 1164  if test "x$OPTFILE" != xNONE ; then Line 1225  if test "x$OPTFILE" != xNONE ; then
1225      fi      fi
1226  else  else
1227      echo >> $SUMMARY      echo >> $SUMMARY
1228      echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY      echo "No \"OPTFILE\" was specified ; genmake2 found and uses:" >> $SUMMARY
1229      echo "   so the genmake default will be used." >> $SUMMARY      #-note: to be filled later after 1rst run
1230  fi  fi
1231  echo  echo
1232  echo >> $SUMMARY  echo >> $SUMMARY
# Line 1229  for dir in $TESTDIRS ; do Line 1290  for dir in $TESTDIRS ; do
1290          (   cd $BUILD_DIR          (   cd $BUILD_DIR
1291              rm -f $EXECUTABLE *.bak              rm -f $EXECUTABLE *.bak
1292              rm -f genmake_state genmake_*optfile genmake.log              rm -f genmake_state genmake_*optfile genmake.log
1293              rm -f genmake.tr_log make.tr_log              rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1294          )          )
1295          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
1296              echo -n '  --- dir:' $dir/$rundir ': '              echo -n '  --- dir:' $dir/$rundir ': '
# Line 1254  for dir in $TESTDIRS ; do Line 1315  for dir in $TESTDIRS ; do
1315    
1316      # Check for specific files for particular type of run      # Check for specific files for particular type of run
1317    
1318      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then      if test "x$MPI" != "x0" ; then
1319          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          if test -r $CODE_DIR"/SIZE.h_mpi" ; then
1320          continue              #- create new SIZE.h with no more than '$MPI' Procs
1321                mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI
1322                LOC_NPROC=$?
1323                (   cd $BUILD_DIR
1324                    if test -r SIZE.h.mpi ; then
1325                        cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$?
1326                    else RETVAL=1
1327                    fi
1328                    if test "x$RETVAL" = x0 ; then
1329                        rm -f tr_size.mpi
1330                    else
1331                        rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi
1332                    fi
1333                )
1334            else
1335                echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1336                continue
1337            fi
1338            if test "x$MPI_MFILE" != x ; then
1339                #- create new MPI machine-file with the right number of Procs
1340                rm -f $LOC_MFILE
1341                cat $MPI_MFILE | sort | uniq | head -$LOC_NPROC > $LOC_MFILE
1342                nl=`wc -l $LOC_MFILE | awk '{print $1}'`
1343                if [ $nl -lt $LOC_NPROC ] ; then
1344                    rm -f $LOC_MFILE
1345                    cat $MPI_MFILE | head -$LOC_NPROC > $LOC_MFILE
1346                    #sed -n "1,$LOC_NPROC p" $MPI_MFILE > $LOC_MFILE
1347                fi
1348                if [ $verbose -gt 1 ]; then
1349                    nl=`wc -l $LOC_MFILE | awk '{print $1}'`
1350                    echo " new LOC_MFILE=$LOC_MFILE : $nl procs for LOC_NPROC=$LOC_NPROC"
1351                fi
1352            fi
1353      fi      fi
1354      if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then      if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then
1355          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"
1356          continue          continue
1357      fi      fi
1358      if test "x$MPI" = "xt" -a "x$MULTI_THREAD" = "xt" ; then      if test "x$MPI" != "x0" -a "x$MULTI_THREAD" = "xt" ; then
1359        retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/input/eedata.mth"`          retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/input/eedata.mth"`
1360        if test $retv != 0 ; then          if test $retv != 0 ; then
1361          echo "input/eedata.mth tiling misfit -- skipping $dir"              echo "input/eedata.mth tiling misfit -- skipping $dir"
1362          continue              continue
1363        fi          fi
1364      fi      fi
1365    
1366      #  Check whether there are "extra runs" for this testdir      #  Check whether there are "extra runs" for this testdir
# Line 1283  for dir in $TESTDIRS ; do Line 1376  for dir in $TESTDIRS ; do
1376          if test -f $outf -a -r $outf ; then          if test -f $outf -a -r $outf ; then
1377            if test "x$MULTI_THREAD" = "xt" ; then            if test "x$MULTI_THREAD" = "xt" ; then
1378              if test -r $dir"/"$exd"/eedata.mth" ; then              if test -r $dir"/"$exd"/eedata.mth" ; then
1379                if test "x$MPI" = "xt" ; then                if test "x$MPI" = "x0" ; then
1380                  retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"`                  extra_runs="$extra_runs $name"
1381                  else
1382                    retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/"$exd"/eedata.mth"`
1383                  if test $retv = 0 ; then                  if test $retv = 0 ; then
1384                      extra_runs="$extra_runs $name"                      extra_runs="$extra_runs $name"
1385                  else                  else
1386                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"
1387                  fi                  fi
               else  
                 extra_runs="$extra_runs $name"  
1388                fi                fi
1389              #else echo $dir"/"$exd"/eedata.mth: not found"              #else echo $dir"/"$exd"/eedata.mth: not found"
1390              fi              fi
# Line 1341  for dir in $TESTDIRS ; do Line 1434  for dir in $TESTDIRS ; do
1434          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1435          touch $locDIR"/summary.txt"          touch $locDIR"/summary.txt"
1436          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
         echo "MACH='$MACH'" >> $locDIR"/summary.txt"  
         echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"  
         echo "DATE='$DATE'" >> $locDIR"/summary.txt"  
1437          echo "tdir='$dir'" >> $locDIR"/summary.txt"          echo "tdir='$dir'" >> $locDIR"/summary.txt"
1438          if test "x$ADM" = xt ; then          if test "x$ADM" = xt ; then
1439              head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"              head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"
# Line 1371  for dir in $TESTDIRS ; do Line 1461  for dir in $TESTDIRS ; do
1461              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1462              touch $locDIR"/summary.txt"              touch $locDIR"/summary.txt"
1463              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
             echo "MACH='$MACH'" >> $locDIR"/summary.txt"  
             echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"  
             echo "DATE='$DATE'" >> $locDIR"/summary.txt"  
1464              echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt"              echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt"
1465              if test "x$ADM" = xt ; then              if test "x$ADM" = xt ; then
1466                  head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"                  head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"
1467                  grep -A3 'Seconds in section "ALL' $dir/$pfxdir.$ex/$OUTPUTFILE \                  grep -A3 'Seconds in section "ALL' $dir/$pfxdir.$ex/$OUTPUTFILE \
1468                                     >> $locDIR"/summary.txt"                                     >> $locDIR"/summary.txt"
1469              fi              fi
1470              if test "x$POSTCLEAN" = xt ; then              if test "x$POSTCLEAN" = x2 ; then
1471                  run_clean $dir/$pfxdir.$ex                  run_clean $dir/$pfxdir.$ex
1472              fi              fi
1473          done          done
# Line 1390  for dir in $TESTDIRS ; do Line 1477  for dir in $TESTDIRS ; do
1477              mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`              mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`
1478              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1479              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1480              echo $mkOpt >> $DRESULTS/genmake_state              echo " $mkOpt" >> $DRESULTS/genmake_state
1481                if test "x$OPTFILE" = xNONE ; then
1482                    eval $mkOpt
1483                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1484                            $SUMMARY > tr_0.tmp_log
1485                    RETVAL=$?
1486                    if test "x$RETVAL" = x0 ; then rm -f $SUMMARY
1487                            cp tr_0.tmp_log $SUMMARY
1488                    else rm -f tr_0.tmp_log
1489                    fi
1490                fi
1491                gmkLog=$dir/$builddir/genmake.log
1492                grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1
1493                RETVAL=$?
1494                if test "x$RETVAL" = x0 ; then
1495                    echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state
1496                    sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \
1497                           | grep -v '^... compiler version ' > tr_1.tmp_log
1498                    sed -n '1,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \
1499                            >> $DRESULTS/genmake_state
1500                    rm -f tr_1.tmp_log
1501                fi
1502          fi          fi
1503      fi      fi
1504      #postclean $dir/$builddir      #postclean $dir/$builddir
1505      if test "x$POSTCLEAN" = xt ; then      if test "x$POSTCLEAN" = x2 ; then
1506          makeclean $dir/$builddir \          makeclean $dir/$builddir \
1507              && run_clean $dir/$rundir              && run_clean $dir/$rundir
1508      fi      fi
1509        if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then rm -f $LOC_MFILE ; fi
1510    
1511      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1512    

Legend:
Removed from v.1.146  
changed lines
  Added in v.1.156

  ViewVC Help
Powered by ViewVC 1.1.22