Added a -nthreads feature to runtest.sh and added an openmp.sh autotest.

This commit is contained in:
falgout 2011-01-11 01:20:51 +00:00
parent 15539bec25
commit 136639c2ee
3 changed files with 74 additions and 3 deletions

View File

@ -46,8 +46,8 @@ src_dir=$1
shift
# Test runtest tests
./test.sh default.sh $src_dir
mv -f default.??? $output_dir
./test.sh openmp.sh $src_dir
mv -f openmp.??? $output_dir
# Test linking for different languages
link_opts="all++ all77"

59
AUTOTEST/openmp.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/sh
#BHEADER**********************************************************************
# Copyright (c) 2008, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
# This file is part of HYPRE. See file COPYRIGHT for details.
#
# HYPRE is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License (as published by the Free
# Software Foundation) version 2.1 dated February 1999.
#
# $Revision$
#EHEADER**********************************************************************
testname=`basename $0 .sh`
# Echo usage information
case $1 in
-h|-help)
cat <<EOF
$0 [-h] {src_dir} [options for configure]
where: {src_dir} is the hypre source directory
-h|-help prints this usage information and exits
This script performs configure+make+run tests in {src_dir} with openmp turned on.
Example usage: $0 ..
EOF
exit
;;
esac
# Setup
output_dir=`pwd`/$testname.dir
rm -fr $output_dir
mkdir -p $output_dir
src_dir=$1
shift
# Call the configure, make and run scripts
./test.sh configure.sh $src_dir --with-openmp $@
mv -f configure.??? $output_dir
./test.sh make.sh $src_dir test
mv -f make.??? $output_dir
./test.sh run.sh $src_dir -D HYPRE_NO_SAVED
mv -f run.??? $output_dir -nthreads 2
# Echo to stderr all nonempty error files in $output_dir
for errfile in $( find $output_dir ! -size 0 -name "*.err" )
do
echo $errfile >&2
done

View File

@ -6,9 +6,11 @@ NoRun=0
JobCheckInterval=10 #sleep time between jobs finished check
InputString=""
RunString=""
RunEcho=""
ExecFileNames="" #string of executable file names used
TestDirNames="" #string of names of TEST_* directories used
HOST=`hostname|cut -c1-4` #first 4 characters of host platform name
NumThreads=0 #number of OpenMP threads to use if > 0
function usage
{
@ -20,6 +22,7 @@ function usage
printf "\n"
printf " with options:\n"
printf " -h|-help prints this usage information and exits\n"
printf " -nthreads <n> use 'n' OpenMP threads\n"
printf " -n|-norun turn off execute mode, echo what would be run\n"
printf " -t|-trace echo each command\n"
printf " -D <var> define <var> when running tests\n"
@ -95,6 +98,9 @@ function MpirunString
RunString="${RunString} -cwd $MY_EXECUTE_DIR -args \" $MY_ARGS \" "
;;
hera*) shift
if [ $NumThreads -gt 0 ] ; then
export OMP_NUM_THREADS=$NumThreads
fi
RunString="srun -p pdebug -n$*"
;;
zeus*) shift
@ -330,7 +336,7 @@ EOF
;;
esac
if [ "$BatchMode" -eq 0 ] ; then
${RunString} > $OutFile 2> $ErrFile </dev/null
${RunEcho} ${RunString} > $OutFile 2> $ErrFile </dev/null
else
if [ "$BatchFlag" -eq 0 ] ; then
BatchFile=`echo $OutFile | sed -e 's/\.out\./.batch./'`
@ -475,8 +481,14 @@ do
usage
exit
;;
-nthreads)
shift
NumThreads=$1
shift
;;
-n|-norun)
NoRun=1
RunEcho="echo"
shift
;;
-t|-trace)