Skip to content

Commit

Permalink
Squashed '3rd_party/hypre/' content from commit 1b687efdc
Browse files Browse the repository at this point in the history
git-subtree-dir: 3rd_party/hypre
git-subtree-split: 1b687efdc97223abc23c192051c4a7de2ac4cd51
  • Loading branch information
Ron Rahaman committed Feb 9, 2021
0 parents commit 1f2f0d7
Show file tree
Hide file tree
Showing 1,766 changed files with 907,425 additions and 0 deletions.
52 changes: 52 additions & 0 deletions AUTOTEST/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)


This directory contains scripts for running various tests on the hypre library.
The scripts augment the 'runtest.sh' runtime tests in 'test/TEST_*'.

Every test in this directory may be run manually by developers. Many of the
scripts are also run as part of the nightly regression testing, currently
developed and maintained in a separate git repository called 'hypre/autotest'.

=====================

Organization:

This directory mainly consists of a number of simple Bourne-shell scripts (the
files with a '.sh' extension). Except for a few "special scripts" (below), each
represents an individual test written by a hypre developer. The special scripts
are as follows (note that they are the only scripts with "test" in their names):

1. 'test.sh' - Used to run individual tests.
2. 'cleantest.sh' - Used to clean up the output from a test (or tests).
3. 'renametest.sh' - Used to rename the output from a test.

Usage information for every script (special or individual test) can be obtained
by running it with the '-h' option (e.g., 'test.sh -h' or 'make.sh -h').

=====================

Writing tests:

The rules for writing tests are given in the 'test.sh -h' usage information.
When writing tests, keep in mind the design goals below, especially with respect
to simplicity, flexibility, and portability.

To write a new test, just use an existing test (e.g., 'default.sh') as a
template and make the appropriate modifications. Try not to use the word "test"
in the name of the script so that we can keep the convention of only the special
scripts having this in their names. Try not to use absolute directory paths in
the script.

=====================

Design goals:

- Minimal limitations on the types of tests that are possible.
- Developers should be able to run the tests manually.
- Minimal dependence on operating system and software tools (for portability).
- Developers should be able to easily add new tests.
- Simplicity and flexibility.
99 changes: 99 additions & 0 deletions AUTOTEST/basic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/bin/sh
# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

testname=`basename $0 .sh`

# Echo usage information
case $1 in
-h|-help)
cat <<EOF
$0 [-h] {src_dir} [options]
where: {src_dir} is the hypre source directory
-co: <opts> options for configure script
-mo: <opts> options for make script
-ro: <opts> call the run script with these options
-eo: <opts> call the examples script with these options
-h|-help prints this usage information and exits
This script configures and compiles the source in {src_dir}, then optionally
runs driver and example tests.
Example usage: $0 ../src -ro: -ij -sstruct
EOF
exit
;;
esac

# Set src_dir
src_dir=`cd $1; pwd`
shift

# Parse the rest of the command line
copts=""
mopts=""
ropts=""
eopts=""
while [ "$*" ]
do
case $1 in
-co:)
opvar="copts"; shift
;;
-mo:)
opvar="mopts"; shift
;;
-ro:)
opvar="ropts"; rset="yes"; shift
;;
-eo:)
opvar="eopts"; eset="yes"; shift
;;
*)
eval $opvar=\"\$$opvar $1\"
shift
;;
esac
done

# Setup
test_dir=`pwd`
output_dir=`pwd`/$testname.dir
rm -fr $output_dir
mkdir -p $output_dir

# Configure
# NOTE: The use of 'eval' is needed to deal properly with nested quotes in argument lists
eval ./test.sh configure.sh $src_dir $copts
mv -f configure.??? $output_dir

# Make
./test.sh make.sh $src_dir $mopts
mv -f make.??? $output_dir

# Run
if [ -n "$rset" ]; then
./test.sh run.sh $src_dir $ropts
mv -f run.??? $output_dir
fi

# Examples
if [ -n "$eset" ]; then
./test.sh examples.sh $src_dir $eopts
mv -f examples.??? $output_dir
fi

# 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

# Clean up
( cd $src_dir; make distclean )

5 changes: 5 additions & 0 deletions AUTOTEST/check-double.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/_hypre_utilities.h:
/HYPRE_utilities.h:
/utilities/hypre_general.h:
/utilities/mpistubs.c
double-check
43 changes: 43 additions & 0 deletions AUTOTEST/check-double.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/sh
# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

testname=`basename $0 .sh`

# Echo usage information
case $1 in
-h|-help)
cat <<EOF
$0 [-h|-help] {src_dir}
where: {src_dir} is the hypre source directory
-h|-help prints this usage information and exits
This script checks for 'double' in sections of hypre.
Example usage: $0 ../src
EOF
exit
;;
esac

# Setup
src_dir=`cd $1; pwd`
shift

cd $src_dir

find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' |
egrep -v '/cmbuild' |
egrep -v '/docs' |
egrep -v '/examples' |
egrep -v '/FEI_mv' |
egrep -v '/hypre/include' > check-double.files

egrep '(^|[^[:alnum:]_]+)double([^[:alnum:]_]+|$)' `cat check-double.files` >&2

rm -f check-double.files
1 change: 1 addition & 0 deletions AUTOTEST/check-glob-symb.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FEI_mv/SuperLU/SRC
58 changes: 58 additions & 0 deletions AUTOTEST/check-glob-symb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/sh
# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

testname=`basename $0 .sh`

# Echo usage information
case $1 in
-h|-help)
cat <<EOF
$0 [-h|-help] {src_dir}
where: {src_dir} is the hypre source directory
-h|-help prints this usage information and exits
This script checks if there are any globally defined symbols in libHYPRE.a
without the appropriate namespace protection.
Example usage: $0 ../src
EOF
exit
;;
esac

# Setup
src_dir=`cd $1; pwd`
shift

cd $src_dir

# find global symbols
if [ -f lib/libHYPRE.a ]; then
nm -o --extern-only --defined-only lib/libHYPRE.a |
grep -vi hypre_ |
grep -vi mli_ |
grep -vi fei_ |
grep -vi Euclid |
grep -vi ParaSails |
grep -v " _Z" > check-glob-symb.temp
else
echo "check-glob-symb.sh can't find lib/libHYPRE.a"
fi

# find the '.o' file directories and add them to the output for filtering
while read line
do
sym=`echo $line | awk -F: '{print $2}'`
for dir in `find . -name $sym`
do
echo $line | awk -v dir=$dir -F: 'BEGIN {OFS=FS} {print $1,dir,$3}'
done
done < check-glob-symb.temp >&2

rm -f check-glob-symb.temp
16 changes: 16 additions & 0 deletions AUTOTEST/check-int.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/f2c.h:
/HYPRE_config.h:
/hypre_printf.c:
/_hypre_utilities.h:
/HYPRE_utilities.h:
/utilities/hypre_general.h:
/utilities/mpistubs.c
as long as
too long
long range interpolation
long-range interpolation
monstrously long
get a long msg
long rows
utilities/hypre_hopscotch_hash.h: //return _InterlockedCompareExchange
utilities/hypre_hopscotch_hash.h: //return _InterlockedExchangeAdd
45 changes: 45 additions & 0 deletions AUTOTEST/check-int.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/sh
# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

testname=`basename $0 .sh`

# Echo usage information
case $1 in
-h|-help)
cat <<EOF
$0 [-h|-help] {src_dir}
where: {src_dir} is the hypre source directory
-h|-help prints this usage information and exits
This script checks for 'int' in the 'HYPRE_Int' sections of hypre.
Example usage: $0 ../src
EOF
exit
;;
esac

# Setup
src_dir=`cd $1; pwd`
shift

cd $src_dir

find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' |
egrep -v '/cmbuild' |
egrep -v '/docs' |
egrep -v '/examples' |
egrep -v '/FEI_mv' |
egrep -v '/hypre/include' > check-int.files

egrep '(^|[^[:alnum:]_]+)int([^[:alnum:]_]+|$)' `cat check-int.files` >&2

egrep '(^|[^[:alnum:]_]+)long([^[:alnum:]_]+|$)' `cat check-int.files` >&2

rm -f check-int.files
17 changes: 17 additions & 0 deletions AUTOTEST/check-license.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
./AUTOTEST/.*.out
./AUTOTEST/.*.fil
./AUTOTEST/.*.err
./AUTOTEST/.*.log
./src/test/struct_migrate
./src/test/maxwell_unscaled
./src/test/sstruct_fac
./src/test/ams_driver
./src/test/zboxloop
./src/test/ij
./src/test/ij_mv
./src/test/struct
./src/test/sstruct
./src/zerr
./src/config.log
./src/config.status
TVD.v3breakpoints
Loading

0 comments on commit 1f2f0d7

Please sign in to comment.