Added a valgrind runtest and autotest feature

This commit is contained in:
Rob Falgout 2017-03-04 19:10:29 -08:00
parent a27963e036
commit 569b8d2c94
3 changed files with 41 additions and 23 deletions

View File

@ -65,15 +65,25 @@ co="--enable-debug CC=mpiCC"
test.sh basictest.sh $src_dir -co: $co -mo: $mo -ro: $ro -eo: $eo test.sh basictest.sh $src_dir -co: $co -mo: $mo -ro: $ro -eo: $eo
renametest.sh basictest $output_dir/basictest-debug-cpp renametest.sh basictest $output_dir/basictest-debug-cpp
co="--with-insure --enable-debug --with-print-errors" # co="--with-insure --enable-debug --with-print-errors"
MO="test" # MO="test"
test.sh basictest.sh $src_dir -co: $co -mo: $MO -ro: $ro # test.sh basictest.sh $src_dir -co: $co -mo: $MO -ro: $ro
renametest.sh basictest $output_dir/basictest--with-insure1 # renametest.sh basictest $output_dir/basictest--with-insure1
#
# co="--with-insure --enable-debug --enable-global-partition"
# MO="test"
# test.sh basictest.sh $src_dir -co: $co -mo: $MO -ro: $ro
# renametest.sh basictest $output_dir/basictest--with-insure2
co="--with-insure --enable-debug --enable-global-partition" co="--enable-debug --with-print-errors"
MO="test" MO="test"
test.sh basictest.sh $src_dir -co: $co -mo: $MO -ro: $ro test.sh basictest.sh $src_dir -co: $co -mo: $mo -ro: $ro -rt -valgrind
renametest.sh basictest $output_dir/basictest--with-insure2 renametest.sh basictest $output_dir/basictest--valgrind1
co="--enable-debug --enable-global-partition"
MO="test"
test.sh basictest.sh $src_dir -co: $co -mo: $mo -ro: $ro -rt -valgrind
renametest.sh basictest $output_dir/basictest--valgrind2
co="--without-MPI" co="--without-MPI"
test.sh basictest.sh $src_dir -co: $co -mo: $mo test.sh basictest.sh $src_dir -co: $co -mo: $mo

View File

@ -3,16 +3,17 @@
# global variables # global variables
BatchMode=0 BatchMode=0
NoRun=0 NoRun=0
JobCheckInterval=10 #sleep time between jobs finished check JobCheckInterval=10 # sleep time between jobs finished check
InputString="" InputString=""
RunPrefix=`type -p mpirun` RunPrefix=`type -p mpirun`
RunPrefix="$RunPrefix -np" RunPrefix="$RunPrefix -np"
RunString="" RunString=""
RunEcho="" RunEcho=""
ExecFileNames="" #string of executable file names used ExecFileNames="" # string of executable file names used
TestDirNames="" #string of names of TEST_* directories used TestDirNames="" # string of names of TEST_* directories used
HOST=`hostname` HOST=`hostname`
NumThreads=0 #number of OpenMP threads to use if > 0 NumThreads=0 # number of OpenMP threads to use if > 0
Valgrind="" # string to add to MpirunString when using valgrind
function usage function usage
{ {
@ -27,6 +28,7 @@ function usage
printf " -mpi <prefix> MPI run prefix; default is 'mpirun -np'\n" printf " -mpi <prefix> MPI run prefix; default is 'mpirun -np'\n"
printf " -nthreads <n> use 'n' OpenMP threads\n" printf " -nthreads <n> use 'n' OpenMP threads\n"
printf " -tol <tol> use relative tolerance 'tol' to compare numeric test values\n" printf " -tol <tol> use relative tolerance 'tol' to compare numeric test values\n"
printf " -valgrind use valgrind memory checker\n"
printf " -n|-norun turn off execute mode, echo what would be run\n" printf " -n|-norun turn off execute mode, echo what would be run\n"
printf " -t|-trace echo each command\n" printf " -t|-trace echo each command\n"
printf " -D <var> define <var> when running tests\n" printf " -D <var> define <var> when running tests\n"
@ -94,7 +96,9 @@ function MpirunString
if [ $NumThreads -gt 0 ] ; then if [ $NumThreads -gt 0 ] ; then
export OMP_NUM_THREADS=$NumThreads export OMP_NUM_THREADS=$NumThreads
fi fi
RunString="$RunPrefix $*" RunString="$RunPrefix $1"
shift
RunString="$RunString $Valgrind $*"
;; ;;
esac esac
} }
@ -263,12 +267,12 @@ function ExecuteJobs
;; ;;
*mpirun*) *mpirun*)
RunCmd=`echo $InputLine| sed -e 's/^[ \t]*mpirun[ \t]*//'` RunCmd=`echo $InputLine| sed -e 's/^[ \t]*mpirun[ \t]*//'` # remove 'mpirun'
RunCmd=`echo $RunCmd | sed -e 's/[ \t]*>.*$//'` RunCmd=`echo $RunCmd | sed -e 's/[ \t]*>.*$//'` # remove output redirect
OutFile=`echo $InputLine | sed -e 's/^.*>//'` OutFile=`echo $InputLine | sed -e 's/^.*>//'` # set output file
OutFile=`echo $OutFile | sed -e 's/ //g'` OutFile=`echo $OutFile | sed -e 's/ //g'` # remove extra space
ErrFile=`echo $OutFile | sed -e 's/\.out\./.err./'` ErrFile=`echo $OutFile | sed -e 's/\.out\./.err./'` # set error file
RunName=`echo $OutFile | sed -e 's/\.out.*$//'` RunName=`echo $OutFile | sed -e 's/\.out.*$//'` # set test run name
CheckPath $RunCmd # check path to executable CheckPath $RunCmd # check path to executable
if [ "$?" -gt 0 ] ; then if [ "$?" -gt 0 ] ; then
cat >> $RunName.err <<- EOF cat >> $RunName.err <<- EOF
@ -437,6 +441,15 @@ do
NumThreads=$1 NumThreads=$1
shift shift
;; ;;
-tol)
shift
CONVTOL=$1
shift
;;
-valgrind)
shift
Valgrind="valgrind -q --suppressions=`pwd`/runtest.valgrind"
;;
-n|-norun) -n|-norun)
NoRun=1 NoRun=1
RunEcho="echo" RunEcho="echo"
@ -451,11 +464,6 @@ do
eval export `echo $1`=1 eval export `echo $1`=1
shift shift
;; ;;
-tol)
shift
CONVTOL=$1
shift
;;
*) InputString=$1 *) InputString=$1
if [ "$InputString" ] ; then if [ "$InputString" ] ; then
if [ -r $InputString ] ; then if [ -r $InputString ] ; then

View File