/[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.138 by jmc, Tue Mar 30 16:40:03 2010 UTC revision 1.141 by jmc, Wed Jun 23 18:46:43 2010 UTC
# Line 33  usage() Line 33  usage()
33      echo "  (-adm|-ad)               perform an adjoint run"      echo "  (-adm|-ad)               perform an adjoint run"
34      echo "  (-oad)                   perform an OpenAD adjoint run"      echo "  (-oad)                   perform an OpenAD adjoint run"
35      echo "  (-command|-c) STRING     command to run"      echo "  (-command|-c) STRING     command to run"
36        echo "  (-makedepend|-md) STRING command to use for \"makedepend\""
37      echo "  (-make|-m) STRING        command to use for \"make\""      echo "  (-make|-m) STRING        command to use for \"make\""
38      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
39      echo "  (-odir) STRING           used to build output directory name"      echo "  (-odir) STRING           used to build output directory name"
# Line 40  usage() Line 41  usage()
41      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
42      echo "                             (DEF=\"1 2 3 4 5\")"      echo "                             (DEF=\"1 2 3 4 5\")"
43      echo "  (-match) NUMBER          Matching Criteria (number of digits)"      echo "  (-match) NUMBER          Matching Criteria (number of digits)"
44      echo "                             (DEF=\"12\")"      echo "                             (DEF=\"$MATCH_CRIT\")"
45      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
46      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
47      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"
# Line 317  genmakemodel() Line 318  genmakemodel()
318          (          (
319              cd $1;              cd $1;
320              command="$GENMAKE2  -ds -m $MAKE"              command="$GENMAKE2  -ds -m $MAKE"
321                if test "x$MKDEPEND" != x ; then
322                    command="$command -makedepend=$MKDEPEND"
323                fi
324              if test "x$ADM" = xt ; then              if test "x$ADM" = xt ; then
325                  command="$command --mods=../code_ad"                  command="$command --mods=../code_ad"
326              elif test "x$OADM" = xt ; then              elif test "x$OADM" = xt ; then
# Line 353  genmakemodel() Line 357  genmakemodel()
357                  command="$command -pcls"                  command="$command -pcls"
358              fi              fi
359              fi              fi
360              printf 'genmake ... ' 1>&2              printf 'genmake ... '
             # $command > make.log 2>&1  
361              eval $command > make.log 2>&1              eval $command > make.log 2>&1
362              RETVAL=$?              RETVAL=$?
363              #  Reduce the size of the testing emails!              #  Reduce the size of the testing emails!
364              head -100 Makefile > $CDIR/Makefile_head              head -100 Makefile > $CDIR/Makefile_head
365              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
366                  tail make.log                  tail make.log
367                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed"
368                  cp genmake_* make.log $CDIR                  cp genmake_* make.log $CDIR
369                  return 1                  return 1
370              else              else
371                  echo "successful" 1>&2                  echo "successful"
372              fi              fi
373          )          )
374      fi      fi
# Line 381  makeclean() Line 384  makeclean()
384              cd $1;              cd $1;
385              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi
386              if test -r Makefile ; then              if test -r Makefile ; then
387                  printf 'clean build-dir: make Clean ... ' 2>&1                  printf 'clean build-dir: make Clean ... '
388                  $MAKE Clean >> make.log 2>&1                  $MAKE Clean >> make.log 2>&1
389                  RETVAL=$?                  RETVAL=$?
390                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
391                      tail make.log                      tail make.log
392                      echo "makeclean: \"make Clean\" failed" 1>&2                      echo "makeclean: \"make Clean\" failed"
393                      cp make.log $CDIR"/make.log"                      cp make.log $CDIR"/make.log"
394                      return 1                      return 1
395                  fi                  fi
396                  echo successful 1>&2                  echo successful
397              else              else
398                  echo ''                  echo ''
399              fi              fi
# Line 407  run_clean() Line 410  run_clean()
410      else      else
411          (          (
412              cd $1;              cd $1;
413              printf 'clean run-dir ... ' 2>&1              printf 'clean run-dir ... '
414              # part of what is done after "make clean" when doing "make CLEAN"              # part of what is done after "make clean" when doing "make CLEAN"
415              find . -name "*.meta" -exec rm {} \;              find . -name "*.meta" -exec rm {} \;
416              find . -name "*.data" -exec rm {} \;              find . -name "*.data" -exec rm {} \;
# Line 416  run_clean() Line 419  run_clean()
419              rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime              rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime
420              rm -rf mnc_test_*              rm -rf mnc_test_*
421              rm -f *_MIT_CE_000.opt0000 costfunction*0000              rm -f *_MIT_CE_000.opt0000 costfunction*0000
422              echo successful 1>&2              echo successful
423              exit 0              exit 0
424          )          )
425      fi      fi
# Line 430  makedependmodel() Line 433  makedependmodel()
433      else      else
434          (          (
435              cd $1;              cd $1;
436              printf 'make depend ... ' 1>&2              printf 'make depend ... '
437              $MAKE depend >> make.log 2>&1              $MAKE depend >> make.log 2>&1
438              RETVAL=$?              RETVAL=$?
439              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
440                  tail make.log                  tail make.log
441                  echo "makedependmodel: make depend failed" 1>&2                  echo "makedependmodel: make depend failed"
442                  cp make.log $CDIR"/make.log"                  cp make.log $CDIR"/make.log"
443                  return 1                  return 1
444              else              else
445                  echo successful 1>&2                  echo successful
446              fi              fi
447          )          )
448      fi      fi
# Line 460  makemodel() Line 463  makemodel()
463      else      else
464          cd $1;          cd $1;
465          if test -r Makefile ; then          if test -r Makefile ; then
466              printf 'make ... ' 1>&2              printf 'make ... '
467              if test "x$ADM" = xt ; then              if test "x$ADM" = xt ; then
468                  $MAKE adall >> make.log 2>&1                  $MAKE adall >> make.log 2>&1
469              elif test "x$OADM" = xt ; then              elif test "x$OADM" = xt ; then
# Line 475  makemodel() Line 478  makemodel()
478              RETVAL=$?              RETVAL=$?
479              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
480                  tail make.log                  tail make.log
481                  echo failed 1>&2                  echo failed
482                  cp make.log $CDIR"/make.log"                  cp make.log $CDIR"/make.log"
483                  rm -f $EXECUTABLE                  rm -f $EXECUTABLE
484                  return 1                  return 1
485              else              else
486                  echo successful 1>&2                  echo successful
487              fi              fi
488          fi          fi
489      fi      fi
# Line 543  linkdata() Line 546  linkdata()
546      if test -d $1 ; then      if test -d $1 ; then
547          (          (
548              cd $1 ; shift              cd $1 ; shift
549                echo 'linkdata from dirs:' $*
550              inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')`              inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')`
551              for xx in $inpMPI ; do              for xx in $inpMPI ; do
552                if test -r "../"$1"/"$xx ; then                if test -r "../"$1"/"$xx ; then
# Line 553  linkdata() Line 557  linkdata()
557                      if test -h $yy ; then rm -f $yy ; fi                      if test -h $yy ; then rm -f $yy ; fi
558                      if test ! -r $yy ; then                      if test ! -r $yy ; then
559                          ln -sf "../"$1"/"$xx $yy ;                          ln -sf "../"$1"/"$xx $yy ;
560                          printf "$xx " 1>&2                          printf " $xx" 1>&2
561                      fi                      fi
562                  else                  else
563                  # not mpi test: remove symbolic link                  # not mpi test: remove symbolic link
# Line 568  linkdata() Line 572  linkdata()
572                      if test -h eedata ; then rm -f eedata ; fi                      if test -h eedata ; then rm -f eedata ; fi
573                      if test ! -r eedata ; then                      if test ! -r eedata ; then
574                          ln -sf "../"$1"/eedata.mth" eedata ;                          ln -sf "../"$1"/eedata.mth" eedata ;
575                          printf 'eedata.mth ' 1>&2                          printf ' eedata.mth' 1>&2
576                      fi                      fi
577                  else                  else
578                  # not multi-threaded test: remove eedata symbolic link                  # not multi-threaded test: remove eedata symbolic link
# Line 578  linkdata() Line 582  linkdata()
582              prevDir='NONE'              prevDir='NONE'
583              for ldir in $* ; do              for ldir in $* ; do
584                  if test -d "../"$ldir -a $ldir != $prevDir ; then                  if test -d "../"$ldir -a $ldir != $prevDir ; then
585                      printf 'ldir='${ldir} 1>&2                      printf " ldir=${ldir}:" 1>&2
586                      files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`                      files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`
587                      for i in $files ; do                      for i in $files ; do
588                          if test ! -d "../"$ldir/$i ; then                          if test ! -d "../"$ldir/$i ; then
# Line 588  linkdata() Line 592  linkdata()
592                              fi                              fi
593                          fi                          fi
594                      done                      done
595                        printf ' ;' 1>&2
596                      if test -x "../"$ldir"/"prepare_run ; then                      if test -x "../"$ldir"/"prepare_run ; then
597                          "../"$ldir"/"prepare_run                          "../"$ldir"/"prepare_run 1>&2
598                        else
599                            echo '' 1>&2
600                      fi                      fi
                     printf ' ; ' 1>&2  
601                  fi                  fi
602                  prevDir=$ldir                  prevDir=$ldir
603              done              done
# Line 607  runmodel() Line 613  runmodel()
613      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
614      (      (
615          cd $1          cd $1
616          printf 'runmodel in %s ...' $1 1>&2          printf 'runmodel in %s ... ' $1
         # make output.txt  
         echo  
617          if test -L $EXECUTABLE ; then          if test -L $EXECUTABLE ; then
618            if test -x "../"$builddir"/"$EXECUTABLE ; then            if test -x "../"$builddir"/"$EXECUTABLE ; then
619              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
# Line 650  runmodel() Line 654  runmodel()
654          fi          fi
655          rm -f run.log_tmp          rm -f run.log_tmp
656          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
657              tail $RUNLOG              echo successful
658              echo successful 1>&2              printf '=> output from running in %s :\n' $1 1>&2
659                tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
660              # === Reduce the size of the testing emails!              # === Reduce the size of the testing emails!
661              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE
662              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
663              return 0              return 0
664          elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then          elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then
665              #-- for some weird cases (run is finihed but with error code)              #-- for some weird cases (run is finihed but with error code)
666              tail $RUNLOG              echo 'finished with error (run:' $RETVAL ' end:' $ENDVAL ')'
667              echo finished with error '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2              printf '=> output from running in %s :\n' $1 1>&2
668                tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
669              return 0              return 0
670          else          else
671              tail $RUNLOG              echo 'failed (run:' $RETVAL ' end:' $ENDVAL ')'
672              echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2              printf '=> output from running in %s :\n' $1 1>&2
673                tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
674              cp $RUNLOG $CDIR"/"$RUNLOG              cp $RUNLOG $CDIR"/"$RUNLOG
675              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
676              return 1              return 1
# Line 826  MPACKDIR="../tools/mpack-1.6" Line 833  MPACKDIR="../tools/mpack-1.6"
833  HAVE_MPACK=  HAVE_MPACK=
834  MPACK=  MPACK=
835  COMMAND=  COMMAND=
836    MKDEPEND=
837  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
838      MAKE=make      MAKE=make
839  fi  fi
# Line 900  for ac_option ; do Line 908  for ac_option ; do
908          -command=* | --command=* | -c=* | --c=*)          -command=* | --command=* | -c=* | --c=*)
909              COMMAND=$ac_optarg ;;              COMMAND=$ac_optarg ;;
910    
911            -makedepend | --makedepend | -md | --md)
912                ac_prev=MKDEPEND ;;
913            -makedepend=* | --makedepend=* | -md=* | --md=*)
914                MKDEPEND=$ac_optarg ;;
915    
916          -make | --make | -m | --m)          -make | --make | -m | --m)
917              ac_prev=MAKE ;;              ac_prev=MAKE ;;
918          -make=* | --make=* | -m=* | --m=*)          -make=* | --make=* | -m=* | --m=*)
# Line 1155  if test "x$ADM" = x -a "x$OADM" = x; the Line 1168  if test "x$ADM" = x -a "x$OADM" = x; the
1168      then line_0="default  "$MATCH_CRIT ;      then line_0="default  "$MATCH_CRIT ;
1169      else line_0="default "$MATCH_CRIT ; fi      else line_0="default "$MATCH_CRIT ; fi
1170         line_0="$line_0  ----T-----  ----S-----  ----U-----  ----V-----"         line_0="$line_0  ----T-----  ----S-----  ----U-----  ----V-----"
 #   line_0="            ----T-----  ----S-----  ----U-----  ----V-----"  
1171      line_1="G D M    c        m  s        m  s        m  s        m  s"      line_1="G D M    c        m  s        m  s        m  s        m  s"
1172      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  ."
1173      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"
# Line 1188  N n k u  s  a Line 1200  N n k u  s  a
1200    
1201  EOF  EOF
1202  fi  fi
1203    echo "-------------------------------------------------------------------------------"
1204    
1205  #  ...and each test directory...  #  ...and each test directory...
1206  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
# Line 1277  for dir in $TESTDIRS ; do Line 1290  for dir in $TESTDIRS ; do
1290          fi          fi
1291      done      done
1292    
     echo "-------------------------------------------------------------------------------"  
1293      echo      echo
1294      if test "x$extra_runs" = "x" ; then      if test "x$extra_runs" = "x" ; then
1295         echo "Experiment:  $dir"         echo "Experiment:  $dir"
# Line 1297  for dir in $TESTDIRS ; do Line 1309  for dir in $TESTDIRS ; do
1309              run=N              run=N
1310          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
1311              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
             && run_clean $dir/$rundir \  
1312              && symlink_mpifiles $dir $code_dir $builddir \              && symlink_mpifiles $dir $code_dir $builddir \
1313              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
1314              && makemodel $dir/$builddir && make=Y              && makemodel $dir/$builddir && make=Y
1315      else      else
1316          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
1317              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
             && run_clean $dir/$rundir \  
1318              && symlink_mpifiles $dir $code_dir $builddir \              && symlink_mpifiles $dir $code_dir $builddir \
1319              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
1320              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
1321              && linkdata $dir/$rundir $inputdir input \              && run_clean $dir/$rundir \
1322                && linkdata $dir/$rundir $inputdir \
1323              && runmodel $dir/$rundir && run=Y \              && runmodel $dir/$rundir && run=Y \
1324              && results=`testoutput_run $dir $rundir $ref_outp`              && results=`testoutput_run $dir $rundir $ref_outp`
1325      fi      fi
   
1326      #echo "results='$results'"      #echo "results='$results'"
1327      echo  
1328          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1329          echo          echo 1>&2
1330          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1331          touch $locDIR"/summary.txt"          touch $locDIR"/summary.txt"
1332          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
# Line 1341  for dir in $TESTDIRS ; do Line 1351  for dir in $TESTDIRS ; do
1351              CDIR=`pwd`"/$locDIR"              CDIR=`pwd`"/$locDIR"
1352              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"
1353              run_clean $dir/tr_run.$ex              run_clean $dir/tr_run.$ex
1354              linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir input              linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir
1355              runmodel $dir/tr_run.$ex && run=Y \              runmodel $dir/tr_run.$ex && run=Y \
1356              && results=`testoutput_run $dir tr_run.$ex $refExOut`              && results=`testoutput_run $dir tr_run.$ex $refExOut`
1357              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1358              fres="$fres.$ex"              fres="$fres.$ex"
1359              echo              echo 1>&2
1360              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1361              touch $locDIR"/summary.txt"              touch $locDIR"/summary.txt"
1362              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
# Line 1364  for dir in $TESTDIRS ; do Line 1374  for dir in $TESTDIRS ; do
1374              fi              fi
1375          done          done
1376    
1377      if test -f $DRESULTS"/"genmake_state ; then : ; else      if test -f $DRESULTS"/"genmake_state ; then : ; else
1378          if test -f $dir/$builddir/Makefile ; then          if test -f $dir/$builddir/Makefile ; then
1379              mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`              mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`
1380              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state

Legend:
Removed from v.1.138  
changed lines
  Added in v.1.141

  ViewVC Help
Powered by ViewVC 1.1.22