From 6f0bf933bc91496c51fee90c6dd06bf8436a65e9 Mon Sep 17 00:00:00 2001 From: Alan Dayton <6393677+adayton1@users.noreply.github.com> Date: Mon, 5 Aug 2024 09:29:33 -0700 Subject: [PATCH] Make SVPH package optional (#291) * Make SVPH package optional * Filter out SVPH tests if disabled --- RELEASE_NOTES.md | 1 + cmake/SetupSpheral.cmake | 1 + scripts/CMakeLists.txt | 3 +++ src/CMakeLists.txt | 7 +++++-- src/PYB11/CMakeLists.txt | 5 ++++- tests/integration.ats | 4 +++- tests/unit/SVPH/testInterpolation-1d.py | 2 +- tests/unit/SVPH/testSVPHInterpolation-1d.py | 2 +- tests/unit/SVPH/testSVPHInterpolation-2d.py | 2 +- 9 files changed, 20 insertions(+), 7 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a0f78836a..0d92262b4 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -20,6 +20,7 @@ Notable changes include: * Distributed source directory must always be built now. * Git strategies in the Gitlab CI are fixed so a clone only occurs on the first stage for each job, instead of for all stages for each job. * New Gitlab CI pipeline cleanup strategy deletes job directories immediately upon successful completion. + * The SVPH package is now optional (SPHERAL\_ENABLE\_SVPH). * Bug Fixes / improvements: * Wrappers for MPI calls are simplified and improved. diff --git a/cmake/SetupSpheral.cmake b/cmake/SetupSpheral.cmake index b993e3296..a739de86b 100644 --- a/cmake/SetupSpheral.cmake +++ b/cmake/SetupSpheral.cmake @@ -58,6 +58,7 @@ set(ENABLE_HELMHOLTZ ON CACHE BOOL "enable the Helmholtz equation of state packa option(SPHERAL_ENABLE_ARTIFICIAL_CONDUCTION "Enable the artificial conduction package" ON) option(SPHERAL_ENABLE_EXTERNAL_FORCE "Enable the external force package" ON) option(SPHERAL_ENABLE_GRAVITY "Enable the gravity package" ON) +option(SPHERAL_ENABLE_SVPH "Enable the SVPH package" ON) option(ENABLE_DEV_BUILD "Build separate internal C++ libraries for faster code development" OFF) option(ENABLE_STATIC_CXXONLY "build only static libs" OFF) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 97a8d1edb..05e094474 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -15,6 +15,9 @@ if (NOT ENABLE_CXXONLY) if (NOT ENABLE_MPI) list(APPEND SPHERAL_ATS_BUILD_CONFIG_ARGS "--filter='\"np<2\"'") endif() + if (NOT SPHERAL_ENABLE_SVPH) + list(APPEND SPHERAL_ATS_BUILD_CONFIG_ARGS "--filter='\"not svph\"'") + endif() if ($ENV{SYS_TYPE} MATCHES ".*blueos.*") list(APPEND SPHERAL_ATS_BUILD_CONFIG_ARGS "--addOp --smpi_off") endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d693ad7c..e5ae46230 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,7 +40,6 @@ list(APPEND _packages Porosity RK SPH - SVPH SolidMaterial Strength Utilities @@ -55,7 +54,11 @@ if (SPHERAL_ENABLE_EXTERNAL_FORCE) endif() if (SPHERAL_ENABLE_GRAVITY) - list(APPEND _packages Gravity) + list(APPEND _packages Gravity) +endif() + +if (SPHERAL_ENABLE_SVPH) + list(APPEND _packages SVPH) endif() if(NOT ENABLE_CXXONLY) diff --git a/src/PYB11/CMakeLists.txt b/src/PYB11/CMakeLists.txt index 5f315c582..8d51fda2f 100644 --- a/src/PYB11/CMakeLists.txt +++ b/src/PYB11/CMakeLists.txt @@ -23,7 +23,6 @@ set (_python_packages FieldOperations SPH CRKSPH - SVPH DEM GSPH FSISPH @@ -62,6 +61,10 @@ if (SPHERAL_ENABLE_GRAVITY) list(APPEND _python_packages Gravity) endif() +if (SPHERAL_ENABLE_SVPH) + list(APPEND _python_packages SVPH) +endif() + foreach(_python_package ${_python_packages}) add_subdirectory(${_python_package}) endforeach() diff --git a/tests/integration.ats b/tests/integration.ats index 2cfc647eb..715176353 100644 --- a/tests/integration.ats +++ b/tests/integration.ats @@ -1,9 +1,11 @@ #------------------------------------------------------------------------------- # This file contains the acceptance tests for committing changes to the # SolidSpheral code to the main repository. Please verify these all pass -# (using the ATS) before pushing changes to that public repot! +# (using the ATS) before pushing changes to that public repo! #------------------------------------------------------------------------------- +glue(svph = False) + # Geometry unit tests source("unit/Geometry/testVector.py") source("unit/Geometry/testTensor.py") diff --git a/tests/unit/SVPH/testInterpolation-1d.py b/tests/unit/SVPH/testInterpolation-1d.py index f26623225..e53713271 100644 --- a/tests/unit/SVPH/testInterpolation-1d.py +++ b/tests/unit/SVPH/testInterpolation-1d.py @@ -1,4 +1,4 @@ -#ATS:test(SELF, "--linearConsistent True --graphics False", label="SVPH interpolation test -- 1-D (serial)") +#ATS:test(SELF, "--linearConsistent True --graphics False", label="SVPH interpolation test -- 1-D (serial)", svph=True) #------------------------------------------------------------------------------- # A set of tests to compare how different meshless methods interpolate fields. #------------------------------------------------------------------------------- diff --git a/tests/unit/SVPH/testSVPHInterpolation-1d.py b/tests/unit/SVPH/testSVPHInterpolation-1d.py index 8b057c822..a2b08a023 100644 --- a/tests/unit/SVPH/testSVPHInterpolation-1d.py +++ b/tests/unit/SVPH/testSVPHInterpolation-1d.py @@ -1,4 +1,4 @@ -#ATS:test(SELF, "--linearConsistent True --graphics False", label="SVPH interpolation test -- 1-D (serial)") +#ATS:test(SELF, "--linearConsistent True --graphics False", label="SVPH interpolation test -- 1-D (serial)", svph=True) #------------------------------------------------------------------------------- # A set of tests to compare how different meshless methods interpolate fields. #------------------------------------------------------------------------------- diff --git a/tests/unit/SVPH/testSVPHInterpolation-2d.py b/tests/unit/SVPH/testSVPHInterpolation-2d.py index 3dd68af5c..853a4da54 100644 --- a/tests/unit/SVPH/testSVPHInterpolation-2d.py +++ b/tests/unit/SVPH/testSVPHInterpolation-2d.py @@ -1,4 +1,4 @@ -#ATS:test(SELF, "--linearConsistent True --graphics False", label="SVPH interpolation test -- 2-D (serial)") +#ATS:test(SELF, "--linearConsistent True --graphics False", label="SVPH interpolation test -- 2-D (serial), svph=True") #------------------------------------------------------------------------------- # A set of tests to compare how different meshless methods interpolate fields. #-------------------------------------------------------------------------------