/[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.109 by jmc, Thu Dec 13 18:28:41 2007 UTC revision 1.117 by jmc, Tue Aug 19 18:29:12 2008 UTC
# Line 19  usage() Line 19  usage()
19      echo "  (-of=|-optfile=)STRING   list of optfiles to use"      echo "  (-of=|-optfile=)STRING   list of optfiles to use"
20      echo "  (-a|-addr) STRING        list of email recipients"      echo "  (-a|-addr) STRING        list of email recipients"
21      echo "                             (DEF=\"\" no email is sent)"      echo "                             (DEF=\"\" no email is sent)"
22        echo "  (-mpd|-mpackdir) DIR     location of the mpack utility"
23        echo "                             (DEF=\"../tools/mpack-1.6\")"
24      echo "  (-t|-tdir) STRING        list of group and/or exp. dirs to test"      echo "  (-t|-tdir) STRING        list of group and/or exp. dirs to test"
25      echo "                             (recognized groups: basic, tutorials)"      echo "                             (recognized groups: basic, tutorials)"
26      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
# Line 65  usage() Line 67  usage()
67  build_mpack()  build_mpack()
68  {  {
69      printf "building the mpack utility...  "      printf "building the mpack utility...  "
70      if test ! -x "$MPACKDIR/mpack" ; then      MPACK="$MPACKDIR/mpack"
71        if test ! -x $MPACK ; then
72          if test ! -d $MPACKDIR ; then          if test ! -d $MPACKDIR ; then
73              echo              echo
74              echo "Error: can't find \"$MPACKDIR\""              echo "Error: can't find \"$MPACKDIR\""
# Line 74  build_mpack() Line 77  build_mpack()
77              echo              echo
78              HAVE_MPACK=f              HAVE_MPACK=f
79          fi          fi
         printf "building mpack...  "  
80          if test "x$CC" = x ; then          if test "x$CC" = x ; then
81              export CC=cc              export CC=cc
82          fi          fi
83            printf "building mpack (using CC=$CC)...  "
84          ( cd $MPACKDIR && ./configure && $MAKE ) > tr_build_mpack.out 2>&1          ( cd $MPACKDIR && ./configure && $MAKE ) > tr_build_mpack.out 2>&1
85          RETVAL=$?          RETVAL=$?
86          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
# Line 88  build_mpack() Line 91  build_mpack()
91          else          else
92              rm -f tr_build_mpack.out              rm -f tr_build_mpack.out
93              HAVE_MPACK=t              HAVE_MPACK=t
94                echo "done"
95          fi          fi
96      else      else
97          HAVE_MPACK=t          HAVE_MPACK=t
98            echo "already exist"
99      fi      fi
     echo "OK"  
100  }  }
101    
102  testoutput_var()  testoutput_var()
# Line 175  testoutput_var() Line 179  testoutput_var()
179      return $digits_of_similarity      return $digits_of_similarity
180  }  }
181    
 check_for_add_mon_output()  
 {  
     # Check for additional types of monitor output  
     if test "x$1" = x ; then  
         return  
     fi  
   
     for ii in $PTRACERS_NUM ; do  
         eval "HAVE_PTR0"$ii"=f"  
     done  
   
     ptr_add="trcstat_ptracerXX_min trcstat_ptracerXX_max"  
     ptr_add="$ptr_add trcstat_ptracerXX_mean trcstat_ptracerXX_sd"  
     for ii in $PTRACERS_NUM ; do  
         for jj in $ptr_add ; do  
             name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`  
             tst=`grep $name $1 | wc -l | awk '{print $1}'`  
             if test ! "x$tst" = x0 ; then  
                 eval "HAVE_PTR0"$ii"=t"  
             fi  
         done  
         #  eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"'  
     done  
 }  
   
182  testoutput_run()  testoutput_run()
183  {  {
184      # testoutput_run directory subdir reference_output      # testoutput_run directory subdir reference_output
# Line 217  testoutput_run() Line 196  testoutput_run()
196          listVar=`echo $listChk | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' \          listVar=`echo $listChk | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' \
197                                 | sed 's/+//g' | sed "s/^$sVar//"`                                 | sed 's/+//g' | sed "s/^$sVar//"`
198          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(I)='$listVar'" 1>&2 ; fi          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(I)='$listVar'" 1>&2 ; fi
199          for ii in 1 2 3 4 5 6 7 8 9 ; do          # check for ptracer output in reference_output file :
200            tst=`eval 'echo "$HAVE_PTR0'$ii'"'`          outpref=$1/results/$3
201           #echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2          ptr_mon="trcstat_ptracerXX_min trcstat_ptracerXX_max"
202            if test "x$tst" != xt ; then listVar=`echo "$listVar" | sed "s/ pt$ii..//g"` ; fi          ptr_mon="$ptr_mon trcstat_ptracerXX_mean trcstat_ptracerXX_sd"
203          done          for ii in $PTRACERS_NUM ; do
204          tst=`echo $sVar $listVar | awk '{ for(i=2;i<=NF;i++){t+=($i==$1)}; print t }'`              ptrfound=0
205                for jj in $ptr_mon ; do
206                    name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`
207                    tst=`grep $name $outpref | wc -l | awk '{print $1}'`
208                    if test ! "x$tst" = x0 ; then ptrfound=1 ; fi
209                done
210                if test $ptrfound = '1' ; then
211                    eval "HAVE_PTR0"$ii"=t"
212                else
213                    eval "HAVE_PTR0"$ii"=f"
214                  if test "x$ADM" = x ; then
215                  # remove this ptr from the list of output variable to check
216                  # echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2
217                    listVar=`echo "$listVar" | sed "s/ pt$ii..//g"`
218                  fi
219                fi
220            #   eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"' 1>&2
221            done
222            tst=`echo $sVar $listVar | awk '{ for(i=2;i<=NF;i++){if($i==$1)t+=1}; print t }'`
223          if test $tst != 1 ; then          if test $tst != 1 ; then
224            if test $tst = 0 ; then echo "==> WARNING: selected var >$sVar< not found" 1>&2            if test $tst = 0 ; then echo "==> WARNING: selected var >$sVar< not found" 1>&2
225                   else echo "==> WARNING: found selected var >$sVar< $tst times" 1>&2 ; fi                   else echo "==> WARNING: found selected var >$sVar< $tst times" 1>&2 ; fi
# Line 474  symlink_mpifiles() Line 471  symlink_mpifiles()
471      CODE_DIR=$dir/$code_dir      CODE_DIR=$dir/$code_dir
472            
473      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
474      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)`
475    
476      #  Is this an MPI run?      #  Is this an MPI run?
477      if test "x$MPI" = xt ; then      if test "x$MPI" = xt ; then
# Line 625  createcodelet() Line 622  createcodelet()
622  {  {
623      # create codelet for comparing model output      # create codelet for comparing model output
624    
625      printf "creating the comparison code...  "      printf "creating the comparison code (using CC=$CC)...  "
626      cat > tr_cmpnum.c <<EOF      cat > tr_cmpnum.c <<EOF
627  #include <stdio.h>  #include <stdio.h>
628  #include <math.h>  #include <math.h>
# Line 743  TESTDIRS= Line 740  TESTDIRS=
740  SKIPDIRS=  SKIPDIRS=
741  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
742  HAVE_MPACK=  HAVE_MPACK=
743  MPACK="$MPACKDIR/mpack"  MPACK=
744  COMMAND=  COMMAND=
745  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
746      MAKE=make      MAKE=make
# Line 759  DELDIR= Line 756  DELDIR=
756    
757  ADM=  ADM=
758    
759  # Additional monitor types  # list of pTracers to check for monitor output
760  PTRACERS_NUM="1 2 3 4 5"  PTRACERS_NUM="1 2 3 4 5"
761    
762  MATCH_CRIT=13  MATCH_CRIT=13
# Line 792  for ac_option ; do Line 789  for ac_option ; do
789              ac_prev=ADDRESSES ;;              ac_prev=ADDRESSES ;;
790          -addr=* | --addr=*)          -addr=* | --addr=*)
791              ADDRESSES=$ac_optarg ;;              ADDRESSES=$ac_optarg ;;
792            -mpackdir | --mpackdir | -mpd | --mpd)
793                ac_prev=MPACKDIR ;;
794            -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*)
795                MPACKDIR=$ac_optarg ;;
796    
797          -tdir | --tdir | -t | --t)          -tdir | --tdir | -t | --t)
798              ac_prev=TESTDIRS ;;              ac_prev=TESTDIRS ;;
# Line 978  fi Line 979  fi
979  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
980  createcodelet  createcodelet
981    
982  #  build the mpack utility  #  build the mpack utility (if ADDRESSES = NONE, do it to test the build)
983  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = x ; then
984      echo "skipping mpack build"      echo "skipping mpack build"
985  else  else
986      build_mpack      build_mpack
987  fi  fi
988    
989  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
990    CMDLINE=$0
991    for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done
992  MACH=`hostname`  MACH=`hostname`
993  UNAMEA=`uname -a`  UNAMEA=`uname -a`
994  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
# Line 1006  if test "x$RETVAL" != x0 ; then Line 1009  if test "x$RETVAL" != x0 ; then
1009      exit 1      exit 1
1010  fi  fi
1011  SUMMARY="$DRESULTS/summary.txt"  SUMMARY="$DRESULTS/summary.txt"
 printf "Start time:  " >> $SUMMARY  
1012  start_date=`date`  start_date=`date`
1013  echo $start_date > $SUMMARY  echo $start_date > $SUMMARY
1014    echo 'run:' $CMDLINE >> $SUMMARY
1015    echo 'on :' $UNAMEA  >> $SUMMARY
1016    
1017  of_path=  of_path=
1018  if test "x$OPTFILE" != xNONE ; then  if test "x$OPTFILE" != xNONE ; then
# Line 1048  if test "x$ADM" = x ; then Line 1052  if test "x$ADM" = x ; then
1052      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"
1053      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."
1054      for ii in $PTRACERS_NUM ; do      for ii in $PTRACERS_NUM ; do
         #  tst=`eval 'echo $HAVE_PTR0'$ii`  
         #  if test "x$tst" = xt ; then  
1055          line_0="$line_0  --PTR 0"$ii"--"          line_0="$line_0  --PTR 0"$ii"--"
1056          line_1="$line_1        m  s"          line_1="$line_1        m  s"
1057          line_2="$line_2  m  m  e  ."          line_2="$line_2  m  m  e  ."
1058          line_3="$line_3  i  a  a  d"          line_3="$line_3  i  a  a  d"
1059          line_4="$line_4  n  x  n  ."          line_4="$line_4  n  x  n  ."
         #  fi  
1060      done      done
1061      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1062      echo "$line_1" | tee -a $SUMMARY      echo "$line_1" | tee -a $SUMMARY
# Line 1095  for dir in $TESTDIRS ; do Line 1096  for dir in $TESTDIRS ; do
1096      #  Cleanup only!      #  Cleanup only!
1097      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1098          if test -r $BUILD_DIR/Makefile ; then          if test -r $BUILD_DIR/Makefile ; then
1099              echo '  ------  clean dir:' $dir/build              echo '  ------  clean dir:' $dir/$builddir
1100              ( cd $BUILD_DIR ; make CLEAN )              ( cd $BUILD_DIR ; make CLEAN )
1101          fi          fi
1102          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
# Line 1116  for dir in $TESTDIRS ; do Line 1117  for dir in $TESTDIRS ; do
1117          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
1118          continue          continue
1119      fi      fi
     if test "x$ADM" = x ; then  
         check_for_add_mon_output  $fout  
     fi  
1120    
1121      # Check for additional types of monitor output      # Check for specific files for particular type of run
1122    
1123      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then
1124          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
# Line 1244  for dir in $TESTDIRS ; do Line 1242  for dir in $TESTDIRS ; do
1242  done  done
1243    
1244  printf "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
1245  echo $start_date >> $SUMMARY  echo "$start_date" >> $SUMMARY
1246  printf "End time:    " >> $SUMMARY  printf "End time:    " >> $SUMMARY
1247  date >> $SUMMARY  date >> $SUMMARY
1248    

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

  ViewVC Help
Powered by ViewVC 1.1.22