/[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.117 by jmc, Tue Aug 19 18:29:12 2008 UTC revision 1.121 by jmc, Fri Jan 30 20:08:09 2009 UTC
# Line 30  usage() Line 30  usage()
30      echo "                             Bourne-compatible \"sh\" shell"      echo "                             Bourne-compatible \"sh\" shell"
31      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
32      echo "  (-adm|-ad)               perform an adjoint run"      echo "  (-adm|-ad)               perform an adjoint run"
33        echo "  (-oad)                   perform an OpenAD adjoint run"
34      echo "  (-command) STRING        command to run"      echo "  (-command) STRING        command to run"
35      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
36      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-m|-make) STRING        command to use for \"make\""
# Line 211  testoutput_run() Line 212  testoutput_run()
212                  eval "HAVE_PTR0"$ii"=t"                  eval "HAVE_PTR0"$ii"=t"
213              else              else
214                  eval "HAVE_PTR0"$ii"=f"                  eval "HAVE_PTR0"$ii"=f"
215                if test "x$ADM" = x ; then                if test "x$ADM" = x -a "x$OADM" = x; then
216                # remove this ptr from the list of output variable to check                # remove this ptr from the list of output variable to check
217                # echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2                # echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2
218                  listVar=`echo "$listVar" | sed "s/ pt$ii..//g"`                  listVar=`echo "$listVar" | sed "s/ pt$ii..//g"`
# Line 314  genmakemodel() Line 315  genmakemodel()
315          (          (
316              cd $1;              cd $1;
317              command="$GENMAKE2  -ds -m $MAKE"              command="$GENMAKE2  -ds -m $MAKE"
318              if test "x$ADM" = x ; then              if test "x$ADM" = xt ; then
                 command="$command --mods=../code"  
             else  
319                  command="$command --mods=../code_ad"                  command="$command --mods=../code_ad"
320                elif test "x$OADM" = xt ; then
321                    command="$command -adof ../../../tools/adjoint_options/adjoint_oad -mods '../code_oad ../../OpenAD/code_oad_all'"
322                else
323                    command="$command --mods=../code"
324              fi              fi
325              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
326                  command="$command --optfile=$OPTFILE"                  command="$command --optfile=$OPTFILE"
# Line 342  genmakemodel() Line 345  genmakemodel()
345              fi              fi
346              fi              fi
347              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
348              $command > make.log 2>&1              # $command > make.log 2>&1
349                eval $command > make.log 2>&1
350              RETVAL=$?              RETVAL=$?
351              #  Reduce the size of the testing emails!              #  Reduce the size of the testing emails!
352              head -100 Makefile > $CDIR/Makefile_head              head -100 Makefile > $CDIR/Makefile_head
# Line 437  makemodel() Line 441  makemodel()
441          cd $1;          cd $1;
442          if test -r Makefile ; then          if test -r Makefile ; then
443              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
444              if test "x$ADM" = x ; then              if test "x$ADM" = xt ; then
445                    $MAKE adall >> make.log 2>&1
446                elif test "x$OADM" = xt ; then
447                    $MAKE adAll >> make.log 2>&1
448                else
449                  if test "x$JOBS" = x ; then                  if test "x$JOBS" = x ; then
450                      $MAKE >> make.log 2>&1                      $MAKE >> make.log 2>&1
451                  else                  else
452                      $MAKE -j $JOBS >> make.log 2>&1                      $MAKE -j $JOBS >> make.log 2>&1
453                  fi                  fi
             else  
                 $MAKE adall >> make.log 2>&1  
454              fi              fi
455              RETVAL=$?              RETVAL=$?
456              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
# Line 566  runmodel() Line 572  runmodel()
572          echo          echo
573          if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then          if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
574              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
575              outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; rm -f run.log ; fi              outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi
576          fi          fi
577          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
578              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp
579              ln -sf "../"$builddir"/"$EXECUTABLE .              ln -sf "../"$builddir"/"$EXECUTABLE .
580          fi          fi
581          if test ! -x $EXECUTABLE ; then          if test ! -x $EXECUTABLE ; then
582                  rm -f run.log ; touch run.log                  rm -f $RUNLOG ; touch $RUNLOG
583                  if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
584                  echo " no executable:" $EXECUTABLE >> run.log                  echo " no executable:" $EXECUTABLE >> $RUNLOG
585                  RETVAL=8                  RETVAL=8
586                  ENDVAL=-1                  ENDVAL=-1
587          else          else
588              if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then              if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then
589                # output do not exist or is older than executable:                # output do not exist or is older than executable:
590                  rm -f run.log ; touch run.log                  rm -f $RUNLOG ; touch $RUNLOG
591                  if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
592                  ( eval $COMMAND ) >> run.log 2>&1                  ( eval $COMMAND ) >> $RUNLOG 2>&1
593                  RETVAL=$?                  RETVAL=$?
594              else              else
595                  RETVAL=0                  RETVAL=0
596                  if test -f run.log ; then                  if test -f $RUNLOG ; then
597                      if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi                      if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
598                      echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
599                  else                  else
600                      touch run.log                      touch $RUNLOG
601                      if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi                      if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
602                      echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
603                      echo " no previous run.log: assume NORMAL END" >> run.log 2>&1                      echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1
604                  fi                  fi
605              fi              fi
606              ENDVAL=`cat run.log | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`              ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`
607          fi          fi
608          rm -f run.log_00          rm -f run.log_tmp
609          #if test "x$RETVAL" = x0 ; then          #if test "x$RETVAL" = x0 ; then
610          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
611              tail run.log              tail $RUNLOG
612              echo successful 1>&2              echo successful 1>&2
613              # === Reduce the size of the testing emails!              # === Reduce the size of the testing emails!
614              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE
615              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
616              return 0              return 0
617          else          else
618              tail run.log              tail $RUNLOG
619              echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2              echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2
620              cp run.log $CDIR"/run.log"              cp $RUNLOG $CDIR"/"$RUNLOG
621              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
622              return 1              return 1
623          fi          fi
# Line 755  OUTDIR= Line 761  OUTDIR=
761  DELDIR=  DELDIR=
762    
763  ADM=  ADM=
764    OADM=
765    
766  # list of pTracers to check for monitor output  # list of pTracers to check for monitor output
767  PTRACERS_NUM="1 2 3 4 5"  PTRACERS_NUM="1 2 3 4 5"
# Line 856  for ac_option ; do Line 863  for ac_option ; do
863    
864          -adm | -ad) ADM=t ;;          -adm | -ad) ADM=t ;;
865    
866            -oad) OADM=t; NODEPEND=t ;;
867    
868          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
869          -noieee) IEEE= ;;          -noieee) IEEE= ;;
870          -gsl) GSL=t ;;          -gsl) GSL=t ;;
# Line 898  if test "x$ADM" = xt ; then Line 907  if test "x$ADM" = xt ; then
907      inputdir=input_ad      inputdir=input_ad
908      ref_outp="output_adm.txt"      ref_outp="output_adm.txt"
909      EXECUTABLE="mitgcmuv_ad"      EXECUTABLE="mitgcmuv_ad"
910    elif test "x$OADM" = xt ; then
911        code_dir=code_oad
912        inputdir=input_oad
913        ref_outp="output_oadm.txt"
914        EXECUTABLE="mitgcmuv_ad"
915  else  else
916      code_dir=code      code_dir=code
917      inputdir=input      inputdir=input
# Line 950  if test "x$OPTFILE" = xNONE -a "x$MITGCM Line 964  if test "x$OPTFILE" = xNONE -a "x$MITGCM
964      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
965  fi  fi
966    
967    RUNLOG="run.log"
968  OUTPUTFILE=$ref_outp  OUTPUTFILE=$ref_outp
969  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
970      COMMAND="./$EXECUTABLE > $OUTPUTFILE"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
# Line 964  echo "OK (COMMAND= $COMMAND )" Line 979  echo "OK (COMMAND= $COMMAND )"
979  #  (use default or load experiment-specific list from file "tr_checklist")  #  (use default or load experiment-specific list from file "tr_checklist")
980  # content : 1rst = main variable used to decide if it pass or FAIL  # content : 1rst = main variable used to decide if it pass or FAIL
981  #         others = number of matching digits to be printed in summary.txt  #         others = number of matching digits to be printed in summary.txt
982  if test "x$ADM" = x ; then  if test "x$ADM" = x -a "x$OADM" = x; then
983      DEF_CHECK_LIST='PS PS T+ S+ U+ V+ pt1+ pt2+ pt3+ pt4+ pt5+'      DEF_CHECK_LIST='PS PS T+ S+ U+ V+ pt1+ pt2+ pt3+ pt4+ pt5+'
984      EMPTY_RESULTS='.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..'      EMPTY_RESULTS='.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..'
985      LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`      LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`
# Line 988  fi Line 1003  fi
1003    
1004  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
1005  CMDLINE=$0  CMDLINE=$0
1006  for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  for xx in "$@" ; do nw=`echo $xx | wc -w`
1007        if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
1008                            else CMDLINE="$CMDLINE '$xx'" ; fi
1009    done
1010    #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done
1011  MACH=`hostname`  MACH=`hostname`
1012  UNAMEA=`uname -a`  UNAMEA=`uname -a`
1013  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
1014  BASE="tr_"$MACH"_"$DATE"_"  BASE="tr_"$MACH"_"$DATE"_"
1015  if test "x$OUTDIR" != x ; then  if test "x$OUTDIR" != x ; then
1016      BASE="tr_"$OUTDIR"_"$DATE"_"      BASE="tr_"$OUTDIR"_"$DATE"_"
1017    else
1018        short_name=`hostname | sed 's/\..*$//'`
1019        BASE="tr_"$short_name"_"$DATE"_"
1020  fi  fi
1021  DNUM=0  DNUM=0
1022  DRESULTS="$BASE$DNUM"  DRESULTS="$BASE$DNUM"
# Line 1041  else Line 1063  else
1063  fi  fi
1064  echo  echo
1065  echo >> $SUMMARY  echo >> $SUMMARY
1066  if test "x$ADM" = x ; then  if test "x$ADM" = x -a "x$OADM" = x; then
1067      if [ $MATCH_CRIT -lt 10 ] ;      if [ $MATCH_CRIT -lt 10 ] ;
1068      then line_0="default  "$MATCH_CRIT ;      then line_0="default  "$MATCH_CRIT ;
1069      else line_0="default "$MATCH_CRIT ; fi      else line_0="default "$MATCH_CRIT ; fi

Legend:
Removed from v.1.117  
changed lines
  Added in v.1.121

  ViewVC Help
Powered by ViewVC 1.1.22