/[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.2 by edhill, Mon Sep 1 16:50:27 2003 UTC revision 1.9.2.4 by edhill, Fri Oct 3 05:12:18 2003 UTC
# Line 10  usage() Line 10  usage()
10      echo      echo
11      echo "where possible OPTIONS are:"      echo "where possible OPTIONS are:"
12      echo "  (-help|-h)               print usage"      echo "  (-help|-h)               print usage"
13      echo "  (-optfile=|-of=)STRING   list of genmake2 \"optfiles\""      echo "  (-mpi)                   use MPI input files"
14        echo "  (-optfile=|-of=)STRING   list of optfiles to use"
15      echo "  (-a|-addr)STRING         list of email recipients"      echo "  (-a|-addr)STRING         list of email recipients"
16      echo "  (-t|-tdir)STRING         list of \"test\" dirs"      echo "                             (DEF=\"edhill@mitgcm.org\")"
17        echo "  (-t|-tdir)STRING         list of test dirs to use"
18        echo "                             (DEF=\"\" which builds all)"
19        echo "  (-b|-bash)STRING         location of \"bash\" executable"
20        echo "                             (DEF=\"\" for \"/bin/bash\")"
21        echo "  (-c|-command)STRING      command to run"
22        echo "                             (DEF=\"make output.txt\")"
23        echo "  (-m|-make)STRING         command to use for \"make\""
24        echo "                             (DEF=\"make\")"
25        echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
26        echo "  (-nogenmake|-ng)         skip the genmake stage"
27        echo "  (-noclean|-nc)           skip the \"make clean\" stage"
28        echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
29        echo
30        echo "and where STRING follows a whitespace-delimited format"
31        echo "such as:"
32        echo "  -t 'exp0 exp2 exp3' "
33        echo "  -addr='abc@123.com testing@home.org'"
34      echo      echo
35      exit 1      exit 1
36  }  }
# Line 29  build_mpack() Line 47  build_mpack()
47              exit 1              exit 1
48          fi          fi
49          echo -n "building mpack...  "          echo -n "building mpack...  "
50          ( cd $MPACKDIR && ./configure && make ) > build_mpack.out 2>&1          ( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1
51          RETVAL=$?          RETVAL=$?
52          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
53              echo              echo
# Line 160  testoutput() Line 178  testoutput()
178  genmakemodel()  genmakemodel()
179  {  {
180      # genmakemodel directory      # genmakemodel directory
181      GENMAKE2="../../../tools/genmake2"      if test "x$NOGENMAKE" = xt ; then
182      (          echo "genmake skipped!"
183          cd $1;      else
184          printf 'genmake ... ' 1>&2          GENMAKE2="$BASH ../../../tools/genmake2"
185          # ../../../tools/genmake -ieee -mods=../code > make.log 2>&1          (
186          $GENMAKE2  -ds --mods=../code "--optfile="$OPTFILE > make.log 2>&1              cd $1;
187          RETVAL=$?              printf 'genmake ... ' 1>&2
188          for i in gm_state gm_optfile gm_local Makefile ; do              # ../../../tools/genmake -ieee -mods=../code > make.log 2>&1
189              if test -r $i ; then              $GENMAKE2  -ds -m $MAKE --mods=../code "--optfile="$OPTFILE > make.log 2>&1
190                  cp $i $CDIR              RETVAL=$?
191                for i in gm_state gm_optfile gm_local Makefile ; do
192                    if test -r $i ; then
193                        cp $i $CDIR
194                    fi
195                done
196                if test "x$RETVAL" != x0 ; then
197                    tail make.log
198                    echo "genmakemodel: genmake failed" 1>&2
199                    cp make.log $CDIR
200                    return 1
201                else
202                    echo "succesful" 1>&2
203              fi              fi
204          done          )
205          if test "x$RETVAL" != x0 ; then      fi
             tail make.log  
             echo "genmakemodel: genmake failed" 1>&2  
             cp make.log $CDIR  
             return 1  
         else  
             echo "succesful" 1>&2  
         fi  
     )  
206  }  }
207    
208  makeclean()  makeclean()
209  {  {
210      # makeclean directory      # makeclean directory
211      (      if test "x$NOCLEAN" = xt ; then
212          cd $1;          echo "make CLEAN skipped!"
213          rm -f output.txt      else
214          printf 'make CLEAN ... ' 2>&1          (
215          if test -r Makefile ; then              cd $1;
216              make CLEAN >> make.log 2>&1              if test -e output.txt ; then
217              RETVAL=$?                  rm -f output.txt
             if test "x$RETVAL" != x0 ; then  
                 tail make.log  
                 echo "makeclean: \"make CLEAN\" failed" 1>&2  
                 cp make.log $CDIR"/make.log"  
                 return 1  
218              fi              fi
219          fi              printf 'make CLEAN ... ' 2>&1
220          echo succesful 1>&2              if test -r Makefile ; then
221          exit 0                  $MAKE CLEAN >> make.log 2>&1
222      )                  RETVAL=$?
223                    if test "x$RETVAL" != x0 ; then
224                        tail make.log
225                        echo "makeclean: \"make CLEAN\" failed" 1>&2
226                        cp make.log $CDIR"/make.log"
227                        return 1
228                    fi
229                fi
230                echo succesful 1>&2
231                exit 0
232            )
233        fi
234  }  }
235    
236  makedependmodel()  makedependmodel()
237  {  {
238      # makedependmodel directory      # makedependmodel directory
239      (      if test "x$NODEPEND" = xt ; then
240          cd $1;          echo "make depend skipped!"
241          printf 'make depend ... ' 1>&2      else
242          make depend >> make.log 2>&1          (
243          RETVAL=$?              cd $1;
244          if test "x$RETVAL" != x0 ; then              printf 'make depend ... ' 1>&2
245              tail make.log              $MAKE depend >> make.log 2>&1
246              echo "makedependmodel: make depend failed" 1>&2              RETVAL=$?
247              cp make.log $CDIR"/make.log"              if test "x$RETVAL" != x0 ; then
248              return 1                  tail make.log
249          else                  echo "makedependmodel: make depend failed" 1>&2
250              echo succesful 1>&2                  cp make.log $CDIR"/make.log"
251          fi                  return 1
252      )              else
253                    echo succesful 1>&2
254                fi
255            )
256        fi
257  }  }
258    
259  makemodel()  makemodel()
# Line 231  makemodel() Line 263  makemodel()
263          cd $1;          cd $1;
264          if test -r Makefile ; then          if test -r Makefile ; then
265              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
266              make >> make.log 2>&1              $MAKE >> make.log 2>&1
267              RETVAL=$?              RETVAL=$?
268              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
269                  tail make.log                  tail make.log
# Line 257  linkdata() Line 289  linkdata()
289    
290  runmodel()  runmodel()
291  {  {
292      # runmodel directory exe      # runmodel directory
293      #      #
294      #  runs the model "exe" in "directory" (exe is relative to directory)      #  runs "$COMMAND" in "directory"
295        #  (where "$COMMAND" is relative to "directory")
296      (      (
297          cd $1          cd $1
298          if [ -x $2 ]; then          printf 'runmodel: ' 1>&2
299              if [ $quick -eq 0 ]; then          # make output.txt
300                  rm -f output.txt          $COMMAND
301              fi          RETVAL=$?
302              printf 'runmodel: ' 1>&2          if test "x$RETVAL" = x0 ; then
303              make output.txt              cp output.txt $CDIR"/output.txt"
304              RETVAL=$?              return 0
305              if test "x$RETVAL" = x0 ; then          else
306                  cp output.txt $CDIR"/output.txt"              return 1
                 return 0  
             else  
                 return 1  
             fi  
307          fi          fi
308      )      )
309  }  }
# Line 315  EOFA Line 344  EOFA
344          return 0          return 0
345      else      else
346          echo          echo
347          echo "createcodelet: failed to compile codelet" | tee          echo "createcodelet: failed to compile codelet"
348          exit 1          exit 1
349      fi      fi
350  }  }
# Line 347  show_help() Line 376  show_help()
376  {  {
377      cat - << EOF      cat - << EOF
378  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]
379   -help      Show this help message  
380   -quick     Skip "genmake" and "make depend" if the Makefile exists   -help|-h      Show this help message
381   -quiet     Reduce the amount of output   -quiet     Reduce the amount of output
382   -verbose   Produce copious amounts of output   -verbose   Produce copious amounts of output
383   -debug     Produce even more output which will mean nothing to most   -debug     Produce even more output which will mean nothing to most
# Line 383  scandirs() Line 412  scandirs()
412  #  Default properties  #  Default properties
413  debug=0  debug=0
414  verbose=1  verbose=1
 quick=0  
415  clean=0  clean=0
 ieee=1  
416  expts=''  expts=''
417    # ieee=1
418    
419    CLEANUP=f
420    QUICK=f
421    NOGENMAKE=f
422    NOCLEAN=f
423    NODEPEND=f
424    
425    BASH=
426  OPTFILES=  OPTFILES=
427  ADDRESSES=edhill@mitgcm.org  ADDRESSES=
428  TESTDIRS=  TESTDIRS=
429  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
430  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
431    COMMAND="make output.txt"
432    MAKE=make
433    MPI=f
434    
435  echo -n "parsing options...  "  echo -n "parsing options...  "
436    
# Line 428  for ac_option ; do Line 466  for ac_option ; do
466          -tdir=* | --tdir=*)          -tdir=* | --tdir=*)
467              TESTDIRS=$ac_optarg ;;              TESTDIRS=$ac_optarg ;;
468    
469          -quick) quick=1 ;;          -bash | --bash | -b | --b)
470                ac_prev=BASH ;;
471            -bash=* | --bash=*)
472                BASH=$ac_optarg ;;
473    
474            -command | --command | -c | --c)
475                ac_prev=COMMAND ;;
476            -command=* | --command=*)
477                COMMAND=$ac_optarg ;;
478    
479            -make | --make | -m | --m)
480                ac_prev=MAKE ;;
481            -make=* | --make=*)
482                MAKE=$ac_optarg ;;
483    
484            -clean | --clean)
485                CLEANUP=t ;;
486    
487            -quick | --quick | -q | --q)
488                QUICK=t ;;
489            -nogenmake | --nogenmake | -ng | --ng)
490                NOGENMAKE=t ;;
491            -noclean | --noclean | -nc | --nc)
492                NOCLEAN=t ;;
493            -nodepend | --nodepend | -nd | --nd)
494                NODEPEND=t ;;
495    
496            -mpi) MPI=t ;;
497          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
498          -debug) debug=1 ;;          -debug) debug=1 ;;
499          -clean) clean=1 ;;          -clean) clean=1 ;;
         -noieee) ieee=0 ;;  
500          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
501    
502          -*)          -*)
# Line 449  for ac_option ; do Line 513  for ac_option ; do
513            
514  done  done
515    
516    if test "x$QUICK" = xt ; then
517        NOGENMAKE=t
518        NOCLEAN=t
519        NODEPEND=t
520    fi
521    
522  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
523      TESTDIRS=`scandirs`      TESTDIRS=`scandirs`
524  fi  fi
525    
526    if test "x$OPTFILES" = x ; then
527        OPTFILES=$MITGCM_OF
528    fi
529    if test "x$OPTFILES" = x ; then
530        echo "Error: please specify an optfile using either the command-line or"
531        echo "  the MITGCM_OF environment variable.  Also, examples are located "
532        echo "  in \$ROOTDIR/tools/build_options"
533        exit 1
534    fi
535    
536  echo "OK"  echo "OK"
537    
538  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
# Line 505  for OPTFILE in $OPTFILES ; do Line 585  for OPTFILE in $OPTFILES ; do
585            
586      #  ...and each test directory...      #  ...and each test directory...
587      for dir in $TESTDIRS ; do      for dir in $TESTDIRS ; do
588            
589            #  Cleanup only!
590            if test "x$CLEANUP" = xt ; then
591                if test -r $dir/build/Makefile ; then
592                    ( cd $dir/build ; make CLEAN )
593                fi
594                if test -r $dir/input/Makefile ; then
595                    ( cd $dir/input ; make CLEAN )
596                fi
597                continue
598            fi
599    
600            #  Verify that the testdir exists and contains previous
601            #  results in the correct location--or skip this directory!
602            if test ! -r $dir"/results/output.txt" ; then
603                echo
604                echo "can't read \"$dir/results/output.txt\" -- skipping $dir"
605                echo
606                continue
607            fi
608    
609            #  Is this an MPI run?
610            if test "x$MPI" = xt ; then
611                if test ! -r $dir"/code/CPP_EEOPTIONS.h_mpi" -o ! -r $dir"/code/SIZE.h_mpi" ; then
612                    echo | tee -a $SUMMARY
613                    echo "can't read \"$dir/code/CPP_EEOPTIONS.h_mpi\" or \"$dir/code/SIZE.h_mpi\"" \
614                        | tee -a $SUMMARY
615                    continue
616                else
617                    cmp $dir"/code/CPP_EEOPTIONS.h_mpi" $dir"/code/CPP_EEOPTIONS.h"
618                    RETVAL=$?
619                    if test "x$RETVAL" != x0 ; then
620                        cp $dir"/code/CPP_EEOPTIONS.h_mpi" $dir"/code/CPP_EEOPTIONS.h"
621                    fi
622                    cmp $dir"/code/SIZE.h_mpi" $dir"/code/SIZE.h"
623                    RETVAL=$?
624                    if test "x$RETVAL" != x0 ; then
625                        cp $dir"/code/SIZE.h_mpi" $dir"/code/SIZE.h"
626                    fi
627                fi
628            else
629                if test -r $dir"/code/CPP_EEOPTIONS.h_nompi" ; then
630                    cmp $dir"/code/CPP_EEOPTIONS.h_nompi" $dir"/code/CPP_EEOPTIONS.h"
631                    RETVAL=$?
632                    if test "x$RETVAL" != x0 ; then
633                        cp $dir"/code/CPP_EEOPTIONS.h_nompi" $dir"/code/CPP_EEOPTIONS.h"
634                    fi
635                fi
636                if test -r $dir"/code/SIZE.h_nompi" ; then
637                    cmp $dir"/code/SIZE.h_nompi" $dir"/code/SIZE.h"
638                    RETVAL=$?
639                    if test "x$RETVAL" != x0 ; then
640                        cp $dir"/code/SIZE.h_nompi" $dir"/code/SIZE.h"
641                    fi
642                fi
643            fi
644    
645          #  Create an output dir for each OPTFILE/tdir combination          #  Create an output dir for each OPTFILE/tdir combination
646          CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR          CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR
647          mkdir $CDIR          mkdir $CDIR
# Line 518  for OPTFILE in $OPTFILES ; do Line 654  for OPTFILE in $OPTFILES ; do
654          echo          echo
655          unset genmake makedepend make run          unset genmake makedepend make run
656          results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'          results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
657          ( cd $dir/input; rm -f *.{o,f,c,F} *.[f,F]90 work* output.txt Make* make.log; )  
658          if [ -r $dir/build ]; then          if [ -r $dir/build ]; then
659              seperatebuilddir=1              seperatebuilddir=1
660              builddir=build              builddir=build
# Line 530  for OPTFILE in $OPTFILES ; do Line 666  for OPTFILE in $OPTFILES ; do
666              rundir=input              rundir=input
667          fi          fi
668    
669          #  Verify that the testdir exists and contains previous          if test "x$CLEANUP" = xt ; then
670          #  results in the correct location--or skip this directory!              makeclean $dir/$builddir
671          if test ! -r $dir"/results/output.txt" ; then          else
672              echo | tee $SUMMARY              genmakemodel $dir/$builddir && genmake=Y \
673              echo "can't read \"$dir/results/output.txt\" -- skipping $dir" \                  && makeclean $dir/$builddir \
674                  | tee $SUMMARY                  && makedependmodel $dir/$builddir && makedepend=Y \
675              continue                  && makemodel $dir/$builddir && make=Y \
676                    && linkdata $seperatebuilddir $dir/$rundir \
677                    && runmodel $dir/$builddir && run=Y \
678                    && results=`testoutput $dir $rundir`
679          fi          fi
680    
         genmakemodel $dir/$builddir && genmake=Y \  
             && makeclean $dir/$builddir \  
             && makedependmodel $dir/$builddir && makedepend=Y \  
             && makemodel $dir/$builddir && make=Y \  
             && linkdata $seperatebuilddir $dir/$rundir \  
             && runmodel $dir/$builddir mitgcmuv && run=Y \  
             && results=`testoutput $dir $rundir`  
681          echo          echo
682          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
683              ${run:-N} $results              ${run:-N} $results
# Line 567  for OPTFILE in $OPTFILES ; do Line 699  for OPTFILE in $OPTFILES ; do
699              gzip $NDIR".tar"              gzip $NDIR".tar"
700          )          )
701    
702          $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES          if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
703          RETVAL=$?              echo "No mail sent"
         if test "x$RETVAL" != x0 ; then  
             echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"  
704          else          else
705              rm -f $DRESULTS"/"$NDIR".tar*"              $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES
706                RETVAL=$?
707                if test "x$RETVAL" != x0 ; then
708                    echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"
709                else
710                    rm -f $DRESULTS"/"$NDIR".tar*"
711                fi
712          fi          fi
713    
714          NDIR=$(( $NDIR + 1 ))          NDIR=$(( $NDIR + 1 ))

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.9.2.4

  ViewVC Help
Powered by ViewVC 1.1.22