/[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.77 by jmc, Mon Mar 20 21:50:36 2006 UTC revision 1.90 by ce107, Wed Jan 31 21:28:34 2007 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 "  (-of=|-optfile=)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 "  (-skd|-skipdir) STRING   list of exp. dirs to skip"
25        echo "                             (DEF=\"\" which test all)"
26      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"
27      echo "                             Bourne-compatible \"sh\" shell"      echo "                             Bourne-compatible \"sh\" shell"
28      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
# Line 29  usage() Line 33  usage()
33      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
34      echo "  (-odir) STRING           used to build output directory name"      echo "  (-odir) STRING           used to build output directory name"
35      echo "                             (DEF=\"hostname\")"      echo "                             (DEF=\"hostname\")"
36      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"      echo "  (-ptr|-ptracers) STRING  specify which ptracers to test"
37      echo "                             (DEF=\"1 2 3 4 5\")"      echo "                             (DEF=\"1 2 3 4 5\")"
38      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
39      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
# Line 38  usage() Line 42  usage()
42      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
43      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
44      echo "  (-deldir|-dd)            on success, delete the output directory"      echo "  (-deldir|-dd)            on success, delete the output directory"
45        echo "  (-ts)                    provide timing information per timestep"
46        echo "  (-papis)                 provide MFlop/s per timestep using PAPI"
47        echo "  (-pcls)                  provide MFlop/s per timestep using PCL"
48      echo      echo
49      echo "and where STRING can be a whitespace-delimited list"      echo "and where STRING can be a whitespace-delimited list"
50      echo "such as:"      echo "such as:"
# Line 89  testoutput_for_prop() Line 96  testoutput_for_prop()
96  {  {
97      # testoutput_for_prop dir s1 label subdir extension      # testoutput_for_prop dir s1 label subdir extension
98      #      #
99      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt      #  compares files $dir/$subdir/$OUTPUTFILE and $dir/results/output.txt
100      #  using search strings s1 and text label      #  using search strings s1 and text label
101    
102      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
103          echo testoutput_for_prop: grep "$2" $1/$4/output.txt 1>&2          echo testoutput_for_prop: grep "$2" $1/$4/$OUTPUTFILE 1>&2
104      fi      fi
105      if [ -r $1/$4/output.txt ]; then      if [ -r $1/$4/$OUTPUTFILE ]; then
106          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt
107          lncntA=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l tmp1.txt | awk '{print $1}' `
108          if [ $lncntA -lt 3 ]; then          if [ $lncntA -lt 3 ]; then
109              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
# Line 105  testoutput_for_prop() Line 112  testoutput_for_prop()
112              return 99              return 99
113          fi          fi
114      else      else
115          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
116          return 99          return 99
117      fi      fi
118      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
119          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
120      fi      fi
121      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
122      lncntB=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l tmp2.txt | awk '{print $1}' `
123      if [ $lncntB -lt 3 ]; then      if [ $lncntB -lt 3 ]; then
124          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
# Line 127  testoutput_for_prop() Line 134  testoutput_for_prop()
134      fi      fi
135      has_nan=`cat tmp1.txt | grep -i nan | wc -l`      has_nan=`cat tmp1.txt | grep -i nan | wc -l`
136      if [ $has_nan -gt 0  ] ; then      if [ $has_nan -gt 0  ] ; then
137          echo testoutput_for_prop: output.txt contains $has_nan NaN values  1>&2          echo testoutput_for_prop: $OUTPUTFILE contains $has_nan NaN values  1>&2
138          return 99          return 99
139      fi      fi
140      has_inf=`cat tmp1.txt | grep -i inf | wc -l`      has_inf=`cat tmp1.txt | grep -i inf | wc -l`
141      if [ $has_inf -gt 0  ] ; then      if [ $has_inf -gt 0  ] ; then
142          echo testoutput_for_prop: output.txt contains $has_inf Inf values  1>&2          echo testoutput_for_prop: $OUTPUTFILE contains $has_inf Inf values  1>&2
143          return 99          return 99
144      fi      fi
145      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
# Line 181  dashnum() Line 188  dashnum()
188    
189  testoutput_ad()  testoutput_ad()
190  {  {
191      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
192      grep $3 $1/$2/output.txt_adm | awk '{print NR " " $5}' > t15.txt      grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $5}' > t15.txt
193      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
194      grep $3 $1/$2/output.txt_adm | awk '{print NR " " $6}' > t16.txt      grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $6}' > t16.txt
195      join t05.txt t15.txt > t5.txt      join t05.txt t15.txt > t5.txt
196      join t06.txt t16.txt > t6.txt      join t06.txt t16.txt > t6.txt
197      echo "-1" >> t5.txt      echo "-1" >> t5.txt
# Line 304  genmakemodel() Line 311  genmakemodel()
311                  command="$command --mods=../code"                  command="$command --mods=../code"
312              else              else
313                  command="$command --mods=../code_ad"                  command="$command --mods=../code_ad"
                 command="$command -adof=../../../tools/adjoint_options/adjoint_staf"  
314              fi              fi
315              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
316                  command="$command --optfile=$OPTFILE"                  command="$command --optfile=$OPTFILE"
# Line 315  genmakemodel() Line 321  genmakemodel()
321              if test "x$MPI" = xt ; then              if test "x$MPI" = xt ; then
322                  command="$command -mpi"                  command="$command -mpi"
323              fi              fi
324                if test "x$TS" = xt ; then
325                    command="$command -ts"
326                fi
327                if test "x$PAPIS" = xt ; then
328                    command="$command -papis"
329                else
330                if test "x$PCLS" = xt ; then
331                    command="$command -pcls"
332                fi
333                fi
334              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
335              $command > make.log 2>&1              $command > make.log 2>&1
336              RETVAL=$?              RETVAL=$?
# Line 336  makeclean() Line 352  makeclean()
352  {  {
353      # makeclean directory      # makeclean directory
354      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
355          echo "make CLEAN skipped!"          echo "make Clean skipped!"
356      else      else
357          (          (
358              cd $1;              cd $1;
359              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  
360              if test -r Makefile ; then              if test -r Makefile ; then
361                  $MAKE CLEAN >> make.log 2>&1                  printf 'clean build-dir: make Clean ... ' 2>&1
362                    $MAKE Clean >> make.log 2>&1
363                  RETVAL=$?                  RETVAL=$?
364                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
365                      tail make.log                      tail make.log
366                      echo "makeclean: \"make CLEAN\" failed" 1>&2                      echo "makeclean: \"make Clean\" failed" 1>&2
367                      cp make.log $CDIR"/make.log"                      cp make.log $CDIR"/make.log"
368                      return 1                      return 1
369                  fi                  fi
# Line 360  makeclean() Line 374  makeclean()
374      fi      fi
375  }  }
376    
377  postclean()  run_clean()
378  {  {
379      # postclean directory      # run_clean directory
380      if test "x$POSTCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
381            echo "run_clean skipped!"
382        else
383          (          (
384              cd $1;              cd $1;
385              if test -r Makefile ; then              printf 'clean run-dir ... ' 2>&1
386                  $MAKE CLEAN >> /dev/null 2>&1              # part of what is done after "make clean" when doing "make CLEAN"
387              fi              find . -name "*.meta" -exec rm {} \;
388                find . -name "*.data" -exec rm {} \;
389                find . -name "fort.*" -exec rm {} \;
390                find . -type l -exec rm {} \;
391                rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime
392                rm -rf mnc_test_*
393                echo successful 1>&2
394              exit 0              exit 0
395          )          )
396      fi      fi
# Line 476  symlink_mpifiles() Line 498  symlink_mpifiles()
498    
499  linkdata()  linkdata()
500  {  {
501      # linkdata flag      # linkdata run_dir input_dir_1 input_dir_2 ...
502      #      #
503      # symbolically link data files to run directory      # symbolically link data files to run directory
504      if test "x$1" = x1 ; then      if test -d $1 ; then
505          (          (
506              cd $2              cd $1 ; shift
507              if test "x$ADM" = x ; then              if test -r "../"$1"/eedata.mth" ; then
508                  files=`( cd ../input ; ls -1 | grep -v CVS )`              # found eedata.mth in 1rst input dir and it is readable
509                  for i in $files ; do                  if test "x$MULTI_THREAD" = "xt" ; then
510                      if test ! -d "../input/"$i -a ! -f $i ; then                  # multi-threaded test: remove symbolic link & link eedata.mth
511                          ln -sf "../input/"$i $i                      if test -h eedata ; then rm -f eedata ; fi
512                        if test ! -r eedata ; then
513                            ln -sf "../"$1"/eedata.mth" eedata ;
514                            printf 'eedata.mth ' 1>&2
515                      fi                      fi
516                  done                  else
517              else                  # not multi-threaded test: remove eedata symbolic link
518                  files=`( cd ../input ; ls -1 *.bin | grep -v CVS )`                      if test -h eedata ; then rm -f eedata ; fi
519                  for i in $files ; do                  fi
                     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  
                     fi  
                 done  
520              fi              fi
521                for ldir in $* ; do
522                    if test -d "../"$ldir ; then
523                        printf 'ldir='${ldir} 1>&2
524                        files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`
525                        for i in $files ; do
526                            if test ! -d "../"$ldir/$i ; then
527                                if test ! -r $i  ; then
528                                    printf ' '$i 1>&2
529                                    ln -sf "../"$ldir"/"$i $i
530                                fi
531                            fi
532                        done
533                        if test -x "../"$ldir"/"prepare_run ; then
534                            "../"$ldir"/"prepare_run
535                        fi
536                        printf ' ; ' 1>&2
537                    fi
538                done
539          )          )
540      fi      fi
541  }  }
# Line 518  runmodel() Line 551  runmodel()
551          printf 'runmodel in %s ...' $1 1>&2          printf 'runmodel in %s ...' $1 1>&2
552          # make output.txt          # make output.txt
553          echo          echo
554          rm -f run.log          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
555          if test $OUTPUTFILE -ot $EXECUTABLE ; then              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00
556             ( eval $COMMAND ) > run.log 2>&1              ln -sf "../"$builddir"/"$EXECUTABLE .
557             RETVAL=$?          fi
558            if test ! -x $EXECUTABLE ; then
559                    rm -f run.log ; touch run.log
560                    if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi
561                    echo " no executable:" $EXECUTABLE >> run.log
562                    RETVAL=8
563                    ENDVAL=-1
564          else          else
565             echo " $OUTPUTFILE is up to date " > run.log 2>&1              if test $OUTPUTFILE -ot $EXECUTABLE ; then
566             RETVAL=0                  rm -f run.log ; touch run.log
567                    if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi
568                    ( eval $COMMAND ) >> run.log 2>&1
569                    RETVAL=$?
570                else
571                    RETVAL=0
572                    if test -f run.log ; then
573                        if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi
574                        echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1
575                    else
576                        touch run.log
577                        if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi
578                        echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1
579                        echo " no previous run.log: assume NORMAL END" >> run.log 2>&1
580                    fi
581                fi
582                ENDVAL=`cat run.log | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`
583          fi          fi
584          # echo "COMMAND='$COMMAND'"          rm -f run.log_00
585          # echo "pwd='"`pwd`"'"          #if test "x$RETVAL" = x0 ; then
586          if test "x$RETVAL" = x0 ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
587              tail run.log              tail run.log
588              echo successful 1>&2              echo successful 1>&2
589              # === Reduce the size of the testing emails!              # === Reduce the size of the testing emails!
590              # 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  
591              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
592              return 0              return 0
593          else          else
594              tail run.log              tail run.log
595              echo failed 1>&2              echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2
596              cp run.log $CDIR"/run.log"              cp run.log $CDIR"/run.log"
597              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
598              return 1              return 1
# Line 615  formatresults() Line 666  formatresults()
666            
667  }  }
668    
 show_help()  
 {  
     cat - << EOF  
 $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]  
   
  -help|-h      Show this help message  
  -quiet     Reduce the amount of output  
  -verbose   Produce copious amounts of output  
  -debug     Produce even more output which will mean nothing to most  
  -force     Do "make CLEAN" before compiling. This forces a complete rebuild.  
  -clean     Do "make CLEAN" after compiling and testing.  
  -cleanup   Aggresively removes all model output, executables and object files  
             and then exits. Use with care.  
   
 Normal usage:  
  $0 *       Configure, compile, run and analyze in all experiment directories  
 EOF  
 }  
   
669  scandirs()  scandirs()
670  {  {
671      if [ $# -eq 0 ]; then      if [ $# -eq 1 ]; then
672          for arg in * ; do          for arg in * ; do
673              test -d $arg/input && echo $arg              test -d $arg/$1 && echo $arg
674          done          done
675      else      else
676          echo $*          echo $*
677      fi      fi
678  }  }
679    
# Line 673  BASH= Line 705  BASH=
705  OPTFILE=NONE  OPTFILE=NONE
706  ADDRESSES=  ADDRESSES=
707  TESTDIRS=  TESTDIRS=
708    SKIPDIRS=
709  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
710  HAVE_MPACK=  HAVE_MPACK=
711  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
# Line 685  if test "x$CC" = x ; then Line 718  if test "x$CC" = x ; then
718  fi  fi
719  JOBS=  JOBS=
720  MPI=f  MPI=f
721    MULTI_THREAD=f
722  OUTDIR=  OUTDIR=
723  DELDIR=  DELDIR=
724    
# Line 727  for ac_option ; do Line 761  for ac_option ; do
761          -tdir=* | --tdir=*)          -tdir=* | --tdir=*)
762              TESTDIRS=$ac_optarg ;;              TESTDIRS=$ac_optarg ;;
763    
764            -skipdir | --skipdir | -skd | --skd)
765                ac_prev=SKIPDIRS ;;
766            -skipdir=* | --skipdir=*)
767                SKIPDIRS=$ac_optarg ;;
768    
769          -bash | --bash | -b | --b)          -bash | --bash | -b | --b)
770              ac_prev=BASH ;;              ac_prev=BASH ;;
771          -bash=* | --bash=*)          -bash=* | --bash=*)
# Line 772  for ac_option ; do Line 811  for ac_option ; do
811    
812          -mpi) MPI=t ;;          -mpi) MPI=t ;;
813    
814            -mth) MULTI_THREAD=t ;;
815    
816          -adm | -ad) ADM=t ;;          -adm | -ad) ADM=t ;;
817    
818          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
# Line 783  for ac_option ; do Line 824  for ac_option ; do
824    
825          -deldir | -dd) DELDIR=t ;;          -deldir | -dd) DELDIR=t ;;
826    
827            -ts) TS=t;;
828    
829            -papis) PAPIS=t;;
830    
831            -pcls) PCL=t;;
832    
833          -*)          -*)
834              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
835              usage              usage
# Line 804  if test "x$QUICK" = xt ; then Line 851  if test "x$QUICK" = xt ; then
851  fi  fi
852    
853  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
854      TESTDIRS=`scandirs`      if test "x$ADM" = xt ; then
855            LIST=`scandirs results_ad`
856        else
857            LIST=`scandirs results`
858        fi
859    else
860        #- expand group of experiments:
861        LIST=" "
862        for xx in $TESTDIRS
863        do
864          case $xx in
865            'basic') LIST=${LIST}" aim.5l_cs hs94.128x64x5 ideal_2D_oce"
866                     LIST=${LIST}" lab_sea tutorial_baroclinic_gyre"
867                     LIST=${LIST}" tutorial_global_oce_latlon tutorial_plume_on_slope"
868                    ;;
869            'tutorials')
870                     LIST=${LIST}" "`ls | grep 'tutorial_'` ;;
871            *)       LIST=${LIST}" "$xx ;;
872          esac
873        done
874  fi  fi
875    #echo 'LIST='${LIST}'<'
876    #- skip dirs, remove duplicate and non-directory:
877    TESTDIRS=" "
878    count=0
879    for xx in $LIST
880    do
881        yy=`echo $SKIPDIRS | grep -c $xx`
882        if test $yy = 0 ; then
883            if test -d $xx ; then
884                yy=`echo $TESTDIRS | grep -c $xx`
885                if test $yy = 0 ; then TESTDIRS=${TESTDIRS}" "$xx ; fi
886            else count=1 ;
887                echo ""; echo -n " -- skip \"$xx\" (not a directory !)"
888            fi
889        else
890            if test $count = 1 ; then echo -n ", \"$xx\""
891            else count=1 ; echo "" ;  echo -n " skip: \"$xx\""
892            fi
893        fi
894    done
895    if test $count = 1 ; then echo "" ; echo -n " ... " ; fi
896    #echo 'TESTDIRS='${TESTDIRS}'<'
897    
898  if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then  if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then
899      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
# Line 813  fi Line 901  fi
901    
902  if test "x$ADM" = xt ; then  if test "x$ADM" = xt ; then
903      EXECUTABLE="mitgcmuv_ad"      EXECUTABLE="mitgcmuv_ad"
904      OUTPUTFILE="output.txt_adm"      OUTPUTFILE="output_adm.txt"
905  else  else
906      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
907      OUTPUTFILE="output.txt"      OUTPUTFILE="output.txt"
908  fi  fi
909    
 if test "x$ADM" = xt -a "x$COMMAND" = x ; then  
     COMMAND="./$EXECUTABLE > $OUTPUTFILE"  
 fi  
   
910  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
911      COMMAND="./$EXECUTABLE > $OUTPUTFILE"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
912  fi  fi
913    if test "x$MPI" = xt ; then
914        OUTPUTFILE="STDOUT.0000"
915    fi
916    
917  #echo "OK"  #echo "OK"
918  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND= $COMMAND )"
# Line 932  for dir in $TESTDIRS ; do Line 1019  for dir in $TESTDIRS ; do
1019      #  Cleanup only!      #  Cleanup only!
1020      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1021          if test -r $dir/build/Makefile ; then          if test -r $dir/build/Makefile ; then
1022                echo '  ------  clean dir:' $dir/build
1023              ( cd $dir/build ; make CLEAN )              ( cd $dir/build ; make CLEAN )
1024          fi          fi
1025          if test -r $dir/input/Makefile ; then          if test -d $dir/run/CVS ; then
1026              ( cd $dir/input ; make CLEAN )              echo '  ------  clean dir:' $dir/run
1027                run_clean $dir/run
1028          fi          fi
1029          (          (
1030              cd $dir              cd $dir
# Line 950  for dir in $TESTDIRS ; do Line 1039  for dir in $TESTDIRS ; do
1039      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
1040          fout=$dir"/results/output.txt"          fout=$dir"/results/output.txt"
1041      else      else
1042          fout=$dir"/results_ad/output.txt_adm"          fout=$dir"/results_ad/output_adm.txt"
1043      fi      fi
1044      if test ! -r $fout ; then      if test ! -r $fout ; then
1045          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
# Line 962  for dir in $TESTDIRS ; do Line 1051  for dir in $TESTDIRS ; do
1051    
1052      # Check for additional types of monitor output      # Check for additional types of monitor output
1053    
1054      builddir="input"      builddir="build"
1055      rundir="input"      if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi
1056      use_seperate_build=0      rundir="run"
1057      if test -d $dir/build -a -r $dir/build ; then     #rundir=$builddir
1058          builddir="build"      if test ! -d $dir/$rundir ; then
1059          rundir="build"          rundir=$builddir
         use_seperate_build=1  
         linkdata $use_seperate_build $dir/$rundir  
1060      fi      fi
1061            
     #  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  
   
1062      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
1063          code_dir=code          code_dir=code
1064          CODE_DIR=$dir/code          CODE_DIR=$dir/code
1065            input_dirs='input'
1066      else      else
1067          code_dir=code_ad          code_dir=code_ad
1068          CODE_DIR=$dir/code_ad          CODE_DIR=$dir/code_ad
1069            input_dirs='input_ad input'
1070      fi      fi
1071      BUILD_DIR=$dir/$builddir      BUILD_DIR=$dir/$builddir
1072    
# Line 999  for dir in $TESTDIRS ; do Line 1074  for dir in $TESTDIRS ; do
1074          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1075          continue          continue
1076      fi      fi
1077        if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then
1078            echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"
1079            continue
1080        fi
1081    
1082        #  Check whether there are "extra runs" for this testdir
1083        extra_runs=
1084        if test "x$ADM" = x ; then
1085            ex_run_dirs=`( cd $dir ; echo input.* )`
1086            #echo "ex_run_dirs='$ex_run_dirs'"
1087            for exd in $ex_run_dirs ; do
1088                name=`echo $exd | sed -e 's/input.//g'`
1089                outf="$dir/results/output.$name.txt"
1090                if test -f $outf -a -r $outf ; then
1091                    if test "x$MULTI_THREAD" = "xt" ; then
1092                        if test -r $dir"/"$exd"/eedata.mth" ; then
1093                            extra_runs="$extra_runs $name"
1094                        #else echo $dir"/"$exd"/eedata.mth: not found"
1095                        fi
1096                    else
1097                        extra_runs="$extra_runs $name"
1098                    fi
1099                fi
1100            done
1101        fi
1102    
1103      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1104      echo      echo
1105      echo "Experiment:  $dir"      if test "x$extra_runs" = "x" ; then
1106           echo "Experiment:  $dir"
1107        else
1108           echo "Experiment:  $dir ; extra_runs=$extra_runs"
1109        fi
1110      echo      echo
1111      unset genmake makedepend make run      unset genmake makedepend make run
1112      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
# Line 1013  for dir in $TESTDIRS ; do Line 1117  for dir in $TESTDIRS ; do
1117      CDIR=`pwd`"/$rel_CDIR"      CDIR=`pwd`"/$rel_CDIR"
1118            
1119      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1120          makeclean $dir/$builddir          echo '====>>> this is to check that we never go through this part <<< ==='
1121            makeclean $dir/$builddir \
1122                && run_clean $dir/$rundir
1123      else      else
1124          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
1125              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
1126                && run_clean $dir/$rundir \
1127              && symlink_mpifiles $dir $code_dir $builddir \              && symlink_mpifiles $dir $code_dir $builddir \
1128              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
1129              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
1130              && linkdata $use_seperate_build $dir/$rundir \              && linkdata $dir/$rundir $input_dirs \
1131              && runmodel $dir/$rundir && run=Y \              && runmodel $dir/$rundir && run=Y \
1132              && results=`testoutput $dir $rundir`              && results=`testoutput $dir $rundir "txt"`
1133      fi      fi
1134            
1135      echo      echo
# Line 1044  for dir in $TESTDIRS ; do Line 1151  for dir in $TESTDIRS ; do
1151              mkdir $rel_CDIR              mkdir $rel_CDIR
1152              CDIR=`pwd`"/$rel_CDIR"              CDIR=`pwd`"/$rel_CDIR"
1153              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"
1154              for ldir in input.$ex input ; do              run_clean $dir/tr_run.$ex
1155                  (              linkdata $dir/tr_run.$ex input.$ex input
                     cd "$dir/$ldir" > /dev/null 2>&1  
                     ls -1 2>/dev/null \  
                         | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g'  
                 ) > tr_exrun_links  
                 (  
                     cd "$dir/tr_run.$ex"  
                     cat ../../tr_exrun_links | while read i ; do  
                         if test ! "x$i" = x ; then  
                             test ! -r $i  &&  ln -s "../"$ldir"/"$i $i  
                         fi  
                     done  
                 )  
                 test -e tr_exrun_links  &&  rm -f tr_exrun_links  
             done  
             ldir=build  
             (  
                 cd $dir/tr_run.$ex  
                 test ! -e mitgcmuv  &&  ln -s "../"$ldir"/"mitgcmuv .  
             )  
1156              runmodel $dir/tr_run.$ex && run=Y \              runmodel $dir/tr_run.$ex && run=Y \
1157                  && results=`testoutput $dir tr_run.$ex "."$ex`                  && results=`testoutput $dir tr_run.$ex ${ex}".txt"`
1158              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}`
1159              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1160              fres="$fres.$ex"              fres="$fres.$ex"
# Line 1077  for dir in $TESTDIRS ; do Line 1165  for dir in $TESTDIRS ; do
1165              echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"              echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1166              echo "DATE='$DATE'" >> $CDIR"/summary.txt"              echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1167              echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt"              echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt"
1168                if test "x$POSTCLEAN" = xt ; then
1169                    run_clean $dir/tr_run.$ex
1170                fi
1171          done          done
1172      else      else
1173          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 1092  for dir in $TESTDIRS ; do Line 1183  for dir in $TESTDIRS ; do
1183                             >> $CDIR"/summary.txt"                             >> $CDIR"/summary.txt"
1184      fi      fi
1185    
1186      postclean $dir/$builddir      #postclean $dir/$builddir
1187        if test "x$POSTCLEAN" = xt ; then
1188            makeclean $dir/$builddir \
1189                && run_clean $dir/$rundir
1190        fi
1191            
1192      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1193            

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.90

  ViewVC Help
Powered by ViewVC 1.1.22