/[MITgcm]/MITgcm/tools/do_tst_2+2
ViewVC logotype

Diff of /MITgcm/tools/do_tst_2+2

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2 by jmc, Wed Jan 9 22:02:03 2008 UTC revision 1.6 by jmc, Thu Mar 25 23:09:29 2010 UTC
# Line 12  usage() Line 12  usage()
12          echo "  -help         : print usage"          echo "  -help         : print usage"
13          echo "  -t   LIST_EXP : only check experiments in LIST_EXP"          echo "  -t   LIST_EXP : only check experiments in LIST_EXP"
14          echo "  -skd LIST_EXP : skip experiments in LIST_EXP"          echo "  -skd LIST_EXP : skip experiments in LIST_EXP"
15            echo "  -exe  COMMAND : use COMMAND to run the tests"
16            echo "  -mpi          : run the tests using MPI"
17          echo "  -o     STRING : used to build output directory name"          echo "  -o     STRING : used to build output directory name"
18          echo "                      (DEF=\"hostname\")"          echo "                      (DEF=\"hostname\")"
19          echo "  -a,-A  STRING : email address to send output to"          echo "  -a,-A  STRING : email address to send output to"
# Line 24  usage() Line 26  usage()
26  CLEAN=0  CLEAN=0
27  TESTDIRS=  TESTDIRS=
28  SKIPDIRS=  SKIPDIRS=
29  OUTDIR=`hostname`  SCRIPT='../tools/tst_2+2'
30    scrArg='All'
31    COMMAND=
32    mpi=0
33    OUTDIR=`hostname | sed 's/\..*$//'`
34  SAVELOG=0  SAVELOG=0
35  ADDRESS=  ADDRESS=
 SCRIPT='../tools/tst_2+2'  
36  MPACK="../tools/mpack-1.6/mpack"  MPACK="../tools/mpack-1.6/mpack"
37  here=`pwd`  here=`pwd`
38  yy=  yy=
# Line 42  do Line 47  do
47        -clean) CLEAN=1 ;;        -clean) CLEAN=1 ;;
48        -t    ) yy=TESTDIRS ;;        -t    ) yy=TESTDIRS ;;
49        -skd  ) yy=SKIPDIRS ;;        -skd  ) yy=SKIPDIRS ;;
50          -exe  ) yy=COMMAND ;;
51          -mpi  ) mpi=1 ;;
52        -a    ) yy=ADDRESS ;;        -a    ) yy=ADDRESS ;;
53        -A    ) yy=ADDRESS ; SAVELOG=1 ;;        -A    ) yy=ADDRESS ; SAVELOG=1 ;;
54        -o    ) yy=OUTDIR ;;        -o    ) yy=OUTDIR ;;
# Line 128  echo  >> $SUMMARY Line 135  echo  >> $SUMMARY
135  echo 'P. Run  Result     experiment'  >> $SUMMARY  echo 'P. Run  Result     experiment'  >> $SUMMARY
136  echo '  1 2 3'  >> $SUMMARY  echo '  1 2 3'  >> $SUMMARY
137    
138    #-- For MPI test:
139    RUNOUTP="output.txt"
140    if [ $mpi -ge 1 ] ; then
141      SCRIPT="$SCRIPT -mpi"
142      RUNOUTP="STDOUT.0000"
143    fi
144    
145  for xx in $LIST  for xx in $LIST
146  do  do
147    echo ==============================================================================    echo ==============================================================================
148    listD='run '`(cd $xx/results ; ls output.*.txt 2> /dev/null | sed 's/^output\./tr_run./g' | sed 's/\.txt$//g' )`    listD='run '`(cd $xx/results ; ls output.*.txt 2> /dev/null | sed 's/^output\./tr_run./g' | sed 's/\.txt$//g' )`
149    for yy in $listD    for yy in $listD
150    do    do
151      if test -f $xx/$yy/output.txt ; then      if test -f $xx/$yy/$RUNOUTP ; then
152        if test "x$OPTFILE" = x -a -f $xx/build/Makefile ; then        if test "x$OPTFILE" = x -a -f $xx/build/Makefile ; then
153          comm=`grep '^# OPTFILE=' $xx/build/Makefile 2>/dev/null | head -1 | sed 's/^# //'`          comm=`grep '^# OPTFILE=' $xx/build/Makefile 2>/dev/null | head -1 | sed 's/^# //'`
154          echo "from '$xx/build/Makefile', extract:" > $DRESULTS/genmake_state          echo "from '$xx/build/Makefile', extract:" > $DRESULTS/genmake_state
155            sed -n '/^# executed by:/,+1 p' $xx/build/Makefile >> $DRESULTS/genmake_state
156          echo $comm >> $DRESULTS/genmake_state          echo $comm >> $DRESULTS/genmake_state
157          eval $comm          eval $comm
158        fi        fi
# Line 146  do Line 161  do
161        echo -n "Entering $xx/$yy :"        echo -n "Entering $xx/$yy :"
162        cd $xx/$yy        cd $xx/$yy
163        pwd > outp.tst_2+2.log        pwd > outp.tst_2+2.log
164        echo $SCRIPT All >> outp.tst_2+2.log ; echo ' ' >> outp.tst_2+2.log        if test "x$COMMAND" = x ; then
165        $SCRIPT All >> outp.tst_2+2.log 2>&1          echo $SCRIPT $scrArg >> outp.tst_2+2.log ; echo ' ' >> outp.tst_2+2.log
166        out=$?          $SCRIPT $scrArg >> outp.tst_2+2.log 2>&1
167            out=$?
168          else
169            echo "$SCRIPT $scrArg -command \"$COMMAND\"" >> outp.tst_2+2.log
170            echo ' ' >> outp.tst_2+2.log
171            $SCRIPT $scrArg -command "$COMMAND" >> outp.tst_2+2.log 2>&1
172            out=$?
173          fi
174        case $out in        case $out in
175         0 ) echo ' pass test 2+2=4'         0 ) echo ' pass test 2+2=4'
176             echo "Y Y Y Y  pass   <- $nam" >> ../../$SUMMARY ;;             echo "Y Y Y Y  pass   <- $nam" >> ../../$SUMMARY ;;

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

  ViewVC Help
Powered by ViewVC 1.1.22