2007-12-01 06:46:12 +08:00
|
|
|
#!/bin/sh
|
2019-07-08 10:26:24 +08:00
|
|
|
# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
|
|
|
|
|
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
|
2007-12-01 06:46:12 +08:00
|
|
|
#
|
2019-07-08 10:26:24 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
2007-12-01 06:46:12 +08:00
|
|
|
|
|
|
|
|
testname=`basename $0 .sh`
|
2013-10-12 03:48:06 +08:00
|
|
|
tests=""
|
2007-12-01 06:46:12 +08:00
|
|
|
|
|
|
|
|
# Echo usage information
|
2015-01-13 05:06:36 +08:00
|
|
|
case $1 in
|
|
|
|
|
-h|-help)
|
|
|
|
|
cat <<EOF
|
2007-12-01 06:46:12 +08:00
|
|
|
|
2015-01-13 05:06:36 +08:00
|
|
|
$0 [-h] {src_dir} [options] [-rt <options for runtest.sh script>]
|
2007-12-01 06:46:12 +08:00
|
|
|
|
2020-05-16 23:30:29 +08:00
|
|
|
where: {src_dir} is the hypre source directory
|
|
|
|
|
-<test> run <test> (test = default, bigint, maxdim, complex)
|
|
|
|
|
-spack <dir> compile and link drivers to spack build
|
|
|
|
|
-h|-help prints this usage information and exits
|
2007-12-01 06:46:12 +08:00
|
|
|
|
2015-01-13 05:06:36 +08:00
|
|
|
This script builds the hypre example codes in {src_dir}/examples and runs the
|
|
|
|
|
example regression tests in test/TEST_examples.
|
2007-12-01 06:46:12 +08:00
|
|
|
|
2016-01-16 02:30:49 +08:00
|
|
|
Example usage: $0 ../src -maxdim
|
2007-12-01 06:46:12 +08:00
|
|
|
|
|
|
|
|
EOF
|
2015-01-13 05:06:36 +08:00
|
|
|
exit
|
|
|
|
|
;;
|
|
|
|
|
esac
|
2013-10-12 03:48:06 +08:00
|
|
|
|
2015-01-13 05:06:36 +08:00
|
|
|
# Set src_dir
|
2016-01-19 09:05:14 +08:00
|
|
|
src_dir=`cd $1; pwd`
|
|
|
|
|
shift
|
2015-01-13 05:06:36 +08:00
|
|
|
|
|
|
|
|
# Parse the rest of the command line
|
|
|
|
|
while [ "$*" ]
|
|
|
|
|
do
|
|
|
|
|
case $1 in
|
|
|
|
|
-rt)
|
|
|
|
|
shift
|
|
|
|
|
break
|
|
|
|
|
;;
|
2020-05-16 23:30:29 +08:00
|
|
|
-spack)
|
|
|
|
|
shift; spackdir="$1"; shift
|
|
|
|
|
;;
|
2013-10-12 03:48:06 +08:00
|
|
|
-*)
|
|
|
|
|
tname=`echo $1 | sed 's/-//'`
|
|
|
|
|
tests="$tests $tname"
|
|
|
|
|
shift
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# If no tests were specified, run default
|
|
|
|
|
if [ "$tests" = "" ]; then
|
|
|
|
|
tests="default"
|
|
|
|
|
fi
|
2007-12-01 06:46:12 +08:00
|
|
|
|
|
|
|
|
# Setup
|
2011-01-12 09:02:53 +08:00
|
|
|
output_dir=`pwd`/$testname.dir
|
|
|
|
|
rm -fr $output_dir
|
|
|
|
|
mkdir -p $output_dir
|
2007-12-01 06:46:12 +08:00
|
|
|
|
|
|
|
|
# Run make in the examples directory
|
2015-01-13 05:06:36 +08:00
|
|
|
cd $src_dir/examples
|
2007-12-01 06:46:12 +08:00
|
|
|
make clean
|
2020-05-16 23:30:29 +08:00
|
|
|
mopt=""
|
|
|
|
|
if [ -n "$spackdir" ]; then
|
|
|
|
|
mopt="HYPRE_DIR=$spackdir"
|
|
|
|
|
fi
|
2013-10-12 03:48:06 +08:00
|
|
|
for tname in $tests
|
|
|
|
|
do
|
2020-05-16 23:30:29 +08:00
|
|
|
make $mopt $tname
|
2013-10-12 03:48:06 +08:00
|
|
|
done
|
2011-01-12 09:02:53 +08:00
|
|
|
|
|
|
|
|
# Run the examples regression test
|
2015-01-13 05:06:36 +08:00
|
|
|
cd $src_dir/test
|
2013-10-12 03:48:06 +08:00
|
|
|
for tname in $tests
|
|
|
|
|
do
|
|
|
|
|
./runtest.sh $@ TEST_examples/$tname.sh
|
|
|
|
|
done
|
2011-01-12 09:02:53 +08:00
|
|
|
|
|
|
|
|
# Collect all error files from the tests
|
|
|
|
|
for errfile in $( find TEST_examples -name "*.err" -o -name "*.fil" -o -name "*.out*" )
|
|
|
|
|
do
|
|
|
|
|
mkdir -p $output_dir/`dirname $errfile`
|
|
|
|
|
mv -f $errfile $output_dir/$errfile
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# 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
|