From 1d014c27c7e23746d017b030ba6cf09cda1a7df9 Mon Sep 17 00:00:00 2001 From: Rob Falgout Date: Sat, 16 May 2020 08:30:29 -0700 Subject: [PATCH] Adding a Spack autotest script --- AUTOTEST/examples.sh | 16 ++++++-- AUTOTEST/machine-tux-spack.filters | 1 + AUTOTEST/machine-tux-spack.sh | 64 ++++++++++++++++++++++++++++++ AUTOTEST/make.sh | 22 ++++++++-- AUTOTEST/run.sh | 4 +- 5 files changed, 98 insertions(+), 9 deletions(-) create mode 100644 AUTOTEST/machine-tux-spack.filters create mode 100755 AUTOTEST/machine-tux-spack.sh diff --git a/AUTOTEST/examples.sh b/AUTOTEST/examples.sh index 290db8cbc..1c9c238cb 100755 --- a/AUTOTEST/examples.sh +++ b/AUTOTEST/examples.sh @@ -14,9 +14,10 @@ case $1 in $0 [-h] {src_dir} [options] [-rt ] - where: -h|-help prints this usage information and exits - {src_dir} is the hypre source directory - - run (test = default, bigint, maxdim, complex) + where: {src_dir} is the hypre source directory + - run (test = default, bigint, maxdim, complex) + -spack compile and link drivers to spack build + -h|-help prints this usage information and exits This script builds the hypre example codes in {src_dir}/examples and runs the example regression tests in test/TEST_examples. @@ -40,6 +41,9 @@ do shift break ;; + -spack) + shift; spackdir="$1"; shift + ;; -*) tname=`echo $1 | sed 's/-//'` tests="$tests $tname" @@ -61,9 +65,13 @@ mkdir -p $output_dir # Run make in the examples directory cd $src_dir/examples make clean +mopt="" +if [ -n "$spackdir" ]; then + mopt="HYPRE_DIR=$spackdir" +fi for tname in $tests do - make $tname + make $mopt $tname done # Run the examples regression test diff --git a/AUTOTEST/machine-tux-spack.filters b/AUTOTEST/machine-tux-spack.filters new file mode 100644 index 000000000..68c17b0df --- /dev/null +++ b/AUTOTEST/machine-tux-spack.filters @@ -0,0 +1 @@ +==> Warning: diff --git a/AUTOTEST/machine-tux-spack.sh b/AUTOTEST/machine-tux-spack.sh new file mode 100755 index 000000000..22804f67a --- /dev/null +++ b/AUTOTEST/machine-tux-spack.sh @@ -0,0 +1,64 @@ +#!/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 <&2 +done diff --git a/AUTOTEST/make.sh b/AUTOTEST/make.sh index 4f708f0ff..507104d6a 100755 --- a/AUTOTEST/make.sh +++ b/AUTOTEST/make.sh @@ -13,8 +13,9 @@ case $1 in $0 [-h] {src_dir} [options for make] - where: {src_dir} is the hypre source directory - -h|-help prints this usage information and exits + where: {src_dir} is the hypre source directory + -spack compile and link drivers to spack build + -h|-help prints this usage information and exits This script runs make clean; make [options] in {src_dir}. @@ -29,7 +30,22 @@ esac src_dir=`cd $1; pwd` shift +# Parse the rest of the command line +while [ "$*" ] +do + case $1 in + -spack) + shift; spackdir="$1"; shift + ;; + esac +done + # Run make cd $src_dir make clean -make $@ +if [ -n "$spackdir" ]; then + cd $src_dir/test + make HYPRE_BUILD_DIR="$spackdir" $@ +else + make $@ +fi diff --git a/AUTOTEST/run.sh b/AUTOTEST/run.sh index dbc3ae830..abfbc6a86 100755 --- a/AUTOTEST/run.sh +++ b/AUTOTEST/run.sh @@ -14,10 +14,10 @@ case $1 in $0 [-h] {src_dir} [options] [-rt ] - where: -h|-help prints this usage information and exits - {src_dir} is the hypre source directory + where: {src_dir} is the hypre source directory - run (test = ams, fac, ij, sstruct, struct) -all run all tests (default behavior) + -h|-help prints this usage information and exits This script runs runtest.sh in {src_dir}/test with optional parameters.