/[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.201 by jmc, Mon Feb 23 23:05:57 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)                  used genmake2 option \"-nocat4ad\" (-ncad)"
46      echo "  (-makedepend|-md) STRING command to use for \"makedepend\""      echo "  (-makedepend|-md) STRING command to use for \"makedepend\""
47      echo "  (-make|-m) STRING        command to use for \"make\""      echo "  (-make|-m) STRING        command to use for \"make\""
48      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
# Line 330  testoutput_run() Line 332  testoutput_run()
332          '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=$? ;;
333          '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=$? ;;
334          '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=$? ;;
335             'sbo_M') testoutput_var $1 "sbo_mass"          "SBO mass"        $2 $refoutp ; yy=$? ;;
336             'sboFW') testoutput_var $1 "sbo_mass_fw"       "SBO m-FW"        $2 $refoutp ; yy=$? ;;
337             'sboAc') testoutput_var $1 "sbo_zoamc"         "SBO AM-C"        $2 $refoutp ; yy=$? ;;
338             'sboAp') testoutput_var $1 "sbo_zoamp"         "SBO AM-P"        $2 $refoutp ; yy=$? ;;
339          'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;;          'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;;
340                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;
341            esac            esac
# Line 367  genmakemodel() Line 373  genmakemodel()
373              if test "x$MKDEPEND" != x ; then              if test "x$MKDEPEND" != x ; then
374                  command="$command -makedepend=$MKDEPEND"                  command="$command -makedepend=$MKDEPEND"
375              fi              fi
376              if test $KIND = 1 -o $KIND = 2 ; then              if test $KIND = 4 ; then
377                  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'"  
378              else              else
379                  command="$command -mods=../code"                  command="$command -mods=../$code_dir"
380              fi              fi
381              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
382                  command="$command -optfile=$OPTFILE"                  command="$command -optfile=$OPTFILE"
# Line 399  genmakemodel() Line 403  genmakemodel()
403              if test "x$EXTRFLG" != x ; then              if test "x$EXTRFLG" != x ; then
404                  command="$command -extra_flag $EXTRFLG"                  command="$command -extra_flag $EXTRFLG"
405              fi              fi
406                if test "x$NOCATAD" = xt ; then
407                    command="$command -nocat4ad"
408                fi
409              if test "x$TS" = xt ; then              if test "x$TS" = xt ; then
410                  command="$command -ts"                  command="$command -ts"
411              fi              fi
# Line 429  genmakemodel() Line 436  genmakemodel()
436  makeclean()  makeclean()
437  {  {
438      # makeclean directory      # makeclean directory
439      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
440      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
441          echo "make Clean skipped!"          echo "make Clean skipped!"
442      else      else
# Line 521  makemodel() Line 528  makemodel()
528          cd $1;          cd $1;
529          if test -r Makefile ; then          if test -r Makefile ; then
530              printf 'make ... '              printf 'make ... '
531              if test "x$REPLMAKE" = x ; then              $MAKE_CMD $TARG >> make.tr_log 2>&1
                 $MAKE $TARG >> make.tr_log 2>&1  
             else  
                 $REPLMAKE $TARG >> make.tr_log 2>&1  
             fi  
532              RETVAL=$?              RETVAL=$?
533              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
534                  tail make.tr_log                  tail make.tr_log
# Line 773  runmodel() Line 776  runmodel()
776          if test "x$MPI" != x0 ; then          if test "x$MPI" != x0 ; then
777              #- adjust the MPI run command with the right number of Procs              #- adjust the MPI run command with the right number of Procs
778              #echo '' ; echo "  COMMAND='$COMMAND'"              #echo '' ; echo "  COMMAND='$COMMAND'"
779              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"`              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC/ $LOC_NPROC/"`
780              if test "x$MPI_MFILE" != x ; then              if test "x$MPI_MFILE" != x ; then
781                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`
782              fi              fi
# Line 1041  MKDEPEND= Line 1044  MKDEPEND=
1044  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
1045      MAKE=make      MAKE=make
1046  fi  fi
1047  REPLMAKE=  MAKE_CMD=
1048  if test "x$CC" = x ; then  if test "x$CC" = x ; then
1049      CC=cc      CC=cc
1050  fi  fi
# Line 1054  OUTDIR= Line 1057  OUTDIR=
1057  DELDIR=  DELDIR=
1058  USE_R4=  USE_R4=
1059  EXTRFLG=  EXTRFLG=
1060    NOCATAD=
1061    
1062  #- type of testing (KIND):  #- type of testing (KIND):
1063  #   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 1117  for ac_option ; do
1117          -make | --make | -m | --m) ac_prev=MAKE ;;          -make | --make | -m | --m) ac_prev=MAKE ;;
1118          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;
1119    
1120          -repl_mk | --repl_mk ) ac_prev=REPLMAKE ;;          -repl_mk | --repl_mk ) ac_prev=MAKE_CMD ;;
1121          -repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;;          -repl_mk=* | --repl_mk=*) MAKE_CMD=$ac_optarg ;;
1122    
1123          -odir | --odir) ac_prev=OUTDIR ;;          -odir | --odir) ac_prev=OUTDIR ;;
1124          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;
# Line 1162  for ac_option ; do Line 1166  for ac_option ; do
1166          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else
1167                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage
1168                fi ;;                fi ;;
1169            -ncad) NOCATAD=t ;;
1170    
1171          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"
1172                   printf " ... " ;;                   printf " ... " ;;
# Line 1181  for ac_option ; do Line 1186  for ac_option ; do
1186    
1187          -ts) TS=t;;          -ts) TS=t;;
1188          -papis) PAPIS=t;;          -papis) PAPIS=t;;
1189          -pcls) PCL=t;;          -pcls) PCLS=t;;
1190    
1191          -*) echo "Error: unrecognized option: "$ac_option          -*) echo "Error: unrecognized option: "$ac_option
1192              usage ;;              usage ;;
# Line 1197  if test "x$QUICK" = xt ; then Line 1202  if test "x$QUICK" = xt ; then
1202      NOCLEAN=t      NOCLEAN=t
1203      NODEPEND=t      NODEPEND=t
1204  fi  fi
1205    if test "x$MAKE_CMD" = x ; then MAKE_CMD=$MAKE ; fi
1206    
1207  #- check length of MPI machine file:  #- check length of MPI machine file:
1208  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 1241  elif test $KIND = 4 ; then
1241      ref_outp="output_oadm.txt"      ref_outp="output_oadm.txt"
1242      EXECUTABLE="mitgcmuv_ad"      EXECUTABLE="mitgcmuv_ad"
1243  else  else
     if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi  
1244      code_dir=code      code_dir=code
1245      inputdir=input      inputdir=input
1246      ref_outp="output.txt"      ref_outp="output.txt"
1247      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
1248  fi  fi
1249    if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi
1250    
1251  xx=`echo $TESTDIRS | awk '{print $1}'`  xx=`echo $TESTDIRS | awk '{print $1}'`
1252  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
# Line 1293  fi Line 1299  fi
1299    
1300  LOC_MFILE='tr_mpi_mfile'  LOC_MFILE='tr_mpi_mfile'
1301  RUNLOG="run.tr_log"  RUNLOG="run.tr_log"
1302  OUTPUTFILE=$ref_outp  if test "x$MPI" = x0 ; then
1303  if test "x$COMMAND" = x ; then    OUTPUTFILE=$ref_outp
1304      COMMAND="./$EXECUTABLE > $OUTPUTFILE"    if test "x$COMMAND" = x ; then COMMAND="./$EXECUTABLE > $OUTPUTFILE" ; fi
1305  fi  else
1306  if test "x$MPI" != x0 ; then    OUTPUTFILE="STDOUT.0000"
1307      OUTPUTFILE="STDOUT.0000"    if test "x$COMMAND" = x ; then COMMAND="mpirun -v -np TR_NPROC ./$EXECUTABLE" ; fi
1308  fi  fi
1309    
1310  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND='$COMMAND')"
1311    
1312  TMP=./tr_$$  #TMP=./tr_$$
1313  #- try to put temporary files in system-local /tmp dir  #- try to put temporary files in system-local /tmp dir
1314  #TMP=/tmp/tr_$$  TMP=/tmp/tr_${USER}_$$
1315  #touch $TMP ; retVal=$?  touch $TMP ; retVal=$?
1316  #if [ $retVal -eq 0 ] ; then  if [ $retVal -eq 0 ] ; then
1317  #  if test ! -r $TMP ; then TMP=./tr_$$ ; fi    if test ! -r $TMP ; then TMP=./tr_$$ ; fi
1318  #else  else
1319  #  TMP=./tr_$$    TMP=./tr_$$
1320  #fi  fi
1321  #rm -f $TMP  rm -f $TMP
1322  #if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi  if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi
1323    
1324  # set the Default List of output variables to be checked:  # set the Default List of output variables to be checked:
1325  #  (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 1366  for xx in "$@" ; do nw=`echo $xx | wc -w
1366                               CMDLINE="$CMDLINE $yy" ; fi                               CMDLINE="$CMDLINE $yy" ; fi
1367      fi      fi
1368  done  done
 #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  
1369  MACH=`hostname`  MACH=`hostname`
1370  UNAMEA=`uname -a`  UNAMEA=`uname -a`
1371  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
# Line 1368  BASE="tr_"$MACH"_"$DATE"_" Line 1373  BASE="tr_"$MACH"_"$DATE"_"
1373  if test "x$OUTDIR" != x ; then  if test "x$OUTDIR" != x ; then
1374      BASE="tr_"$OUTDIR"_"$DATE"_"      BASE="tr_"$OUTDIR"_"$DATE"_"
1375  else  else
1376      short_name=`hostname | sed 's/\..*$//'`     #short_name=`hostname -s | tr '[:upper:]' '[:lower:]'`
1377       # hostname -s is not universal (does work on AIX system)
1378        short_name=`hostname | sed 's/\..*$//' | tr '[:upper:]' '[:lower:]'`
1379      BASE="tr_"$short_name"_"$DATE"_"      BASE="tr_"$short_name"_"$DATE"_"
1380  fi  fi
1381  DNUM=0  DNUM=0
# Line 1674  for dir in $TESTDIRS ; do Line 1681  for dir in $TESTDIRS ; do
1681          if test -f $dir/$builddir/Makefile ; then          if test -f $dir/$builddir/Makefile ; then
1682              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/^# //'`
1683              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1684              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state  #           sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1685    # bsd-sed cannot do the above code
1686                cat $dir/$builddir/Makefile | \
1687                    sed  -n '/^# executed by:/{N
1688                                               p
1689                                               }' >> $DRESULTS/genmake_state
1690              echo " $mkOpt" >> $DRESULTS/genmake_state              echo " $mkOpt" >> $DRESULTS/genmake_state
1691              if test "x$OPTFILE" = xNONE ; then              if test "x$OPTFILE" = xNONE ; then
1692                  eval $mkOpt                  eval $mkOpt
1693                  sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\  #               sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1694                          $SUMMARY > tmp.tr_log  #                       $SUMMARY > tmp.tr_log
1695    # bsd-sed requires a newline after "a\":
1696                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\\
1697                             OPTFILE=${OPTFILE}" $SUMMARY > tmp.tr_log
1698                  RETVAL=$?                  RETVAL=$?
1699                  if test "x$RETVAL" = x0 ; then                  if test "x$RETVAL" = x0 ; then
1700                      cp -f tmp.tr_log $SUMMARY                      cp -f tmp.tr_log $SUMMARY

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

  ViewVC Help
Powered by ViewVC 1.1.22