/[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.192 by jmc, Sun Aug 18 19:53:47 2013 UTC revision 1.205 by jmc, Sun Dec 6 23:18:52 2015 UTC
# Line 19  usage() Line 19  usage()
19      echo "  (-mpi)                   use MPI to compile and run on 2 processors"      echo "  (-mpi)                   use MPI to compile and run on 2 processors"
20      echo "  (-MPI)  NUMBER           use MPI to compile and run on max NUMBER procs"      echo "  (-MPI)  NUMBER           use MPI to compile and run on max NUMBER procs"
21      echo "  (-mfile|-mf) STRING      MPI: file with list of possible machines to run on"      echo "  (-mfile|-mf) STRING      MPI: file with list of possible machines to run on"
22      echo "  (-command|-c) STRING     command to run (needed for MPI run)"      echo "  (-command|-c) STRING     command to run (e.g., if non-standard MPI setting)"
23        echo "                            DEF='mitgcmuv' or ='mpirun -np TR_NPROC mitgcmuv'"
24      echo " ---- testing options : ----"      echo " ---- testing options : ----"
25      echo "  (-optfile|-of) STRING    list of optfiles to use"      echo "  (-optfile|-of) STRING    list of optfiles to use"
26      echo "  (-fast)                  use optfile default for compiler flags (no '-ieee')"      echo "  (-fast)                  use optfile default for compiler flags (no '-ieee')"
# Line 41  usage() Line 42  usage()
42      echo "  (-bash|-b) STRING        preferred location of a \"bash\" or \"sh\" shell"      echo "  (-bash|-b) STRING        preferred location of a \"bash\" or \"sh\" shell"
43      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
44      echo "  (-ef) STRING             used as genmake2 \"-extra_flag\" argument"      echo "  (-ef) STRING             used as genmake2 \"-extra_flag\" argument"
45        echo "  (-ncad)                  use genmake2 option \"-nocat4ad\" (-ncad)"
46        echo "  (-small_f)               make target small_f before making target all"
47      echo "  (-makedepend|-md) STRING command to use for \"makedepend\""      echo "  (-makedepend|-md) STRING command to use for \"makedepend\""
48      echo "  (-make|-m) STRING        command to use for \"make\""      echo "  (-make|-m) STRING        command to use for \"make\""
49      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
# Line 129  testoutput_var() Line 132  testoutput_var()
132          echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2          echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2
133      fi      fi
134      if [ -r $1/$4/$OUTPUTFILE ]; then      if [ -r $1/$4/$OUTPUTFILE ]; then
135          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > ${TMP}a.txt          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | nl > ${TMP}a.txt
136          lncntA=`wc -l ${TMP}a.txt | awk '{print $1}' `          lncntA=`wc -l ${TMP}a.txt | awk '{print $1}' `
137          if [ $lncntA -lt 2 ]; then          if [ $lncntA -lt 2 ]; then
138              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
# Line 144  testoutput_var() Line 147  testoutput_var()
147      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
148          echo testoutput_var: grep "$2" $1/$5 1>&2          echo testoutput_var: grep "$2" $1/$5 1>&2
149      fi      fi
150      grep "$2" $1/$5 | sed 's/.*=//' | cat -n > ${TMP}b.txt      grep "$2" $1/$5 | sed 's/.*=//' | nl > ${TMP}b.txt
151      lncntB=`wc -l ${TMP}b.txt | awk '{print $1}' `      lncntB=`wc -l ${TMP}b.txt | awk '{print $1}' `
152      if [ $lncntB -lt 2 ]; then      if [ $lncntB -lt 2 ]; then
153          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
# Line 330  testoutput_run() Line 333  testoutput_run()
333          'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North-av"  $2 $refoutp ; yy=$? ;;          'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North-av"  $2 $refoutp ; yy=$? ;;
334          'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;;          'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;;
335          'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;;          'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;;
336             'sbo_M') testoutput_var $1 "sbo_mass"          "SBO mass"        $2 $refoutp ; yy=$? ;;
337             'sboFW') testoutput_var $1 "sbo_mass_fw"       "SBO m-FW"        $2 $refoutp ; yy=$? ;;
338             'sboAc') testoutput_var $1 "sbo_zoamc"         "SBO AM-C"        $2 $refoutp ; yy=$? ;;
339             'sboAp') testoutput_var $1 "sbo_zoamp"         "SBO AM-P"        $2 $refoutp ; yy=$? ;;
340          'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;;          'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;;
341                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;
342            esac            esac
# Line 367  genmakemodel() Line 374  genmakemodel()
374              if test "x$MKDEPEND" != x ; then              if test "x$MKDEPEND" != x ; then
375                  command="$command -makedepend=$MKDEPEND"                  command="$command -makedepend=$MKDEPEND"
376              fi              fi
377              if test $KIND = 1 -o $KIND = 2 ; then              if test $KIND = 4 ; then
378                  command="$command --mods=../code_ad"                  command="$command -oad -mods=../$code_dir"
             elif test $KIND = 4 ; then  
                 command="$command -adof ../../../tools/adjoint_options/adjoint_oad -mods '../code_oad ../../OpenAD/code_oad_all'"  
379              else              else
380                  command="$command -mods=../code"                  command="$command -mods=../$code_dir"
381              fi              fi
382              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
383                  command="$command -optfile=$OPTFILE"                  command="$command -optfile=$OPTFILE"
# Line 399  genmakemodel() Line 404  genmakemodel()
404              if test "x$EXTRFLG" != x ; then              if test "x$EXTRFLG" != x ; then
405                  command="$command -extra_flag $EXTRFLG"                  command="$command -extra_flag $EXTRFLG"
406              fi              fi
407                if test "x$NOCATAD" = xt ; then
408                    command="$command -nocat4ad"
409                fi
410              if test "x$TS" = xt ; then              if test "x$TS" = xt ; then
411                  command="$command -ts"                  command="$command -ts"
412              fi              fi
# Line 429  genmakemodel() Line 437  genmakemodel()
437  makeclean()  makeclean()
438  {  {
439      # makeclean directory      # makeclean directory
440      if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi      if test "x$NOGENMAKE" = xf ; then rm -f $1/make.tr_log ; fi
441      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
442          echo "make Clean skipped!"          echo "make Clean skipped!"
443      else      else
# Line 520  makemodel() Line 528  makemodel()
528      else      else
529          cd $1;          cd $1;
530          if test -r Makefile ; then          if test -r Makefile ; then
531              printf 'make ... '              if test "x$MKSMALLF" = xt ; then
532              if test "x$REPLMAKE" = x ; then                  printf 'make small_f ... '
533                  $MAKE $TARG >> make.tr_log 2>&1                  $MAKE_CMD small_f >> make.tr_log 2>&1
534              else                  RETVAL=$?
535                  $REPLMAKE $TARG >> make.tr_log 2>&1                  if test "x$RETVAL" != x0 ; then
536                        tail make.tr_log
537                        echo failed
538                        cp genmake.log genmake.tr_log $CDIR
539                        tail -$NBLINES_MKLOG make.tr_log > $CDIR"/make.tr_log_tail"
540                        rm -f $EXECUTABLE
541                        mk_fail=1
542                    else
543                        echo successful
544                    fi
545              fi              fi
546                printf 'make ... '
547                $MAKE_CMD $TARG >> make.tr_log 2>&1
548              RETVAL=$?              RETVAL=$?
549              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
550                  tail make.tr_log                  tail make.tr_log
# Line 773  runmodel() Line 792  runmodel()
792          if test "x$MPI" != x0 ; then          if test "x$MPI" != x0 ; then
793              #- adjust the MPI run command with the right number of Procs              #- adjust the MPI run command with the right number of Procs
794              #echo '' ; echo "  COMMAND='$COMMAND'"              #echo '' ; echo "  COMMAND='$COMMAND'"
795              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"`              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC/ $LOC_NPROC/"`
796              if test "x$MPI_MFILE" != x ; then              if test "x$MPI_MFILE" != x ; then
797                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`
798              fi              fi
# Line 839  runmodel() Line 858  runmodel()
858          if test -f $OUTPUTFILE ; then          if test -f $OUTPUTFILE ; then
859            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \
860                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
861            grep -A3 'Seconds in section "ALL' $OUTPUTFILE \  #         grep -A3 'Seconds in section "ALL' $OUTPUTFILE \
862                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"  #               | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
863    #         some implementations of grep cannot do contextual searches so we
864    #         replace the above with a sed command
865              cat $OUTPUTFILE | sed -n '/Seconds in section "ALL/{N
866              N
867              N
868              p
869              }' | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
870          fi          fi
871          if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi          if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
872          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
# Line 1041  MKDEPEND= Line 1067  MKDEPEND=
1067  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
1068      MAKE=make      MAKE=make
1069  fi  fi
1070  REPLMAKE=  MAKE_CMD=
1071  if test "x$CC" = x ; then  if test "x$CC" = x ; then
1072      CC=cc      CC=cc
1073  fi  fi
# Line 1054  OUTDIR= Line 1080  OUTDIR=
1080  DELDIR=  DELDIR=
1081  USE_R4=  USE_R4=
1082  EXTRFLG=  EXTRFLG=
1083    NOCATAD=
1084    MKSMALLF=
1085    
1086  #- type of testing (KIND):  #- type of testing (KIND):
1087  #   KIND=0 : forward (= default) ;  KIND=1 : Tangent Linear with TAF ;  #   KIND=0 : forward (= default) ;  KIND=1 : Tangent Linear with TAF ;
# Line 1113  for ac_option ; do Line 1141  for ac_option ; do
1141          -make | --make | -m | --m) ac_prev=MAKE ;;          -make | --make | -m | --m) ac_prev=MAKE ;;
1142          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;
1143    
1144          -repl_mk | --repl_mk ) ac_prev=REPLMAKE ;;          -repl_mk | --repl_mk ) ac_prev=MAKE_CMD ;;
1145          -repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;;          -repl_mk=* | --repl_mk=*) MAKE_CMD=$ac_optarg ;;
1146    
1147          -odir | --odir) ac_prev=OUTDIR ;;          -odir | --odir) ac_prev=OUTDIR ;;
1148          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;
# Line 1162  for ac_option ; do Line 1190  for ac_option ; do
1190          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else
1191                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage
1192                fi ;;                fi ;;
1193            -ncad) NOCATAD=t ;;
1194            -small_f) MKSMALLF=t ;;
1195    
1196          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"
1197                   printf " ... " ;;                   printf " ... " ;;
# Line 1181  for ac_option ; do Line 1211  for ac_option ; do
1211    
1212          -ts) TS=t;;          -ts) TS=t;;
1213          -papis) PAPIS=t;;          -papis) PAPIS=t;;
1214          -pcls) PCL=t;;          -pcls) PCLS=t;;
1215    
1216          -*) echo "Error: unrecognized option: "$ac_option          -*) echo "Error: unrecognized option: "$ac_option
1217              usage ;;              usage ;;
# Line 1197  if test "x$QUICK" = xt ; then Line 1227  if test "x$QUICK" = xt ; then
1227      NOCLEAN=t      NOCLEAN=t
1228      NODEPEND=t      NODEPEND=t
1229  fi  fi
1230    if test "x$MAKE_CMD" = x ; then MAKE_CMD=$MAKE ; fi
1231    
1232  #- check length of MPI machine file:  #- check length of MPI machine file:
1233  if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then  if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then
# Line 1235  elif test $KIND = 4 ; then Line 1266  elif test $KIND = 4 ; then
1266      ref_outp="output_oadm.txt"      ref_outp="output_oadm.txt"
1267      EXECUTABLE="mitgcmuv_ad"      EXECUTABLE="mitgcmuv_ad"
1268  else  else
     if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi  
1269      code_dir=code      code_dir=code
1270      inputdir=input      inputdir=input
1271      ref_outp="output.txt"      ref_outp="output.txt"
1272      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
1273  fi  fi
1274    if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi
1275    
1276  xx=`echo $TESTDIRS | awk '{print $1}'`  xx=`echo $TESTDIRS | awk '{print $1}'`
1277  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
# Line 1293  fi Line 1324  fi
1324    
1325  LOC_MFILE='tr_mpi_mfile'  LOC_MFILE='tr_mpi_mfile'
1326  RUNLOG="run.tr_log"  RUNLOG="run.tr_log"
1327  OUTPUTFILE=$ref_outp  if test "x$MPI" = x0 ; then
1328  if test "x$COMMAND" = x ; then    OUTPUTFILE=$ref_outp
1329      COMMAND="./$EXECUTABLE > $OUTPUTFILE"    if test "x$COMMAND" = x ; then COMMAND="./$EXECUTABLE > $OUTPUTFILE" ; fi
1330  fi  else
1331  if test "x$MPI" != x0 ; then    OUTPUTFILE="STDOUT.0000"
1332      OUTPUTFILE="STDOUT.0000"    if test "x$COMMAND" = x ; then COMMAND="mpirun -np TR_NPROC ./$EXECUTABLE" ; fi
1333  fi  fi
1334    
1335  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND='$COMMAND')"
1336    
1337  TMP=./tr_$$  #TMP=./tr_$$
1338  #- try to put temporary files in system-local /tmp dir  #- try to put temporary files in system-local /tmp dir
1339  #TMP=/tmp/tr_$$  TMP=/tmp/tr_${USER}_$$
1340  #touch $TMP ; retVal=$?  touch $TMP ; retVal=$?
1341  #if [ $retVal -eq 0 ] ; then  if [ $retVal -eq 0 ] ; then
1342  #  if test ! -r $TMP ; then TMP=./tr_$$ ; fi    if test ! -r $TMP ; then TMP=./tr_$$ ; fi
1343  #else  else
1344  #  TMP=./tr_$$    TMP=./tr_$$
1345  #fi  fi
1346  #rm -f $TMP  rm -f $TMP
1347  #if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi  if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi
1348    
1349  # set the Default List of output variables to be checked:  # set the Default List of output variables to be checked:
1350  #  (use default or load experiment-specific list from file "tr_checklist")  #  (use default or load experiment-specific list from file "tr_checklist")
# Line 1360  for xx in "$@" ; do nw=`echo $xx | wc -w Line 1391  for xx in "$@" ; do nw=`echo $xx | wc -w
1391                               CMDLINE="$CMDLINE $yy" ; fi                               CMDLINE="$CMDLINE $yy" ; fi
1392      fi      fi
1393  done  done
 #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  
1394  MACH=`hostname`  MACH=`hostname`
1395  UNAMEA=`uname -a`  UNAMEA=`uname -a`
1396  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
# Line 1368  BASE="tr_"$MACH"_"$DATE"_" Line 1398  BASE="tr_"$MACH"_"$DATE"_"
1398  if test "x$OUTDIR" != x ; then  if test "x$OUTDIR" != x ; then
1399      BASE="tr_"$OUTDIR"_"$DATE"_"      BASE="tr_"$OUTDIR"_"$DATE"_"
1400  else  else
1401      short_name=`hostname | sed 's/\..*$//'`     #short_name=`hostname -s | tr '[:upper:]' '[:lower:]'`
1402       # hostname -s is not universal (does work on AIX system)
1403        short_name=`hostname | sed 's/\..*$//' | tr '[:upper:]' '[:lower:]'`
1404      BASE="tr_"$short_name"_"$DATE"_"      BASE="tr_"$short_name"_"$DATE"_"
1405  fi  fi
1406  DNUM=0  DNUM=0
# Line 1674  for dir in $TESTDIRS ; do Line 1706  for dir in $TESTDIRS ; do
1706          if test -f $dir/$builddir/Makefile ; then          if test -f $dir/$builddir/Makefile ; then
1707              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/^# //'`
1708              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1709              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state  #           sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1710    # bsd-sed cannot do the above code
1711                cat $dir/$builddir/Makefile | \
1712                    sed -n '/^# executed by:/{N
1713                                              p
1714                                              }' >> $DRESULTS/genmake_state
1715              echo " $mkOpt" >> $DRESULTS/genmake_state              echo " $mkOpt" >> $DRESULTS/genmake_state
1716              if test "x$OPTFILE" = xNONE ; then              if test "x$OPTFILE" = xNONE ; then
1717                  eval $mkOpt                  eval $mkOpt
1718                  sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\  #               sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1719                          $SUMMARY > tmp.tr_log  #                       $SUMMARY > tmp.tr_log
1720    # bsd-sed requires a newline after "a\":
1721                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\\
1722                             OPTFILE=${OPTFILE}" $SUMMARY > tmp.tr_log
1723                  RETVAL=$?                  RETVAL=$?
1724                  if test "x$RETVAL" = x0 ; then                  if test "x$RETVAL" = x0 ; then
1725                      cp -f tmp.tr_log $SUMMARY                      cp -f tmp.tr_log $SUMMARY
# Line 1700  for dir in $TESTDIRS ; do Line 1740  for dir in $TESTDIRS ; do
1740                                           >> $DRESULTS/genmake_state                                           >> $DRESULTS/genmake_state
1741                    rm -f tmp.tr_log                    rm -f tmp.tr_log
1742                  fi                  fi
1743                  echo -n "from '$gmkLog', " >> $DRESULTS/genmake_state              fi
1744                  echo "get NETCDF & LAPACK settings:" >> $DRESULTS/genmake_state              gmkLog=$dir/$builddir/genmake_state
1745                  sed -n '/set HAVE_NETCDF=/p' $gmkLog >> $DRESULTS/genmake_state              if test -r $gmkLog ; then
1746                  sed -n '/set HAVE_LAPACK=/p' $gmkLog >> $DRESULTS/genmake_state                  echo -n "from '$gmkLog', "      >> $DRESULTS/genmake_state
1747                    echo "get genmake settings:"    >> $DRESULTS/genmake_state
1748                    sed -n '/^HAVE_/p' $gmkLog | sed 's/^./ &/' \
1749                                                    >> $DRESULTS/genmake_state
1750              fi              fi
1751          fi          fi
1752      fi      fi

Legend:
Removed from v.1.192  
changed lines
  Added in v.1.205

  ViewVC Help
Powered by ViewVC 1.1.22