/[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.20 by edhill, Wed Nov 26 15:04:42 2003 UTC revision 1.23 by edhill, Sat Nov 29 01:45:25 2003 UTC
# Line 70  build_mpack() Line 70  build_mpack()
70      echo "OK"      echo "OK"
71  }  }
72    
 compare_lines()  
 {  
     # use codelet to compare lines  
     if [ $verbose -gt 1 ]; then  
         cat tmp3.txt 1>&2  
     fi  
     return `./a.out < tmp3.txt`  
 }  
   
73  testoutput_for_prop()  testoutput_for_prop()
74  {  {
75      # testoutput_for_prop dir s1 label subdir      # testoutput_for_prop dir s1 label subdir
# Line 120  testoutput_for_prop() Line 111  testoutput_for_prop()
111      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
112          echo testoutput_for_prop: compare_lines 1>&2          echo testoutput_for_prop: compare_lines 1>&2
113      fi      fi
114      compare_lines      if [ $verbose -gt 1 ]; then
115      digits_of_similarity=$?          cat tmp3.txt 1>&2
116        fi
117        echo "-1" >> tmp3.txt
118        # On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number
119        cat tmp3.txt | sed -e 's|:||g' > tmp4.txt
120        digits_of_similarity=`./tmp_cmpnum < tmp4.txt`
121      if [ $digits_of_similarity -eq 99 ]; then      if [ $digits_of_similarity -eq 99 ]; then
122          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
123              echo testoutput_for_prop: No comparison was available for \"$2\" 1>&2              echo testoutput_for_prop: No comparison was available for \"$2\" 1>&2
# Line 132  testoutput_for_prop() Line 128  testoutput_for_prop()
128              echo There were $digits_of_similarity decimal places of similarity for \"$2\" 1>&2              echo There were $digits_of_similarity decimal places of similarity for \"$2\" 1>&2
129          fi          fi
130      fi      fi
131      rm tmp1.txt tmp2.txt tmp3.txt      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt
132            
133      return $digits_of_similarity      return $digits_of_similarity
134  }  }
# Line 198  genmakemodel() Line 194  genmakemodel()
194              command="$GENMAKE2  -ds -m $MAKE --mods=../code"              command="$GENMAKE2  -ds -m $MAKE --mods=../code"
195              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
196                  command="$command --optfile=$OPTFILE"                  command="$command --optfile=$OPTFILE"
                 # echo "  command=\"$command\""  
197              fi              fi
198              if test "x$IEEE" != x ; then              if test "x$IEEE" != x ; then
199                  command="$command -ieee"                  command="$command -ieee"
200              fi              fi
             # echo "command: \"$command\""  
201              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
202              $command > make.log 2>&1              $command > make.log 2>&1
203              RETVAL=$?              RETVAL=$?
204              for i in genmake_state genmake_optfile genmake_local Makefile ; do              cp Makefile $CDIR
                 if test -r $i ; then  
                     cp $i $CDIR  
                 fi  
             done  
205              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
206                  tail make.log                  tail make.log
207                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed" 1>&2
208                  cp make.log $CDIR                  cp genmake_* make.log $CDIR
209                  return 1                  return 1
210              else              else
211                  echo "successful" 1>&2                  echo "successful" 1>&2
# Line 344  createcodelet() Line 334  createcodelet()
334      # create codelet for comparing model output      # create codelet for comparing model output
335    
336      echo -n "creating the comparison code...  "      echo -n "creating the comparison code...  "
337      cat > tmp_cmpnum.f <<EOFA      cat > tmp_cmpnum.c <<EOF
338        program cmpnum  #include <stdio.h>
339        implicit none  #include <math.h>
340        real*8 a,b,diff  int main( int argc, char** argv )  {
341        integer linnum,best    int linnum,best;
342        best=-16    double a,b,diff;
343    99  read(*,*,end=70,err=60) linnum,a,b    best = -16;
344        diff=0.5*(abs(a)+abs(b))    while( 1 )  {
345  c     print *,a,b,diff,abs(a-b)/diff      scanf("%d", &linnum);
346        if (diff.gt.1.e-12) then      if (linnum == -1)  break;
347          diff=abs(a-b)/diff      scanf("%lf", &a);  scanf("%lf", &b);
348          if (diff.gt.0.) then      diff = 0.5*(fabs(a)+fabs(b));
349  c         print *,int(log10(diff)),diff      if (diff > 1.e-12) {
350            linnum=int(log10(diff))        diff=fabs(a-b)/diff;
351            best=max(best,linnum)        if (diff > 0.0) {
352          endif          linnum = (int)log10(diff);
353        else          best = (best > linnum) ? best : linnum;
354          if (best.eq.-16.and.diff.ne.0.) best=-22        }
355        endif        else {
356        goto 99          if (best == -16 && diff != 0)  best = -22;
357    60  stop 'cmpnum: An error occured reading a,b'        }
358    70  print *,-best      }
359        end    }
360  EOFA    printf("%d\n", -best);
361      return 0;
362    }
363    EOF
364        cc -o tmp_cmpnum tmp_cmpnum.c -lm
365    
366      f77 tmp_cmpnum.f      if [ -x ./tmp_cmpnum ]; then
     if [ -x ./a.out ]; then  
367          echo "OK"          echo "OK"
368          return 0          return 0
369      else      else
370          echo          echo
371          echo "createcodelet: failed to compile codelet"          echo "ERROR: failed to compile comparison code"
372          exit 1          exit 1
373      fi      fi
374  }  }
# Line 435  scandirs() Line 428  scandirs()
428    
429    
430  ###############################################################################  ###############################################################################
 ###############################################################################  
 ###############################################################################  
431    
432    
433  #  Default properties  #  Default properties
# Line 596  SUMMARY="$DRESULTS/summary.txt" Line 587  SUMMARY="$DRESULTS/summary.txt"
587  echo -n "Start time:  " >> $SUMMARY  echo -n "Start time:  " >> $SUMMARY
588  start_date=`date`  start_date=`date`
589  echo $start_date > $SUMMARY  echo $start_date > $SUMMARY
 cat << EOF | tee -a $SUMMARY  
                 T           S           U           V  
 G D M    c        m  s        m  s        m  s        m  s  
 E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  
 N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d  
 2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  
   
 EOF  
   
 NDIR=0  
590    
591  of_path=  of_path=
592  if test "x$OPTFILE" != xNONE ; then  if test "x$OPTFILE" != xNONE ; then
# Line 619  if test "x$OPTFILE" != xNONE ; then Line 600  if test "x$OPTFILE" != xNONE ; then
600          fi          fi
601          file=${OPTFILE##*/}          file=${OPTFILE##*/}
602          OPTFILE=$of_path/$file          OPTFILE=$of_path/$file
603            cp $OPTFILE $DRESULTS
604            echo >> $SUMMARY
605            echo "  OPTFILE=$OPTFILE" >> $SUMMARY
606      else      else
607          echo          echo | tee $SUMMARY
608          echo "WARNING: can't read OPTFILE=\"$OPTFILE\" but will try to use it..."          echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee $SUMMARY
609            exit 1
610      fi      fi
611    else
612        echo >> $SUMMARY
613        echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY
614        echo "   so the genmake default will be used." >> $SUMMARY
615  fi  fi
616  echo  echo
 echo "OPTFILE=$OPTFILE" >> $SUMMARY  
617  echo >> $SUMMARY  echo >> $SUMMARY
618    cat << EOF | tee -a $SUMMARY
619                    T           S           U           V
620    G D M    c        m  s        m  s        m  s        m  s
621    E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
622    N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
623    2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .
624    
625    EOF
626    
627  #  ...and each test directory...  #  ...and each test directory...
628  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
# Line 724  for dir in $TESTDIRS ; do Line 720  for dir in $TESTDIRS ; do
720      fi      fi
721            
722      echo      echo
723      formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \      fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
         ${run:-N} $results  
724      echo      echo
725      formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \      echo "$fres" >> $SUMMARY
726          ${run:-N} $results >> $SUMMARY      echo "fresults='$fres'" > $CDIR"/summary.txt"
     echo "fresults='" > $CDIR"/summary.txt"  
     formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \  
         ${run:-N} $results >> $CDIR"/summary.txt"  
     echo "'" >> $CDIR"/summary.txt"  
727      echo "MACH='$MACH'" >> $CDIR"/summary.txt"      echo "MACH='$MACH'" >> $CDIR"/summary.txt"
728      echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"      echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
729      echo "DATE='$DATE'" >> $CDIR"/summary.txt"      echo "DATE='$DATE'" >> $CDIR"/summary.txt"
# Line 740  for dir in $TESTDIRS ; do Line 731  for dir in $TESTDIRS ; do
731            
732      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
733            
     NDIR=$(( $NDIR + 1 ))  
       
734  done  done
735    
736  echo -n "Start time:  " >> $SUMMARY  echo -n "Start time:  " >> $SUMMARY
# Line 776  else Line 765  else
765      fi      fi
766  fi  fi
767    
768  rm tmp_cmpnum.f a.out  # rm -f tmp_cmpnum.f a.out
769    rm -f tmp_cmpnum.c tmp_cmpnum
770    
771  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
772      cat $SUMMARY      cat $SUMMARY

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.22