/[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.22 by edhill, Sat Nov 29 00:58:43 2003 UTC revision 1.25 by edhill, Thu Dec 4 16:36:18 2003 UTC
# Line 22  usage() Line 22  usage()
22      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"
23      echo "                             Bourne-compatible \"sh\" shell"      echo "                             Bourne-compatible \"sh\" shell"
24      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
25        echo "  (-adm|-ad)               perform an adjoint run"
26      echo "  (-command) STRING        command to run"      echo "  (-command) STRING        command to run"
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\""
# Line 54  build_mpack() Line 55  build_mpack()
55              HAVE_MPACK=f              HAVE_MPACK=f
56          fi          fi
57          echo -n "building mpack...  "          echo -n "building mpack...  "
58          ( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1          ( cd $MPACKDIR && ./configure && $MAKE ) > tr_build_mpack.out 2>&1
59          RETVAL=$?          RETVAL=$?
60          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
61              echo              echo
# Line 62  build_mpack() Line 63  build_mpack()
63              echo              echo
64              HAVE_MPACK=f              HAVE_MPACK=f
65          else          else
66                rm -f tr_build_mpack.out
67              HAVE_MPACK=t              HAVE_MPACK=t
68          fi          fi
69      else      else
# Line 70  build_mpack() Line 72  build_mpack()
72      echo "OK"      echo "OK"
73  }  }
74    
 compare_lines()  
 {  
     # use codelet to compare lines  
     if [ $verbose -gt 1 ]; then  
         cat tmp3.txt 1>&2  
     fi  
     return `./a.out < tmp3.txt`  
 }  
   
75  testoutput_for_prop()  testoutput_for_prop()
76  {  {
77      # testoutput_for_prop dir s1 label subdir      # testoutput_for_prop dir s1 label subdir
# Line 124  testoutput_for_prop() Line 117  testoutput_for_prop()
117          cat tmp3.txt 1>&2          cat tmp3.txt 1>&2
118      fi      fi
119      echo "-1" >> tmp3.txt      echo "-1" >> tmp3.txt
120      digits_of_similarity=`./tmp_cmpnum < tmp3.txt`      # On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number
121        cat tmp3.txt | sed -e 's|:||g' > tmp4.txt
122        digits_of_similarity=`./tmp_cmpnum < tmp4.txt`
123      if [ $digits_of_similarity -eq 99 ]; then      if [ $digits_of_similarity -eq 99 ]; then
124          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
125              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 135  testoutput_for_prop() Line 130  testoutput_for_prop()
130              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
131          fi          fi
132      fi      fi
133      rm tmp1.txt tmp2.txt tmp3.txt      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt
134            
135      return $digits_of_similarity      return $digits_of_similarity
136  }  }
# Line 155  dashnum() Line 150  dashnum()
150      done      done
151  }  }
152    
153    testoutput_ad()
154    {
155        grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $5}' > t05.txt
156        grep $3 $1/$2/output.txt_adm | awk '{print NR " " $5}' > t15.txt
157        grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $6}' > t06.txt
158        grep $3 $1/$2/output.txt_adm | awk '{print NR " " $6}' > t16.txt
159        join t05.txt t15.txt > t5.txt
160        join t06.txt t16.txt > t6.txt
161        echo "-1" >> t5.txt
162        echo "-1" >> t6.txt
163        digits_5=`./tmp_cmpnum < t5.txt`
164        digits_6=`./tmp_cmpnum < t6.txt`
165        dashnum $digits_5 $digits_6
166        rm -f t[01][56].txt t[56].txt
167    }
168    
169  testoutput()  testoutput()
170  {  {
171      # testoutput diretory subdir      # testoutput directory subdir
172      #      #
173      #  test output in "directory"      #  test output in "directory"
174        if test "x$ADM" = x ; then
175      if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
176          echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2
177      fi          fi
178      testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2; cg2dres=$?          testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2; cg2dres=$?
179      if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
180          echo testoutput: cg2dres=$cg2dres 1>&2              echo testoutput: cg2dres=$cg2dres 1>&2
181            fi
182            testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?
183            testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?
184            testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?
185            testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2; tsd=$?
186            testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$?
187            testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$?
188            testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2; smean=$?
189            testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2; ssd=$?
190            testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$?
191            testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$?
192            testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2; umean=$?
193            testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2; usd=$?
194            testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$?
195            testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$?
196            testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2; vmean=$?
197            testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2; vsd=$?
198            dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \
199                $umin $umax $umean $usd $vmin $vmax $vmean $vsd
200        else
201            testoutput_ad $1 $2 "precision_grdchk_result"
202      fi      fi
     testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?  
     testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?  
     testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?  
     testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2; tsd=$?  
     testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$?  
     testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$?  
     testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2; smean=$?  
     testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2; ssd=$?  
     testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$?  
     testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$?  
     testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2; umean=$?  
     testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2; usd=$?  
     testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$?  
     testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$?  
     testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2; vmean=$?  
     testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2; vsd=$?  
       
     dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \  
         $umin $umax $umean $usd $vmin $vmax $vmean $vsd  
203  }  }
204    
205  genmakemodel()  genmakemodel()
# Line 198  genmakemodel() Line 211  genmakemodel()
211          GENMAKE2="$BASH ../../../tools/genmake2"          GENMAKE2="$BASH ../../../tools/genmake2"
212          (          (
213              cd $1;              cd $1;
214              command="$GENMAKE2  -ds -m $MAKE --mods=../code"              command="$GENMAKE2  -ds -m $MAKE"
215                if test "x$ADM" = x ; then
216                    command="$command --mods=../code"
217                else
218                    command="$command --mods=../code_ad"
219                    command="$command -adof=../../../tools/adjoint_options/adjoint_staf"
220                fi
221              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
222                  command="$command --optfile=$OPTFILE"                  command="$command --optfile=$OPTFILE"
223              fi              fi
# Line 279  makemodel() Line 298  makemodel()
298          cd $1;          cd $1;
299          if test -r Makefile ; then          if test -r Makefile ; then
300              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
301              $MAKE >> make.log 2>&1              if test "x$ADM" = x ; then
302                    $MAKE >> make.log 2>&1
303                else
304                    $MAKE adall >> make.log 2>&1
305                fi
306              RETVAL=$?              RETVAL=$?
307              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
308                  tail make.log                  tail make.log
# Line 301  linkdata() Line 324  linkdata()
324      if test "x$1" = x1 ; then      if test "x$1" = x1 ; then
325          (          (
326              cd $2              cd $2
327              files=`( cd ../input ; ls -1 | grep -v CVS )`              if test "x$ADM" = x ; then
328              for i in $files ; do                  files=`( cd ../input ; ls -1 | grep -v CVS )`
329                  if test ! -d "../input/"$i ; then                  for i in $files ; do
330                      ln -sf "../input/"$i $i                      if test ! -d "../input/"$i ; then
331                  fi                          ln -sf "../input/"$i $i
332              done                      fi
333                    done
334                else
335                    files=`( cd ../input ; ls -1 *.bin | grep -v CVS )`
336                    for i in $files ; do
337                        if test ! -d "../input/"$i ; then
338                            ln -sf "../input/"$i $i
339                        fi
340                    done
341                    files=`( cd ../input_ad ; ls -1 | grep -v CVS )`
342                    for i in $files ; do
343                        if test ! -d "../input_ad/"$i ; then
344                            ln -sf "../input_ad/"$i $i
345                        fi
346                    done
347                fi
348          )          )
349      fi      fi
350  }  }
# Line 315  runmodel() Line 353  runmodel()
353  {  {
354      # runmodel directory      # runmodel directory
355      #      #
356      #  runs "$COMMAND" in "directory"      #  runs "$COMMAND in "directory"
357      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
358      (      (
359          cd $1          cd $1
# Line 325  runmodel() Line 363  runmodel()
363          RETVAL=$?          RETVAL=$?
364          if test "x$RETVAL" = x0 ; then          if test "x$RETVAL" = x0 ; then
365              echo successful 1>&2              echo successful 1>&2
366              cp output.txt $CDIR"/output.txt"              if test "x$ADM" = x ; then
367                    cp output.txt $CDIR"/output.txt"
368                else
369                    cp output.txt_adm $CDIR"/output.txt_adm"
370                fi
371              return 0              return 0
372          else          else
373              tail run.log              tail run.log
# Line 463  TESTDIRS= Line 505  TESTDIRS=
505  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
506  HAVE_MPACK=  HAVE_MPACK=
507  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
508  COMMAND="make output.txt"  COMMAND=
509  MAKE=make  MAKE=make
510  MPI=f  MPI=f
511    
512    ADM=
513    
514  echo -n "parsing options...  "  echo -n "parsing options...  "
515    
516  ac_prev=  ac_prev=
# Line 530  for ac_option ; do Line 574  for ac_option ; do
574    
575          -mpi) MPI=t ;;          -mpi) MPI=t ;;
576    
577            -adm | -ad) ADM=t ;;
578    
579          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
580          -noieee) IEEE= ;;          -noieee) IEEE= ;;
581    
# Line 565  if test "x$OPTFILE" = xNONE -a "x$MITGCM Line 611  if test "x$OPTFILE" = xNONE -a "x$MITGCM
611      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
612  fi  fi
613    
614    if test "x$ADM" = xt -a "x$COMMAND" = x ; then
615        COMMAND="./mitgcmuv_ad > output.txt_adm 2>&1"
616    fi
617    
618    if test "x$COMMAND" = x ; then
619        COMMAND="make output.txt"
620    fi
621    
622  echo "OK"  echo "OK"
623    
624  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
# Line 577  build_mpack Line 631  build_mpack
631  MACH=`hostname`  MACH=`hostname`
632  UNAMEA=`uname -a`  UNAMEA=`uname -a`
633  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
634  BASE=$MACH"_"$DATE"_"  BASE="tr_"$MACH"_"$DATE"_"
635  DNUM=0  DNUM=0
636  DRESULTS="$BASE$DNUM"  DRESULTS="$BASE$DNUM"
637  while test -e $DRESULTS ; do  while test -e $DRESULTS ; do
# Line 622  else Line 676  else
676  fi  fi
677  echo  echo
678  echo >> $SUMMARY  echo >> $SUMMARY
679  cat << EOF | tee -a $SUMMARY  if test "x$ADM" = x ; then
680        cat << EOF | tee -a $SUMMARY
681                  T           S           U           V                  T           S           U           V
682  G D M    c        m  s        m  s        m  s        m  s  G D M    c        m  s        m  s        m  s        m  s
683  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
# Line 630  N n k u  2  i  a  a  d  i  a  a  d  i  a Line 685  N n k u  2  i  a  a  d  i  a  a  d  i  a
685  2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .
686    
687  EOF  EOF
688    else
689        echo "ADJOINT=true" >> $SUMMARY
690        echo >> $SUMMARY
691        cat << EOF | tee -a $SUMMARY
692    G D M    C  G
693    E p a R  o  r
694    N n k u  s  a
695    2 d e n  t  d
696    
697    EOF
698    fi
699    
700  #  ...and each test directory...  #  ...and each test directory...
701  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
# Line 647  for dir in $TESTDIRS ; do Line 713  for dir in $TESTDIRS ; do
713    
714      #  Verify that the testdir exists and contains previous      #  Verify that the testdir exists and contains previous
715      #  results in the correct location--or skip this directory!      #  results in the correct location--or skip this directory!
716      if test ! -r $dir"/results/output.txt" ; then      fout=
717          echo "can't read \"$dir/results/output.txt\" -- skipping $dir"      if test "x$ADM" = x ; then
718            fout=$dir"/results/output.txt"
719        else
720            fout=$dir"/results_ad/output.txt_adm"
721        fi
722        if test ! -r $fout ; then
723            echo "can't read \"$fout\" -- skipping $dir"
724          continue          continue
725      fi      fi
726    
# Line 669  for dir in $TESTDIRS ; do Line 741  for dir in $TESTDIRS ; do
741          linkdata $use_seperate_build $dir/$rundir          linkdata $use_seperate_build $dir/$rundir
742      fi      fi
743            
744      CODE_DIR=$dir/code      if test "x$ADM" = x ; then
745            CODE_DIR=$dir/code
746        else
747            CODE_DIR=$dir/code_ad
748        fi
749      BUILD_DIR=$dir/$builddir      BUILD_DIR=$dir/$builddir
750      MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"      MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"
751      NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"      NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"
# Line 727  for dir in $TESTDIRS ; do Line 803  for dir in $TESTDIRS ; do
803      fi      fi
804            
805      echo      echo
806      fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`      if test "x$ADM" = x ; then
807            fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
808        else
809            fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
810            fres=$fres"$results   $dir"
811        fi
812      echo      echo
813      echo "$fres" >> $SUMMARY      echo "$fres" >> $SUMMARY
814      echo "fresults='$fres'" > $CDIR"/summary.txt"      echo "fresults='$fres'" > $CDIR"/summary.txt"
# Line 777  rm -f tmp_cmpnum.c tmp_cmpnum Line 858  rm -f tmp_cmpnum.c tmp_cmpnum
858    
859  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
860      cat $SUMMARY      cat $SUMMARY
861      if test -e tr.out ; then      if test -e tr_out.txt ; then
862          mv tr.out tr.out.old          mv tr_out.txt tr_out.txt.old
863      fi      fi
864      cat $SUMMARY > tr.out      cat $SUMMARY > tr_out.txt
865  fi  fi
866    

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.22