/[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.52 by edhill, Wed Dec 1 16:59:42 2004 UTC revision 1.87 by jmc, Mon Jul 31 20:48:41 2006 UTC
# Line 11  usage() Line 11  usage()
11      echo      echo
12      echo "where possible OPTIONS are:"      echo "where possible OPTIONS are:"
13      echo "  (-help|-h)               print usage"      echo "  (-help|-h)               print usage"
14      echo "  (-mpi)                   use MPI input files"      echo "  (-mth)                   run multi threaded (using eedata.mth)"
15        echo "  (-mpi)                   compile and run using MPI"
16      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"
17      echo "                             (DEF=\"-ieee\")"      echo "                             (DEF=\"-ieee\")"
18      echo "  (-optfile=|-of=)STRING   list of optfiles to use"      echo "  (-optfile=|-of=)STRING   list of optfiles to use"
19      echo "  (-a|-addr) STRING        list of email recipients"      echo "  (-a|-addr) STRING        list of email recipients"
20      echo "                             (DEF=\"edhill@mitgcm.org\")"      echo "                             (DEF=\"edhill@mitgcm.org\")"
21      echo "  (-t|-tdir) STRING        list of test dirs to use"      echo "  (-t|-tdir) STRING        list of group and/or exp. dirs to test"
22      echo "                             (DEF=\"\" which builds all)"      echo "                             (recognized groups: basic, tutorials)"
23        echo "                             (DEF=\"\" which test all)"
24      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"
25      echo "                             Bourne-compatible \"sh\" shell"      echo "                             Bourne-compatible \"sh\" shell"
26      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
# Line 27  usage() Line 29  usage()
29      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
30      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-m|-make) STRING        command to use for \"make\""
31      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
32        echo "  (-odir) STRING           used to build output directory name"
33        echo "                             (DEF=\"hostname\")"
34      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
35      echo "                             (DEF=\"1 2 3 4 5\")"      echo "                             (DEF=\"1 2 3 4 5\")"
36      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
# Line 87  testoutput_for_prop() Line 91  testoutput_for_prop()
91  {  {
92      # testoutput_for_prop dir s1 label subdir extension      # testoutput_for_prop dir s1 label subdir extension
93      #      #
94      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt      #  compares files $dir/$subdir/$OUTPUTFILE and $dir/results/output.txt
95      #  using search strings s1 and text label      #  using search strings s1 and text label
96    
97      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
98          echo testoutput_for_prop: grep "$2" $1/$4/output.txt 1>&2          echo testoutput_for_prop: grep "$2" $1/$4/$OUTPUTFILE 1>&2
99      fi      fi
100      if [ -r $1/$4/output.txt ]; then      if [ -r $1/$4/$OUTPUTFILE ]; then
101          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt
102          lncnt=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l tmp1.txt | awk '{print $1}' `
103          if [ $lncnt -lt 3 ]; then          if [ $lncntA -lt 3 ]; then
104              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
105                  echo Not enough lines of output when searching for "$2" 1>&2                  echo Not enough lines of output when searching for "$2" 1>&2
106              fi              fi
107              return 99              return 99
108          fi          fi
109      else      else
110          echo testoutput_for_prop: output.txt from model run was not readable 1>&2          echo testoutput_for_prop: $OUTPUTFILE from model run was not readable 1>&2
111          return 99          return 99
112      fi      fi
113      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
114          echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2          echo testoutput_for_prop: grep "$2" $1/results/output.$5 1>&2
115      fi      fi
116      grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/results/output.$5 | sed 's/.*=//' | cat -n > tmp2.txt
117      lncnt=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l tmp2.txt | awk '{print $1}' `
118      if [ $lncnt -lt 3 ]; then      if [ $lncntB -lt 3 ]; then
119          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
120              echo Not enough lines of output when searching for "$2" 1>&2              echo Not enough lines of output when searching for "$2" 1>&2
121          fi          fi
122          return 99          return 99
123      fi      fi
124        if [ $lncntA -ne $lncntB ]; then
125            if [ $verbose -gt 0 ]; then
126                echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2
127            fi
128            return 99
129        fi
130        has_nan=`cat tmp1.txt | grep -i nan | wc -l`
131        if [ $has_nan -gt 0  ] ; then
132            echo testoutput_for_prop: $OUTPUTFILE contains $has_nan NaN values  1>&2
133            return 99
134        fi
135        has_inf=`cat tmp1.txt | grep -i inf | wc -l`
136        if [ $has_inf -gt 0  ] ; then
137            echo testoutput_for_prop: $OUTPUTFILE contains $has_inf Inf values  1>&2
138            return 99
139        fi
140      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
141          echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2          echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2
142      fi      fi
# Line 163  dashnum() Line 183  dashnum()
183    
184  testoutput_ad()  testoutput_ad()
185  {  {
186      grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $5}' > t05.txt      grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $5}' > t05.txt
187      grep $3 $1/$2/output.txt_adm | awk '{print NR " " $5}' > t15.txt      grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $5}' > t15.txt
188      grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $6}' > t06.txt      grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $6}' > t06.txt
189      grep $3 $1/$2/output.txt_adm | awk '{print NR " " $6}' > t16.txt      grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $6}' > t16.txt
190      join t05.txt t15.txt > t5.txt      join t05.txt t15.txt > t5.txt
191      join t06.txt t16.txt > t6.txt      join t06.txt t16.txt > t6.txt
192      echo "-1" >> t5.txt      echo "-1" >> t5.txt
# Line 286  genmakemodel() Line 306  genmakemodel()
306                  command="$command --mods=../code"                  command="$command --mods=../code"
307              else              else
308                  command="$command --mods=../code_ad"                  command="$command --mods=../code_ad"
                 command="$command -adof=../../../tools/adjoint_options/adjoint_staf"  
309              fi              fi
310              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
311                  command="$command --optfile=$OPTFILE"                  command="$command --optfile=$OPTFILE"
# Line 294  genmakemodel() Line 313  genmakemodel()
313              if test "x$IEEE" != x ; then              if test "x$IEEE" != x ; then
314                  command="$command -ieee"                  command="$command -ieee"
315              fi              fi
316                if test "x$MPI" = xt ; then
317                    command="$command -mpi"
318                fi
319              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
320              $command > make.log 2>&1              $command > make.log 2>&1
321              RETVAL=$?              RETVAL=$?
# Line 315  makeclean() Line 337  makeclean()
337  {  {
338      # makeclean directory      # makeclean directory
339      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
340          echo "make CLEAN skipped!"          echo "make Clean skipped!"
341      else      else
342          (          (
343              cd $1;              cd $1;
344              if test -e output.txt ; then              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi
                 rm -f output.txt  
             fi  
             printf 'make CLEAN ... ' 2>&1  
345              if test -r Makefile ; then              if test -r Makefile ; then
346                  $MAKE CLEAN >> make.log 2>&1                  printf 'clean build-dir: make Clean ... ' 2>&1
347                    $MAKE Clean >> make.log 2>&1
348                  RETVAL=$?                  RETVAL=$?
349                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
350                      tail make.log                      tail make.log
351                      echo "makeclean: \"make CLEAN\" failed" 1>&2                      echo "makeclean: \"make Clean\" failed" 1>&2
352                      cp make.log $CDIR"/make.log"                      cp make.log $CDIR"/make.log"
353                      return 1                      return 1
354                  fi                  fi
# Line 339  makeclean() Line 359  makeclean()
359      fi      fi
360  }  }
361    
362    run_clean()
363    {
364        # run_clean directory
365        if test "x$NOCLEAN" = xt ; then
366            echo "run_clean skipped!"
367        else
368            (
369                cd $1;
370                printf 'clean run-dir ... ' 2>&1
371                # part of what is done after "make clean" when doing "make CLEAN"
372                find . -name "*.meta" -exec rm {} \;
373                find . -name "*.data" -exec rm {} \;
374                find . -name "fort.*" -exec rm {} \;
375                find . -type l -exec rm {} \;
376                rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime
377                rm -rf mnc_test_*
378                echo successful 1>&2
379                exit 0
380            )
381        fi
382    }
383    
384  makedependmodel()  makedependmodel()
385  {  {
386      # makedependmodel directory      # makedependmodel directory
# Line 441  symlink_mpifiles() Line 483  symlink_mpifiles()
483    
484  linkdata()  linkdata()
485  {  {
486      # linkdata flag      # linkdata run_dir input_dir_1 input_dir_2 ...
487      #      #
488      # symbolically link data files to run directory      # symbolically link data files to run directory
489      if test "x$1" = x1 ; then      if test -d $1 ; then
490          (          (
491              cd $2              cd $1 ; shift
492              if test "x$ADM" = x ; then              if test -r "../"$1"/eedata.mth" ; then
493                  files=`( cd ../input ; ls -1 | grep -v CVS )`              # found eedata.mth in 1rst input dir and it is readable
494                  for i in $files ; do                  if test "x$MULTI_THREAD" = "xt" ; then
495                      if test ! -d "../input/"$i ; then                  # multi-threaded test: remove symbolic link & link eedata.mth
496                          ln -sf "../input/"$i $i                      if test -h eedata ; then rm -f eedata ; fi
497                      fi                      if test ! -r eedata ; then
498                  done                          ln -sf "../"$1"/eedata.mth" eedata ;
499              else                          printf 'eedata.mth ' 1>&2
                 files=`( cd ../input ; ls -1 *.bin | grep -v CVS )`  
                 for i in $files ; do  
                     if test ! -d "../input/"$i ; then  
                         ln -sf "../input/"$i $i  
                     fi  
                 done  
                 files=`( cd ../input_ad ; ls -1 | grep -v CVS )`  
                 for i in $files ; do  
                     if test ! -d "../input_ad/"$i ; then  
                         ln -sf "../input_ad/"$i $i  
500                      fi                      fi
501                  done                  else
502                    # not multi-threaded test: remove eedata symbolic link
503                        if test -h eedata ; then rm -f eedata ; fi
504                    fi
505              fi              fi
506                for ldir in $* ; do
507                    if test -d "../"$ldir ; then
508                        printf 'ldir='${ldir} 1>&2
509                        files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`
510                        for i in $files ; do
511                            if test ! -d "../"$ldir/$i ; then
512                                if test ! -r $i  ; then
513                                    printf ' '$i 1>&2
514                                    ln -sf "../"$ldir"/"$i $i
515                                fi
516                            fi
517                        done
518                        if test -x "../"$ldir"/"prepare_run ; then
519                            "../"$ldir"/"prepare_run
520                        fi
521                        printf ' ; ' 1>&2
522                    fi
523                done
524          )          )
525      fi      fi
526  }  }
# Line 480  runmodel() Line 533  runmodel()
533      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
534      (      (
535          cd $1          cd $1
536          printf 'runmodel ... ' 1>&2          printf 'runmodel in %s ...' $1 1>&2
537          # make output.txt          # make output.txt
538          echo          echo
539          rm -f run.log          rm -f run.log
540            if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
541                echo " link" $EXECUTABLE "from dir ../"$builddir > run.log
542                ln -sf "../"$builddir"/"$EXECUTABLE .
543            else
544                touch run.log
545            fi
546            if test ! -x $EXECUTABLE ; then
547                    echo " no executable:" $EXECUTABLE >> run.log
548                    RETVAL=8
549            else
550                if test $OUTPUTFILE -ot $EXECUTABLE ; then
551                    ( eval $COMMAND ) >> run.log 2>&1
552                    RETVAL=$?
553                else
554                    echo " $OUTPUTFILE is up to date " >> run.log 2>&1
555                    RETVAL=0
556                fi
557            fi
558          # echo "COMMAND='$COMMAND'"          # echo "COMMAND='$COMMAND'"
559          # echo "pwd='"`pwd`"'"          # echo "pwd='"`pwd`"'"
         ( eval $COMMAND ) > run.log 2>&1  
         RETVAL=$?  
560          if test "x$RETVAL" = x0 ; then          if test "x$RETVAL" = x0 ; then
561              tail run.log              tail run.log
562              echo successful 1>&2              echo successful 1>&2
563              # === Reduce the size of the testing emails!              # === Reduce the size of the testing emails!
564              # if test "x$ADM" = x ; then              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE
             #   cp output.txt $CDIR"/output.txt"  
             # else  
             #   cp output.txt_adm $CDIR"/output.txt_adm"  
             # fi  
565              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
566              return 0              return 0
567          else          else
# Line 520  createcodelet() Line 585  createcodelet()
585  int main( int argc, char** argv )  {  int main( int argc, char** argv )  {
586    int linnum,best,lncnt;    int linnum,best,lncnt;
587    double a,b,abave,relerr;    double a,b,abave,relerr;
588    best = -16;    best = -22;
589    lncnt = 0;    lncnt = 0;
590    while( 1 & (lncnt+=1) < 999 )  {    while( 1 & (lncnt+=1) < 999 )  {
591      scanf("%d", &linnum);      scanf("%d", &linnum);
# Line 529  int main( int argc, char** argv )  { Line 594  int main( int argc, char** argv )  {
594      abave = 0.5*(fabs(a)+fabs(b));      abave = 0.5*(fabs(a)+fabs(b));
595      if (abave > 0.0) {      if (abave > 0.0) {
596        relerr=fabs(a-b)/abave;        relerr=fabs(a-b)/abave;
597        if (relerr > 0.0) {        if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); }
598          linnum = (int)log10(relerr);        else { linnum = -16 ; }
599          best = (best > linnum) ? best : linnum;        best = (best > linnum) ? best : linnum;
       }  
     }  
     else {  
       if (best == -16 && abave != 0)  best = -22;  
600      }      }
601    }    }
602    if (lncnt == 999) best=-29;    if (lncnt == 999) best=-29;
# Line 543  int main( int argc, char** argv )  { Line 604  int main( int argc, char** argv )  {
604    return 0;    return 0;
605  }  }
606  EOF  EOF
607      cc -o tmp_cmpnum tmp_cmpnum.c -lm      $CC -o tmp_cmpnum tmp_cmpnum.c -lm
608    
609      if [ -x ./tmp_cmpnum ]; then      if [ -x ./tmp_cmpnum ]; then
610          echo "OK"          echo "OK"
611          return 0          return 0
612      else      else
613          echo          echo
614          echo "ERROR: failed to compile comparison code"          echo "ERROR: failed to compile comparison code -- please specify"
615            echo "  a C compiler using the CC environment variable."
616          exit 1          exit 1
617      fi      fi
618  }  }
# Line 599  EOF Line 661  EOF
661    
662  scandirs()  scandirs()
663  {  {
664      if [ $# -eq 0 ]; then      if [ $# -eq 1 ]; then
665          for arg in * ; do          for arg in * ; do
666              test -d $arg/input && echo $arg              test -d $arg/$1 && echo $arg
667          done          done
668      else      else
669          echo $*          echo $*
670      fi      fi
671  }  }
672    
# Line 630  QUICK=f Line 692  QUICK=f
692  NOGENMAKE=f  NOGENMAKE=f
693  NOCLEAN=f  NOCLEAN=f
694  NODEPEND=f  NODEPEND=f
695    POSTCLEAN=f
696    
697  BASH=  BASH=
698  OPTFILE=NONE  OPTFILE=NONE
# Line 639  MPACKDIR="../tools/mpack-1.6" Line 702  MPACKDIR="../tools/mpack-1.6"
702  HAVE_MPACK=  HAVE_MPACK=
703  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
704  COMMAND=  COMMAND=
705  MAKE=make  if test "x$MAKE" = x ; then
706        MAKE=make
707    fi
708    if test "x$CC" = x ; then
709        CC=cc
710    fi
711  JOBS=  JOBS=
712  MPI=f  MPI=f
713    MULTI_THREAD=f
714    OUTDIR=
715  DELDIR=  DELDIR=
716    
717  ADM=  ADM=
# Line 698  for ac_option ; do Line 768  for ac_option ; do
768          -make=* | --make=*)          -make=* | --make=*)
769              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
770    
771            -odir | --odir)
772                ac_prev=OUTDIR ;;
773            -odir=* | --odir=*)
774                OUTDIR=$ac_optarg ;;
775    
776          -ptracers | --ptracers | -ptr | --ptr)          -ptracers | --ptracers | -ptr | --ptr)
777              ac_prev=PTRACERS_NUM ;;              ac_prev=PTRACERS_NUM ;;
778          -ptracers=* | --ptracers=* | -ptr=* | --ptr=*)          -ptracers=* | --ptracers=* | -ptr=* | --ptr=*)
# Line 707  for ac_option ; do Line 782  for ac_option ; do
782          -j=*) JOBS=$ac_optarg ;;          -j=*) JOBS=$ac_optarg ;;
783    
784          -clean | --clean)          -clean | --clean)
785              CLEANUP=t ;;              CLEANUP=t ; DELDIR=t ;;
786    
787          -quick | --quick | -q | --q)          -quick | --quick | -q | --q)
788              QUICK=t ;;              QUICK=t ;;
# Line 718  for ac_option ; do Line 793  for ac_option ; do
793          -nodepend | --nodepend | -nd | --nd)          -nodepend | --nodepend | -nd | --nd)
794              NODEPEND=t ;;              NODEPEND=t ;;
795    
796            -postclean | --postclean | -pc | --pc)
797                POSTCLEAN=t ;;
798    
799          -mpi) MPI=t ;;          -mpi) MPI=t ;;
800    
801            -mth) MULTI_THREAD=t ;;
802    
803          -adm | -ad) ADM=t ;;          -adm | -ad) ADM=t ;;
804    
805          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
# Line 752  if test "x$QUICK" = xt ; then Line 832  if test "x$QUICK" = xt ; then
832  fi  fi
833    
834  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
835      TESTDIRS=`scandirs`      if test "x$ADM" = xt ; then
836            TESTDIRS=`scandirs results_ad`
837        else
838            TESTDIRS=`scandirs results`
839        fi
840    else
841        #- expand group of experiments:
842        LIST=" "
843        for xx in $TESTDIRS
844        do
845          case $xx in
846            'basic') LIST=${LIST}" aim.5l_cs hs94.128x64x5 ideal_2D_oce"
847                     LIST=${LIST}" lab_sea tutorial_baroclinic_gyre"
848                     LIST=${LIST}" tutorial_global_oce_latlon tutorial_plume_on_slope"
849                    ;;
850            'tutorials')
851                     LIST=${LIST}" "`ls | grep 'tutorial_'` ;;
852            *)       LIST=${LIST}" "$xx ;;
853          esac
854        done
855        #echo 'LIST='${LIST}'<'
856        #- remove duplicate and non-directory:
857        TESTDIRS=" "
858        for xx in $LIST
859        do
860            if test -d $xx ; then
861                yy=`echo $TESTDIRS | grep -c $xx`
862                if test $yy = 0 ; then TESTDIRS=${TESTDIRS}" "$xx ; fi
863            else
864                echo " -- skip \"$xx\" : not a directory !"
865            fi
866        done
867  fi  fi
868    #echo 'TESTDIRS='${TESTDIRS}'<'
869    
870  if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then  if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then
871      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
872  fi  fi
873    
874  if test "x$ADM" = xt -a "x$COMMAND" = x ; then  if test "x$ADM" = xt ; then
875      COMMAND="./mitgcmuv_ad > output.txt_adm 2>&1"      EXECUTABLE="mitgcmuv_ad"
876        OUTPUTFILE="output_adm.txt"
877    else
878        EXECUTABLE="mitgcmuv"
879        OUTPUTFILE="output.txt"
880  fi  fi
881    
882  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
883      COMMAND="$MAKE output.txt"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
884    fi
885    if test "x$MPI" = xt ; then
886        OUTPUTFILE="STDOUT.0000"
887  fi  fi
888    
889  echo "OK"  #echo "OK"
890    echo "OK (COMMAND= $COMMAND )"
891    
892  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
893  createcodelet  createcodelet
# Line 784  MACH=`hostname` Line 904  MACH=`hostname`
904  UNAMEA=`uname -a`  UNAMEA=`uname -a`
905  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
906  BASE="tr_"$MACH"_"$DATE"_"  BASE="tr_"$MACH"_"$DATE"_"
907    if test "x$OUTDIR" != x ; then
908        BASE="tr_"$OUTDIR"_"$DATE"_"
909    fi
910  DNUM=0  DNUM=0
911  DRESULTS="$BASE$DNUM"  DRESULTS="$BASE$DNUM"
912  while test -e $DRESULTS ; do  while test -e $DRESULTS ; do
# Line 868  for dir in $TESTDIRS ; do Line 991  for dir in $TESTDIRS ; do
991      #  Cleanup only!      #  Cleanup only!
992      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
993          if test -r $dir/build/Makefile ; then          if test -r $dir/build/Makefile ; then
994                echo '  ------  clean dir:' $dir/build
995              ( cd $dir/build ; make CLEAN )              ( cd $dir/build ; make CLEAN )
996          fi          fi
997          if test -r $dir/input/Makefile ; then          if test -d $dir/run/CVS ; then
998              ( cd $dir/input ; make CLEAN )              echo '  ------  clean dir:' $dir/run
999                run_clean $dir/run
1000          fi          fi
1001            (
1002                cd $dir
1003                rm -rf tr_run.*
1004            )
1005          continue          continue
1006      fi      fi
1007    
# Line 881  for dir in $TESTDIRS ; do Line 1010  for dir in $TESTDIRS ; do
1010      fout=      fout=
1011      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
1012          fout=$dir"/results/output.txt"          fout=$dir"/results/output.txt"
         check_for_add_mon_output  $fout  
1013      else      else
1014          fout=$dir"/results_ad/output.txt_adm"          fout=$dir"/results_ad/output_adm.txt"
1015      fi      fi
1016      if test ! -r $fout ; then      if test ! -r $fout ; then
1017          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
1018          continue          continue
1019      fi      fi
1020        if test "x$ADM" = x ; then
1021            check_for_add_mon_output  $fout
1022        fi
1023    
1024      # Check for additional types of monitor output      # Check for additional types of monitor output
1025    
1026      builddir="input"      builddir="build"
1027      rundir="input"      if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi
1028      use_seperate_build=0      rundir="run"
1029      if test -d $dir/build -a -r $dir/build ; then     #rundir=$builddir
1030          builddir="build"      if test ! -d $dir/$rundir ; then
1031          rundir="build"          rundir=$builddir
         use_seperate_build=1  
         linkdata $use_seperate_build $dir/$rundir  
1032      fi      fi
1033            
     #  Check whether there are "extra runs" for this testdir  
     extra_runs=  
     if test "x$ADM" = x -a "x$use_seperate_build" = x1 ; then  
         ex_run_dirs=`( cd $dir ; echo input.* )`  
         echo "ex_run_dirs='$ex_run_dirs'"  
         for exd in $ex_run_dirs ; do  
             name=`echo $exd | sed -e 's/input.//g'`  
             outf="$dir/results/output.txt.$name"  
             if test -f $outf -a -r $outf ; then  
                 extra_runs="$extra_runs $name"  
             fi  
         done  
     fi  
   
1034      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
1035          code_dir=code          code_dir=code
1036          CODE_DIR=$dir/code          CODE_DIR=$dir/code
1037            input_dirs='input'
1038      else      else
1039          code_dir=code_ad          code_dir=code_ad
1040          CODE_DIR=$dir/code_ad          CODE_DIR=$dir/code_ad
1041            input_dirs='input_ad input'
1042      fi      fi
1043      BUILD_DIR=$dir/$builddir      BUILD_DIR=$dir/$builddir
1044    
# Line 929  for dir in $TESTDIRS ; do Line 1046  for dir in $TESTDIRS ; do
1046          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1047          continue          continue
1048      fi      fi
1049        if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then
1050            echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"
1051            continue
1052        fi
1053    
1054        #  Check whether there are "extra runs" for this testdir
1055        extra_runs=
1056        if test "x$ADM" = x ; then
1057            ex_run_dirs=`( cd $dir ; echo input.* )`
1058            #echo "ex_run_dirs='$ex_run_dirs'"
1059            for exd in $ex_run_dirs ; do
1060                name=`echo $exd | sed -e 's/input.//g'`
1061                outf="$dir/results/output.$name.txt"
1062                if test -f $outf -a -r $outf ; then
1063                    if test "x$MULTI_THREAD" = "xt" ; then
1064                        if test -r $dir"/"$exd"/eedata.mth" ; then
1065                            extra_runs="$extra_runs $name"
1066                        #else echo $dir"/"$exd"/eedata.mth: not found"
1067                        fi
1068                    else
1069                        extra_runs="$extra_runs $name"
1070                    fi
1071                fi
1072            done
1073        fi
1074    
1075      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1076      echo      echo
1077      echo "Experiment:  $dir"      if test "x$extra_runs" = "x" ; then
1078           echo "Experiment:  $dir"
1079        else
1080           echo "Experiment:  $dir ; extra_runs=$extra_runs"
1081        fi
1082      echo      echo
1083      unset genmake makedepend make run      unset genmake makedepend make run
1084      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
1085    
1086      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir for each OPTFILE/tdir combination
1087      rel_CDIR=$DRESULTS"/"$dir      rel_CDIR=$DRESULTS"/"$dir
# Line 943  for dir in $TESTDIRS ; do Line 1089  for dir in $TESTDIRS ; do
1089      CDIR=`pwd`"/$rel_CDIR"      CDIR=`pwd`"/$rel_CDIR"
1090            
1091      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1092          makeclean $dir/$builddir          echo '====>>> this is to check that we never go through this part <<< ==='
1093            makeclean $dir/$builddir \
1094                && run_clean $dir/$rundir
1095      else      else
1096          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
1097              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
1098                && run_clean $dir/$rundir \
1099              && symlink_mpifiles $dir $code_dir $builddir \              && symlink_mpifiles $dir $code_dir $builddir \
1100              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
1101              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
1102              && linkdata $use_seperate_build $dir/$rundir \              && linkdata $dir/$rundir $input_dirs \
1103              && runmodel $dir/$rundir && run=Y \              && runmodel $dir/$rundir && run=Y \
1104              && results=`testoutput $dir $rundir`              && results=`testoutput $dir $rundir "txt"`
1105      fi      fi
1106            
1107      echo      echo
# Line 966  for dir in $TESTDIRS ; do Line 1115  for dir in $TESTDIRS ; do
1115          echo "DATE='$DATE'" >> $CDIR"/summary.txt"          echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1116          echo "tdir='$dir'" >> $CDIR"/summary.txt"          echo "tdir='$dir'" >> $CDIR"/summary.txt"
1117    
         OLD_COMMAND=$COMMAND  
         COMMAND="./mitgcmuv > output.txt"  
1118          for ex in $extra_runs ; do          for ex in $extra_runs ; do
1119              test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex"              unset run
1120              mkdir "$dir/tr_run.$ex"              results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
1121              links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`              #  Create an output dir for each OPTFILE/tdir.ex combination
1122              (              rel_CDIR=$DRESULTS"/"$dir"."$ex
1123                  cd "$dir/tr_run.$ex"              mkdir $rel_CDIR
1124                  for i in $links; do              CDIR=`pwd`"/$rel_CDIR"
1125                      ln -s ../input/$i $i              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"
1126                  done              run_clean $dir/tr_run.$ex
1127              )              linkdata $dir/tr_run.$ex input.$ex input
             links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`  
             (  
                 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  
             )  
1128              runmodel $dir/tr_run.$ex && run=Y \              runmodel $dir/tr_run.$ex && run=Y \
1129                  && results=`testoutput $dir tr_run.$ex "."$ex`                  && results=`testoutput $dir tr_run.$ex ${ex}".txt"`
1130              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}`
1131              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1132              fres="$fres.$ex"              fres="$fres.$ex"
# Line 998  for dir in $TESTDIRS ; do Line 1136  for dir in $TESTDIRS ; do
1136              echo "MACH='$MACH'" >> $CDIR"/summary.txt"              echo "MACH='$MACH'" >> $CDIR"/summary.txt"
1137              echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"              echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1138              echo "DATE='$DATE'" >> $CDIR"/summary.txt"              echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1139              echo "tdir='$dir'" >> $CDIR"/summary.txt"              echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt"
1140                if test "x$POSTCLEAN" = xt ; then
1141                    run_clean $dir/tr_run.$ex
1142                fi
1143          done          done
         COMMAND=$OLD_COMMAND  
1144      else      else
1145          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}`
1146          fres=$fres"$results   $dir"          fres=$fres"$results   $dir"
# Line 1011  for dir in $TESTDIRS ; do Line 1151  for dir in $TESTDIRS ; do
1151          echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"          echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1152          echo "DATE='$DATE'" >> $CDIR"/summary.txt"          echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1153          echo "tdir='$dir'" >> $CDIR"/summary.txt"          echo "tdir='$dir'" >> $CDIR"/summary.txt"
1154            grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \
1155                               >> $CDIR"/summary.txt"
1156        fi
1157    
1158        #postclean $dir/$builddir
1159        if test "x$POSTCLEAN" = xt ; then
1160            makeclean $dir/$builddir \
1161                && run_clean $dir/$rundir
1162      fi      fi
1163            
1164      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
# Line 1053  fi Line 1201  fi
1201  rm -f tmp_cmpnum.c tmp_cmpnum  rm -f tmp_cmpnum.c tmp_cmpnum
1202    
1203  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1204      cat $SUMMARY      cat $SUMMARY | sed 's/ -- -- -- --//g'
1205      if test -e tr_out.txt ; then      if test -e tr_out.txt ; then
1206          mv tr_out.txt tr_out.txt.old          mv tr_out.txt tr_out.txt.old
1207      fi      fi
1208      cat $SUMMARY > tr_out.txt      cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt
1209  fi  fi
1210    
1211  if test "x$DELDIR" = xt ; then  if test "x$DELDIR" = xt ; then

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.87

  ViewVC Help
Powered by ViewVC 1.1.22