/[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.49 by edhill, Tue Nov 23 21:25:24 2004 UTC revision 1.66 by edhill, Fri Feb 4 16:41:42 2005 UTC
# Line 27  usage() Line 27  usage()
27      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
28      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-m|-make) STRING        command to use for \"make\""
29      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
30        echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
31        echo "                             (DEF=\"1 2 3 4 5\")"
32      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
33      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
34      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
# Line 35  usage() Line 37  usage()
37      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
38      echo "  (-deldir|-dd)            on success, delete the output directory"      echo "  (-deldir|-dd)            on success, delete the output directory"
39      echo      echo
40      echo "and where STRING follows a whitespace-delimited format"      echo "and where STRING can be a whitespace-delimited list"
41      echo "such as:"      echo "such as:"
42        echo
43      echo "  -t 'exp0 exp2 exp3' "      echo "  -t 'exp0 exp2 exp3' "
44      echo "  -addr='abc@123.com testing@home.org'"      echo "  -addr='abc@123.com testing@home.org'"
45      echo      echo
46        echo "provided that the expression is properly quoted within the current"
47        echo "shell (note the use of single quotes to protect white space)."
48        echo
49      exit 1      exit 1
50  }  }
51    
# Line 178  check_for_add_mon_output() Line 184  check_for_add_mon_output()
184          return          return
185      fi      fi
186    
187        for ii in $PTRACERS_NUM ; do
188            eval "HAVE_PTR0"$ii"=f"
189        done
190    
191      ptr_add="trcstat_ptracerXX_min trcstat_ptracerXX_max"      ptr_add="trcstat_ptracerXX_min trcstat_ptracerXX_max"
192      ptr_add="$ptr_add trcstat_ptracerXX_mean trcstat_ptracerXX_sd"      ptr_add="$ptr_add trcstat_ptracerXX_mean trcstat_ptracerXX_sd"
193      for ii in 1 2 3 4 5 ; do      for ii in $PTRACERS_NUM ; do
194          for jj in $ptr_add ; do          for jj in $ptr_add ; do
195              name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`              name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`
196              tst=`grep $name $1 | wc -l | awk '{print $1}'`              tst=`grep $name $1 | wc -l | awk '{print $1}'`
# Line 222  testoutput() Line 232  testoutput()
232          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2 $3; vmean=$?          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2 $3; vmean=$?
233          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2 $3; vsd=$?          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2 $3; vsd=$?
234    
235          for ii in 1 2 3 4 5 ; do          #  This is for PTRACERS
236              testoutput_for_prop $1 "trcstat_ptracer0"$ii"_min"  "p0"$ii"_min"  $2 $3          for ii in $PTRACERS_NUM ; do
237              RETVAL=$? ; eval `echo "p0"$ii"_min="$RETVAL`              eval `echo "p0"$ii"_min=99"`
238              testoutput_for_prop $1 "trcstat_ptracer0"$ii"_max"  "p0"$ii"_max"  $2 $3              eval `echo "p0"$ii"_max=99"`
239              RETVAL=$? ; eval `echo "p0"$ii"_max="$RETVAL`              eval `echo "p0"$ii"_mean=99"`
240              testoutput_for_prop $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3              eval `echo "p0"$ii"_sd=99"`
241              RETVAL=$? ; eval `echo "p0"$ii"_mean="$RETVAL`              tst=`eval 'echo "$HAVE_PTR0'$ii'"'`
242              testoutput_for_prop $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_sd"   $2 $3              #echo 'tst = '$tst
243              RETVAL=$? ; eval `echo "p0"$ii"_sd="$RETVAL`              if test "x$tst" = xt ; then
244                    a="trcstat_ptracer0"
245                    testoutput_for_prop $1 "$a"$ii"_min"  "p0"$ii"_min"  $2 $3
246                    RETVAL=$? ; eval `echo "p0"$ii"_min="$RETVAL`
247                    testoutput_for_prop $1 "$a"$ii"_max"  "p0"$ii"_max"  $2 $3
248                    RETVAL=$? ; eval `echo "p0"$ii"_max="$RETVAL`
249                    testoutput_for_prop $1 "$a"$ii"_mean" "p0"$ii"_mean" $2 $3
250                    RETVAL=$? ; eval `echo "p0"$ii"_mean="$RETVAL`
251                    testoutput_for_prop $1 "$a"$ii"_sd"   "p0"$ii"_sd"   $2 $3
252                    RETVAL=$? ; eval `echo "p0"$ii"_sd="$RETVAL`
253                fi
254          done          done
255    
256          allargs="$cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd"          allargs="$cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd"
# Line 274  genmakemodel() Line 294  genmakemodel()
294              if test "x$IEEE" != x ; then              if test "x$IEEE" != x ; then
295                  command="$command -ieee"                  command="$command -ieee"
296              fi              fi
297                if test "x$MPI" = xt ; then
298                    command="$command -mpi"
299                fi
300              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
301              $command > make.log 2>&1              $command > make.log 2>&1
302              RETVAL=$?              RETVAL=$?
# Line 430  linkdata() Line 453  linkdata()
453              if test "x$ADM" = x ; then              if test "x$ADM" = x ; then
454                  files=`( cd ../input ; ls -1 | grep -v CVS )`                  files=`( cd ../input ; ls -1 | grep -v CVS )`
455                  for i in $files ; do                  for i in $files ; do
456                      if test ! -d "../input/"$i ; then                      if test ! -d "../input/"$i -a ! -f $i ; then
457                          ln -sf "../input/"$i $i                          ln -sf "../input/"$i $i
458                      fi                      fi
459                  done                  done
# Line 499  createcodelet() Line 522  createcodelet()
522  #include <math.h>  #include <math.h>
523  int main( int argc, char** argv )  {  int main( int argc, char** argv )  {
524    int linnum,best,lncnt;    int linnum,best,lncnt;
525    double a,b,diff;    double a,b,abave,relerr;
526    best = -16;    best = -22;
527    lncnt = 0;    lncnt = 0;
528    while( 1 & (lncnt+=1) < 999 )  {    while( 1 & (lncnt+=1) < 999 )  {
529      scanf("%d", &linnum);      scanf("%d", &linnum);
530      if (linnum == -1)  break;      if (linnum == -1)  break;
531      scanf("%lf", &a);  scanf("%lf", &b);      scanf("%lf", &a);  scanf("%lf", &b);
532      diff = 0.5*(fabs(a)+fabs(b));      abave = 0.5*(fabs(a)+fabs(b));
533      if (diff > 1.e-12) {      if (abave > 0.0) {
534        diff=fabs(a-b)/diff;        relerr=fabs(a-b)/abave;
535        if (diff > 0.0) {        if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); }
536          linnum = (int)log10(diff);        else { linnum = -16 ; }
537          best = (best > linnum) ? best : linnum;        best = (best > linnum) ? best : linnum;
       }  
       else {  
         if (best == -16 && diff != 0)  best = -22;  
       }  
538      }      }
539    }    }
540    if (lncnt == 999) best=-29;    if (lncnt == 999) best=-29;
# Line 523  int main( int argc, char** argv )  { Line 542  int main( int argc, char** argv )  {
542    return 0;    return 0;
543  }  }
544  EOF  EOF
545      cc -o tmp_cmpnum tmp_cmpnum.c -lm      $CC -o tmp_cmpnum tmp_cmpnum.c -lm
546    
547      if [ -x ./tmp_cmpnum ]; then      if [ -x ./tmp_cmpnum ]; then
548          echo "OK"          echo "OK"
549          return 0          return 0
550      else      else
551          echo          echo
552          echo "ERROR: failed to compile comparison code"          echo "ERROR: failed to compile comparison code -- please specify"
553            echo "  a C compiler using the CC environment variable."
554          exit 1          exit 1
555      fi      fi
556  }  }
# Line 619  MPACKDIR="../tools/mpack-1.6" Line 639  MPACKDIR="../tools/mpack-1.6"
639  HAVE_MPACK=  HAVE_MPACK=
640  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
641  COMMAND=  COMMAND=
642  MAKE=make  if test "x$MAKE" = x ; then
643        MAKE=make
644    fi
645    if test "x$CC" = x ; then
646        CC=cc
647    fi
648  JOBS=  JOBS=
649  MPI=f  MPI=f
650  DELDIR=  DELDIR=
# Line 627  DELDIR= Line 652  DELDIR=
652  ADM=  ADM=
653    
654  # Additional monitor types  # Additional monitor types
655  # HAVE_PTR01=  PTRACERS_NUM="1 2 3 4 5"
 # HAVE_PTR02=  
 # HAVE_PTR03=  
 # HAVE_PTR04=  
 # HAVE_PTR05=  
656    
657  printf "parsing options...  "  printf "parsing options...  "
658    
# Line 682  for ac_option ; do Line 703  for ac_option ; do
703          -make=* | --make=*)          -make=* | --make=*)
704              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
705    
706            -ptracers | --ptracers | -ptr | --ptr)
707                ac_prev=PTRACERS_NUM ;;
708            -ptracers=* | --ptracers=* | -ptr=* | --ptr=*)
709                PTRACERS_NUM=$ac_optarg ;;
710    
711          -j) ac_prev=JOBS ;;          -j) ac_prev=JOBS ;;
712          -j=*) JOBS=$ac_optarg ;;          -j=*) JOBS=$ac_optarg ;;
713    
# Line 813  if test "x$ADM" = x ; then Line 839  if test "x$ADM" = x ; then
839      line_2="E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  ."      line_2="E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  ."
840      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"
841      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  ."
842      for ii in 1 2 3 4 5 ; do      for ii in $PTRACERS_NUM ; do
843          #  tst=`eval 'echo $HAVE_PTR0'$ii`          #  tst=`eval 'echo $HAVE_PTR0'$ii`
844          #  if test "x$tst" = xt ; then          #  if test "x$tst" = xt ; then
845          line_0="$line_0  --PTR 0"$ii"--"          line_0="$line_0  --PTR 0"$ii"--"
# Line 852  for dir in $TESTDIRS ; do Line 878  for dir in $TESTDIRS ; do
878          if test -r $dir/input/Makefile ; then          if test -r $dir/input/Makefile ; then
879              ( cd $dir/input ; make CLEAN )              ( cd $dir/input ; make CLEAN )
880          fi          fi
881            (
882                cd $dir
883                rm -rf tr_run.*
884            )
885          continue          continue
886      fi      fi
887    
# Line 867  for dir in $TESTDIRS ; do Line 897  for dir in $TESTDIRS ; do
897          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
898          continue          continue
899      fi      fi
900        if test "x$ADM" = x ; then
901            check_for_add_mon_output  $fout
902        fi
903    
904      # Check for additional types of monitor output      # Check for additional types of monitor output
     check_for_add_mon_output  $fout  
905    
906      builddir="input"      builddir="input"
907      rundir="input"      rundir="input"
# Line 945  for dir in $TESTDIRS ; do Line 977  for dir in $TESTDIRS ; do
977          echo "DATE='$DATE'" >> $CDIR"/summary.txt"          echo "DATE='$DATE'" >> $CDIR"/summary.txt"
978          echo "tdir='$dir'" >> $CDIR"/summary.txt"          echo "tdir='$dir'" >> $CDIR"/summary.txt"
979    
         OLD_COMMAND=$COMMAND  
         COMMAND="./mitgcmuv > output.txt"  
980          for ex in $extra_runs ; do          for ex in $extra_runs ; do
981              test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex"              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"
982              mkdir "$dir/tr_run.$ex"              for ldir in input.$ex input ; do
983              links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`                  (
984                        cd "$dir/$ldir" > /dev/null 2>&1
985                        ls -1 2>/dev/null \
986                            | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g'
987                    ) > tr_exrun_links
988                    (
989                        cd "$dir/tr_run.$ex"
990                        cat ../../tr_exrun_links | while read i ; do
991                            if test ! "x$i" = x ; then
992                                test ! -r $i  &&  ln -s "../"$ldir"/"$i $i
993                            fi
994                        done
995                    )
996                    test -e tr_exrun_links  &&  rm -f tr_exrun_links
997                done
998                ldir=build
999                (
1000                    cd "$dir/$ldir" > /dev/null 2>&1
1001                    ls -1 Makefile *.[fFhco] mitgcmuv  2>/dev/null \
1002                        | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g'
1003                ) > tr_exrun_links
1004              (              (
1005                  cd "$dir/tr_run.$ex"                  cd "$dir/tr_run.$ex"
1006                  for i in $links; do                      cat ../../tr_exrun_links | while read i ; do
1007                      ln -s ../input/$i $i                          if test ! "x$i" = x ; then
1008                  done                              test ! -r $i  &&  ln -s "../"$ldir"/"$i $i
1009              )                          fi
1010              links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`                      done
             (  
                 cd "$dir/tr_run.$ex"  
                 for i in $links; do  
                     test -e $i  &&  rm -f $i  
                     ln -s ../input.$ex/$i $i  
                 done  
                 ln -s ../$builddir/mitgcmuv mitgcmuv  
1011              )              )
1012                test -e tr_exrun_links  &&  rm -f tr_exrun_links
1013              runmodel $dir/tr_run.$ex && run=Y \              runmodel $dir/tr_run.$ex && run=Y \
1014                  && results=`testoutput $dir tr_run.$ex "."$ex`                  && results=`testoutput $dir tr_run.$ex "."$ex`
1015              fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`              fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
# Line 979  for dir in $TESTDIRS ; do Line 1023  for dir in $TESTDIRS ; do
1023              echo "DATE='$DATE'" >> $CDIR"/summary.txt"              echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1024              echo "tdir='$dir'" >> $CDIR"/summary.txt"              echo "tdir='$dir'" >> $CDIR"/summary.txt"
1025          done          done
         COMMAND=$OLD_COMMAND  
1026      else      else
1027          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
1028          fres=$fres"$results   $dir"          fres=$fres"$results   $dir"
# Line 1032  fi Line 1075  fi
1075  rm -f tmp_cmpnum.c tmp_cmpnum  rm -f tmp_cmpnum.c tmp_cmpnum
1076    
1077  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1078      cat $SUMMARY      cat $SUMMARY | sed 's/ -- -- -- --//g'
1079      if test -e tr_out.txt ; then      if test -e tr_out.txt ; then
1080          mv tr_out.txt tr_out.txt.old          mv tr_out.txt tr_out.txt.old
1081      fi      fi
1082      cat $SUMMARY > tr_out.txt      cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt
1083  fi  fi
1084    
1085  if test "x$DELDIR" = xt ; then  if test "x$DELDIR" = xt ; then

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.66

  ViewVC Help
Powered by ViewVC 1.1.22