/[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.50 by edhill, Wed Nov 24 17:06:07 2004 UTC revision 1.67 by jmc, Sun Feb 6 16:58:08 2005 UTC
# Line 95  testoutput_for_prop() Line 95  testoutput_for_prop()
95      fi      fi
96      if [ -r $1/$4/output.txt ]; then      if [ -r $1/$4/output.txt ]; then
97          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt
98          lncnt=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l tmp1.txt | awk '{print $1}' `
99          if [ $lncnt -lt 3 ]; then          if [ $lncntA -lt 3 ]; then
100              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
101                  echo Not enough lines of output when searching for "$2" 1>&2                  echo Not enough lines of output when searching for "$2" 1>&2
102              fi              fi
# Line 110  testoutput_for_prop() Line 110  testoutput_for_prop()
110          echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2          echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2
111      fi      fi
112      grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt
113      lncnt=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l tmp2.txt | awk '{print $1}' `
114      if [ $lncnt -lt 3 ]; then      if [ $lncntB -lt 3 ]; then
115          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
116              echo Not enough lines of output when searching for "$2" 1>&2              echo Not enough lines of output when searching for "$2" 1>&2
117          fi          fi
118          return 99          return 99
119      fi      fi
120        if [ $lncntA -ne $lncntB ]; then
121            if [ $verbose -gt 0 ]; then
122                echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2
123            fi
124            return 99
125        fi
126      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
127          echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2          echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2
128      fi      fi
# Line 294  genmakemodel() Line 300  genmakemodel()
300              if test "x$IEEE" != x ; then              if test "x$IEEE" != x ; then
301                  command="$command -ieee"                  command="$command -ieee"
302              fi              fi
303                if test "x$MPI" = xt ; then
304                    command="$command -mpi"
305                fi
306              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
307              $command > make.log 2>&1              $command > make.log 2>&1
308              RETVAL=$?              RETVAL=$?
# Line 450  linkdata() Line 459  linkdata()
459              if test "x$ADM" = x ; then              if test "x$ADM" = x ; then
460                  files=`( cd ../input ; ls -1 | grep -v CVS )`                  files=`( cd ../input ; ls -1 | grep -v CVS )`
461                  for i in $files ; do                  for i in $files ; do
462                      if test ! -d "../input/"$i ; then                      if test ! -d "../input/"$i -a ! -f $i ; then
463                          ln -sf "../input/"$i $i                          ln -sf "../input/"$i $i
464                      fi                      fi
465                  done                  done
# Line 519  createcodelet() Line 528  createcodelet()
528  #include <math.h>  #include <math.h>
529  int main( int argc, char** argv )  {  int main( int argc, char** argv )  {
530    int linnum,best,lncnt;    int linnum,best,lncnt;
531    double a,b,diff;    double a,b,abave,relerr;
532    best = -16;    best = -22;
533    lncnt = 0;    lncnt = 0;
534    while( 1 & (lncnt+=1) < 999 )  {    while( 1 & (lncnt+=1) < 999 )  {
535      scanf("%d", &linnum);      scanf("%d", &linnum);
536      if (linnum == -1)  break;      if (linnum == -1)  break;
537      scanf("%lf", &a);  scanf("%lf", &b);      scanf("%lf", &a);  scanf("%lf", &b);
538      diff = 0.5*(fabs(a)+fabs(b));      abave = 0.5*(fabs(a)+fabs(b));
539      if (diff > 1.e-12) {      if (abave > 0.0) {
540        diff=fabs(a-b)/diff;        relerr=fabs(a-b)/abave;
541        if (diff > 0.0) {        if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); }
542          linnum = (int)log10(diff);        else { linnum = -16 ; }
543          best = (best > linnum) ? best : linnum;        best = (best > linnum) ? best : linnum;
       }  
       else {  
         if (best == -16 && diff != 0)  best = -22;  
       }  
544      }      }
545    }    }
546    if (lncnt == 999) best=-29;    if (lncnt == 999) best=-29;
# Line 543  int main( int argc, char** argv )  { Line 548  int main( int argc, char** argv )  {
548    return 0;    return 0;
549  }  }
550  EOF  EOF
551      cc -o tmp_cmpnum tmp_cmpnum.c -lm      $CC -o tmp_cmpnum tmp_cmpnum.c -lm
552    
553      if [ -x ./tmp_cmpnum ]; then      if [ -x ./tmp_cmpnum ]; then
554          echo "OK"          echo "OK"
555          return 0          return 0
556      else      else
557          echo          echo
558          echo "ERROR: failed to compile comparison code"          echo "ERROR: failed to compile comparison code -- please specify"
559            echo "  a C compiler using the CC environment variable."
560          exit 1          exit 1
561      fi      fi
562  }  }
# Line 639  MPACKDIR="../tools/mpack-1.6" Line 645  MPACKDIR="../tools/mpack-1.6"
645  HAVE_MPACK=  HAVE_MPACK=
646  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
647  COMMAND=  COMMAND=
648  MAKE=make  if test "x$MAKE" = x ; then
649        MAKE=make
650    fi
651    if test "x$CC" = x ; then
652        CC=cc
653    fi
654  JOBS=  JOBS=
655  MPI=f  MPI=f
656  DELDIR=  DELDIR=
# Line 873  for dir in $TESTDIRS ; do Line 884  for dir in $TESTDIRS ; do
884          if test -r $dir/input/Makefile ; then          if test -r $dir/input/Makefile ; then
885              ( cd $dir/input ; make CLEAN )              ( cd $dir/input ; make CLEAN )
886          fi          fi
887            (
888                cd $dir
889                rm -rf tr_run.*
890            )
891          continue          continue
892      fi      fi
893    
# Line 881  for dir in $TESTDIRS ; do Line 896  for dir in $TESTDIRS ; do
896      fout=      fout=
897      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
898          fout=$dir"/results/output.txt"          fout=$dir"/results/output.txt"
         check_for_add_mon_output  $fout  
899      else      else
900          fout=$dir"/results_ad/output.txt_adm"          fout=$dir"/results_ad/output.txt_adm"
901      fi      fi
# Line 889  for dir in $TESTDIRS ; do Line 903  for dir in $TESTDIRS ; do
903          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
904          continue          continue
905      fi      fi
906        if test "x$ADM" = x ; then
907            check_for_add_mon_output  $fout
908        fi
909    
910      # Check for additional types of monitor output      # Check for additional types of monitor output
911    
# Line 966  for dir in $TESTDIRS ; do Line 983  for dir in $TESTDIRS ; do
983          echo "DATE='$DATE'" >> $CDIR"/summary.txt"          echo "DATE='$DATE'" >> $CDIR"/summary.txt"
984          echo "tdir='$dir'" >> $CDIR"/summary.txt"          echo "tdir='$dir'" >> $CDIR"/summary.txt"
985    
         OLD_COMMAND=$COMMAND  
         COMMAND="./mitgcmuv > output.txt"  
986          for ex in $extra_runs ; do          for ex in $extra_runs ; do
987              test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex"              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"
988              mkdir "$dir/tr_run.$ex"              for ldir in input.$ex input ; do
989              links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`                  (
990                        cd "$dir/$ldir" > /dev/null 2>&1
991                        ls -1 2>/dev/null \
992                            | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g'
993                    ) > tr_exrun_links
994                    (
995                        cd "$dir/tr_run.$ex"
996                        cat ../../tr_exrun_links | while read i ; do
997                            if test ! "x$i" = x ; then
998                                test ! -r $i  &&  ln -s "../"$ldir"/"$i $i
999                            fi
1000                        done
1001                    )
1002                    test -e tr_exrun_links  &&  rm -f tr_exrun_links
1003                done
1004                ldir=build
1005                (
1006                    cd "$dir/$ldir" > /dev/null 2>&1
1007                    ls -1 Makefile *.[fFhco] mitgcmuv  2>/dev/null \
1008                        | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g'
1009                ) > tr_exrun_links
1010              (              (
1011                  cd "$dir/tr_run.$ex"                  cd "$dir/tr_run.$ex"
1012                  for i in $links; do                      cat ../../tr_exrun_links | while read i ; do
1013                      ln -s ../input/$i $i                          if test ! "x$i" = x ; then
1014                  done                              test ! -r $i  &&  ln -s "../"$ldir"/"$i $i
1015              )                          fi
1016              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  
1017              )              )
1018                test -e tr_exrun_links  &&  rm -f tr_exrun_links
1019              runmodel $dir/tr_run.$ex && run=Y \              runmodel $dir/tr_run.$ex && run=Y \
1020                  && results=`testoutput $dir tr_run.$ex "."$ex`                  && results=`testoutput $dir tr_run.$ex "."$ex`
1021              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 1000  for dir in $TESTDIRS ; do Line 1029  for dir in $TESTDIRS ; do
1029              echo "DATE='$DATE'" >> $CDIR"/summary.txt"              echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1030              echo "tdir='$dir'" >> $CDIR"/summary.txt"              echo "tdir='$dir'" >> $CDIR"/summary.txt"
1031          done          done
         COMMAND=$OLD_COMMAND  
1032      else      else
1033          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}`
1034          fres=$fres"$results   $dir"          fres=$fres"$results   $dir"
# Line 1053  fi Line 1081  fi
1081  rm -f tmp_cmpnum.c tmp_cmpnum  rm -f tmp_cmpnum.c tmp_cmpnum
1082    
1083  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1084      cat $SUMMARY      cat $SUMMARY | sed 's/ -- -- -- --//g'
1085      if test -e tr_out.txt ; then      if test -e tr_out.txt ; then
1086          mv tr_out.txt tr_out.txt.old          mv tr_out.txt tr_out.txt.old
1087      fi      fi
1088      cat $SUMMARY > tr_out.txt      cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt
1089  fi  fi
1090    
1091  if test "x$DELDIR" = xt ; then  if test "x$DELDIR" = xt ; then

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.67

  ViewVC Help
Powered by ViewVC 1.1.22