Commit f1a933c4 authored by Stefan's avatar Stefan
Browse files

Merge branch 'RonRahaman-download-script-2'

* Use git subtree instead of downloading 3rd-party deps
parents dd304b9a e5ec91ac

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
# 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.
#!/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 )
/_hypre_utilities.h:
/HYPRE_utilities.h:
/utilities/hypre_general.h:
/utilities/mpistubs.c
double-check
#!/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
#!/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
/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
#!/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
./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
\ No newline at end of file
#!/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] {top_dir}
where: {top_dir} is the top-level hypre release directory
-h|-help prints this usage information and exits
This script checks for files without the SPDX license header.
Example usage: $0 ..
EOF
exit
;;
esac
# Setup
top_dir=`cd $1; pwd`
shift
cd $top_dir
### First check for files that do not have the license, but should
#LicStr='Copyright 1998-2019 Lawrence Livermore'
LicStr='SPDX-License-Identifier: \(Apache-2.0 OR MIT\)'
# Remove these files from the list of all files without 'SPDX'
egrep -LR "$LicStr" . | egrep -v '[.](o|a|filters|pdf|svg|gif)$' |
egrep -v '[.]/[.]git' |
egrep -v '[.]/src/(blas|lapack)/.*[.]c' |
egrep -v '[.]/src/examples/docs' |
egrep -v '[.]/src/test/TEST_.*' > check-license.files
# Add these file back to the list
egrep -LR "$LicStr" ./src/test/TEST_* |
egrep '[.](sh|jobs)$' >> check-license.files
egrep -LR "$LicStr" ./src/test/TEST_* |
egrep 'TEST_.*/.*[.]in($|[.].*$)' >> check-license.files
# Remove these individual files from the list and echo the result
cat > check-license.remove <<EOF
./check-license.files
./COPYRIGHT
./LICENSE-APACHE
./LICENSE-MIT
./NOTICE
./src/blas/COPYING
./src/cmbuild/README.txt
./src/config/cmake/hypre_CMakeUtilities.cmake
./src/config/compile
./src/config/config.guess
./src/config/config.sub
./src/config/depcomp
./src/config/install-sh
./src/config/missing
./src/config/mkinstalldirs
./src/configure
./src/docs/hypre-wwords.png
./src/docs/ref-manual/conf.doxygen
./src/docs/usr-manual/Makefile
./src/docs/usr-manual/_static/custom.css
./src/docs/usr-manual/conf.py
./src/docs/usr-manual/zREADME
./src/examples/vis.c
./src/lapack/COPYING
./src/nopoe
./src/tarch
./src/test/runtest.valgrind
EOF
egrep -v -f check-license.remove check-license.files >&2
rm -f check-license.remove check-license.files
### Next check for files that should not have the license, but do
# blas and lapack '.c' files should not have an LLNL license
egrep -lR "$LicStr" ./src/blas ./src/lapack | egrep '[.]/src/(blas|lapack)/.*[.]c' >&2
/HYPRE_config.h:
/_hypre_utilities.h:
/HYPRE_utilities.h:
/utilities/gpuMem.c:
/utilities/mpistubs.c:
/utilities/mpistubs.h:
/parcsr_mv/par_csr_matvec.c:.*MPI_PACK
/parcsr_mv/par_csr_matvec.c:.*MPI_HALO_EXC_SEND
/parcsr_mv/par_csr_matvec.c:.*MPI_HALO_EXC_RECV
/parcsr_mv/par_csr_matvec.c:.*MPI_UNPACK
#!/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 'MPI_' in certain 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-mpi.files
egrep '(^|[^[:alnum:]_]+)MPI_' `cat check-mpi.files` |
egrep -v 'MPI_Comm([^_]|$)' >&2
rm -f check-mpi.files
#!/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)
# Echo usage information
case $1 in
-h|-help)
cat <<EOF
$0 [-h|-help] [{testname}]
where: {testname} is the name of an autotest test (or multiple tests)
-h|-help prints this usage information and exits
This script removes the '.???' files and directories (e.g., .err and .dir)
for the specified tests. If no test is specified, the '.err' files in the
current directory determine the test names to use.
Example usage: $0 machine-tux
EOF
exit
;;
esac
if [ "x$1" = "x" ]
then
for i in *.err
do
if [ -f $i ] # This check is important in the case that there are no .err files
then
testname=`basename $i .err`
# Use explicit extensions to avoid removing '.bat' files
rm -fr $testname.err $testname.dir $testname.out $testname.fil
fi
done
else
while [ "$*" ]
do
testname=$1
# Use explicit extensions to avoid removing '.bat' files
rm -fr $testname.err $testname.dir $testname.out $testname.fil
shift
done
fi
@echo off
rem Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
rem HYPRE Project Developers. See the top-level COPYRIGHT file for details.
rem
rem SPDX-License-Identifier: (Apache-2.0 OR MIT)
setlocal
rem This script can be run from anywhere
rem Example usage: cmake.bat ..\src "-DHYPRE_SEQUENTIAL=ON"
rem directory where script is being run
set rundir=%cd%
rem directory where script is located
cd %~dp0
set scriptdir=%cd%
rem source directory passed in as argument 1
cd %rundir%
cd %1
set srcdir=%cd%
rem output directory is a subdirectory of rundir
set outdir=%rundir%\cmake.dir
rem cmake options passed in as argument 2
set cmakeopts=%2
rem set location of cmake and msbuild programs
set CMAKE="C:\Program Files\CMake\bin\cmake.exe"
set MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild"
rem create clean output directory
if exist %outdir% rmdir /s /q %outdir%
mkdir %outdir%
rem clean out 'cmbuild' directories
cd %srcdir% && rmdir /s /q cmbuild & mkdir cmbuild
rem run cmake for hypre library and test directory
cd %srcdir%\cmbuild
%CMAKE% -G "Visual Studio 15 2017" %cmakeopts% "-DHYPRE_BUILD_TESTS=ON" .. > %outdir%\lib-cmake.out
rem build release version
cd %srcdir%\cmbuild
%MSBUILD% HYPRE.vcxproj /t:Rebuild /p:Configuration=Release > %outdir%\lib-release.out
%MSBUILD% INSTALL.vcxproj /p:Configuration=Release >> %outdir%\lib-release.out
rem build debug version
cd %srcdir%\cmbuild
%MSBUILD% HYPRE.vcxproj /t:Rebuild /p:Configuration=Debug > %outdir%\lib-debug.out
%MSBUILD% INSTALL.vcxproj /p:Configuration=Debug >> %outdir%\lib-debug.out
rem create error file - inspect output file lines with "Error(s)" substring
cd %rundir%
type NUL > cmake.err
for %%f in (%outdir%\*.out) do (
set sum=0
for /f "tokens=1" %%i in ('findstr "Error(s)" %%f') do set /a sum+=%%i
if %sum% gtr 0 @echo %%f >> cmake.err
)
cd %rundir%
endlocal
#!/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)