diff --git a/CHANGELOG.md b/CHANGELOG.md index 2606e2e566..4cc15acee6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Release is in preparation for JOSS publication. - [[PR330]](https://github.com/lanl/singularity-eos/pull/330) Piecewise grids for Spiner EOS. ### Fixed (Repair bugs, etc) +- [[PR434]](https://github.com/lanl/singularity-eos/pull/434) Fix failure of eospac to build on HIP and segfaults with Evalaute - [[PR424]](https://github.com/lanl/singularity-eos/pull/424) Fix for variant patch: point to correct patch file - [[PR420]](https://github.com/lanl/singularity-eos/pull/420) Fix broken test_get_sg_eos - [[PR417]](https://github.com/lanl/singularity-eos/pull/417) Bugs in shared memory related to eospac resolved diff --git a/CMakeLists.txt b/CMakeLists.txt index 512060bf5f..56178b2fba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") set(SINGULARITY_GOLDFILES_VERSION "goldfiles-1.8.0") set(SINGULARITY_GOLDFILE_HASH 249772f3314c4b6b9386aa08895280698ae905ef188f4383b819f28c1484603b) +set(DOWNLOAD_EXTRACT_TIMESTAMP ON) # ------------------------------------------------------------------------------# # Options diff --git a/cmake/singularity-eos/kokkos.cmake b/cmake/singularity-eos/kokkos.cmake index 832d9d190e..22e5e9c732 100644 --- a/cmake/singularity-eos/kokkos.cmake +++ b/cmake/singularity-eos/kokkos.cmake @@ -107,7 +107,9 @@ macro(singularity_import_kokkoskernels) endmacro() macro(singularity_find_kokkoskernels) - find_package(KokkosKernels REQUIRED) + if(NOT TARGET Kokkos::kokkoskernels) + find_package(KokkosKernels REQUIRED) + endif() endmacro() macro(singularity_enable_kokkoskernels target) diff --git a/doc/sphinx/src/using-eos.rst b/doc/sphinx/src/using-eos.rst index c2fcc8c3e3..8810914adb 100644 --- a/doc/sphinx/src/using-eos.rst +++ b/doc/sphinx/src/using-eos.rst @@ -36,9 +36,10 @@ conditions. The type of parallelism used depends on how ``singularity-eos`` is compiled. If the ``Kokkos`` backend is used, any parallel dispatch supported by ``Kokkos`` is supported. -A more generic version of the vector calls exists in the ``Evaluate`` -method, which allows the user to specify arbitrary parallel dispatch -models by writing their own loops. See the relevant section below. +A more generic version of the vector calls exists in the +``EvaluateHost`` and ``EvaluateDevice`` methods, which allow the user +to specify arbitrary parallel dispatch models by writing their own +loops. See the relevant section below. Serialization and shared memory -------------------------------- @@ -494,19 +495,26 @@ available member function. eos.TemperatureFromDensityInternalEnergy(density.data(), energy.data(), temperature.data(), scratch.data(), density.size()); -The Evaluate Method -~~~~~~~~~~~~~~~~~~~ +The Evaluate Methods +~~~~~~~~~~~~~~~~~~~~~~ -A special call related to the vector calls is the ``Evaluate`` -method. The ``Evaluate`` method requests the EOS object to evaluate -almost arbitrary code, but in a way where the type of the underlying -EOS object is resolved *before* this arbitrary code is evaluated. This -means the code required to resolve the type of the variant is only -executed *once* per ``Evaluate`` call. This can enable composite EOS -calls, non-standard vector calls, and vector calls with non-standard -loop structure. +A pair of special call related to the vector calls are the +``EvaluateHost`` and ``EvaluateDevice`` methods. These methods request +the EOS object to evaluate almost arbitrary code, but in a way where +the type of the underlying EOS object is resolved *before* this +arbitrary code is evaluated. This means the code required to resolve +the type of the variant is only executed *once* per ``Evaluate`` +call. This can enable composite EOS calls, non-standard vector calls, +and vector calls with non-standard loop structure. -The ``Evaluate`` call has the signature +The ``EvaluateHost`` call has the signature + +.. code-block:: cpp + + template + void Evaluate(Functor_t f); + +and the ``EvaluateDevice`` method has the signature .. code-block:: cpp @@ -514,11 +522,11 @@ The ``Evaluate`` call has the signature PORTABLE_INLINE_FUNCTION void Evaluate(Functor_t f); + where a ``Functor_t`` is a class that *must* provide a ``void -operator() const`` method templated on EOS type. ``Evaluate`` is -decorated so that it may be evaluated on either host or device, -depending on desired use-case. Alternatively, you may use an anonymous -function with an `auto` argument as the input, e.g., +operator() const`` method templated on EOS type. Alternatively, you +may use an anonymous function with an `auto` argument as the input, +e.g., .. code-block:: cpp @@ -531,7 +539,9 @@ function with an `auto` argument as the input, e.g., with GPUs it can produce very unintuitive behaviour. We recommend you only make the ``operator()`` non-const if you really know what you're doing. And in the anonymous function case, we recommend you - capture by value, not reference. + capture by value, not reference. ``EvaluateDevice`` does not support + side effects at all and you must pass your functors in by value in + that case. To see the utlity of the ``Evaluate`` function, it's probably just easiest to provide an example. The following code evaluates the EOS on @@ -583,17 +593,17 @@ is summed using the ``Kokkos::parallel_reduce`` functionality in the CheckPofRE my_op(P, rho, sie, N); // Here we call the evaluate function - eos.Evaluate(my_op); + eos.EvaluateHost(my_op); // The above two lines could have been called "in-one" with: - // eos.Evaluate(CheckPofRE(P, rho, sie, N)); + // eos.EvaluateHost(CheckPofRE(P, rho, sie, N)); Alternatively, you could eliminate the functor and use an anonymous function with: .. code-block:: cpp - eos.Evaluate([=](auto eos) { + eos.EvaluateHost([=](auto eos) { Real tot_diff; Kokkos::parallel_reduce( "MyCheckPofRE", N_, diff --git a/singularity-eos/eos/eos_base.hpp b/singularity-eos/eos/eos_base.hpp index daa55bbdb3..6e838d108d 100644 --- a/singularity-eos/eos/eos_base.hpp +++ b/singularity-eos/eos/eos_base.hpp @@ -148,8 +148,13 @@ class EosBase { // Generic evaluator template - constexpr void Evaluate(Functor_t &f) const { - CRTP copy = *(static_cast(this)); + PORTABLE_INLINE_FUNCTION void EvaluateDevice(const Functor_t f) const { + const CRTP copy = *(static_cast(this)); + f(copy); + } + template + void EvaluateHost(Functor_t &f) const { + const CRTP copy = *(static_cast(this)); f(copy); } diff --git a/singularity-eos/eos/eos_eospac.hpp b/singularity-eos/eos/eos_eospac.hpp index 1be7404958..1f08a65873 100644 --- a/singularity-eos/eos/eos_eospac.hpp +++ b/singularity-eos/eos/eos_eospac.hpp @@ -25,6 +25,7 @@ #include // ports-of-call #include +#include #include #include @@ -43,16 +44,12 @@ using namespace EospacWrapper; // Only really works in serial // Not really supported on device -// SG_PIF_NOWARN -// this pragma disables host-device warnings when cuda enabled -#if defined(__CUDACC__) -#define SG_PIF_NOWARN #pragma nv_exec_check_disable -#endif // __CUDACC__ - -// force this macro to be defined regardless of complexity of logic above -#ifndef SG_PIF_NOWARN -#define SG_PIF_NOWARN -#endif // !defind SG_PIF_NOWARN +// TODO(JMM): Move this into ports of call or base if needed elsehwere. +#if defined(__CUDA_ARCH__) || __HIP_DEVICE_COMPILE__ +#define SINGULARITY_ON_DEVICE 1 +#else +#define SINGULARITY_ON_DEVICE 0 +#endif // ON DEVICE namespace impl_eospac { @@ -154,82 +151,66 @@ class EOSPAC : public EosBase { std::size_t SharedMemorySizeInBytes() const; constexpr bool AllDynamicMemoryIsShareable() const { return false; } - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real TemperatureFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real InternalEnergyFromDensityTemperature( const Real rho, const Real temperature, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real PressureFromDensityTemperature(const Real rho, const Real temperature, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real PressureFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real MinInternalEnergyFromDensity( const Real rho, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real EntropyFromDensityTemperature(const Real rho, const Real temperature, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real EntropyFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real SpecificHeatFromDensityTemperature( const Real rho, const Real temperature, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real SpecificHeatFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real BulkModulusFromDensityTemperature( const Real rho, const Real temperature, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real BulkModulusFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real GruneisenParamFromDensityTemperature( const Real rho, const Real temperature, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real GruneisenParamFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION void FillEos(Real &rho, Real &temp, Real &energy, Real &press, Real &cv, Real &bmod, const unsigned long output, Indexer_t &&lambda = static_cast(nullptr)) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION void DensityEnergyFromPressureTemperature(const Real press, const Real temp, Indexer_t &&lambda, Real &rho, Real &sie) const; - SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION void ValuesAtReferenceState(Real &rho, Real &temp, Real &sie, Real &press, Real &cv, @@ -1274,31 +1255,38 @@ inline std::size_t EOSPAC::SetDynamicMemory(char *src, const SharedMemSettings & } inline std::size_t EOSPAC::SharedMemorySizeInBytes() const { return shared_size_; } -SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real EOSPAC::TemperatureFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; EOS_REAL R[1] = {rho}, E[1] = {sieToSesame(sie)}, T[1], dTdr[1], dTde[1]; EOS_INTEGER nxypairs = 1; EOS_INTEGER table = TofRE_table_; eosSafeInterpolate(&table, nxypairs, R, E, T, dTdr, dTde, "TofRE", Verbosity::Quiet); return Real(temperatureFromSesame(T[0])); +#endif // ON_DEVICE } -SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real EOSPAC::PressureFromDensityTemperature( const Real rho, const Real temp, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; EOS_REAL R[1] = {rho}, P[1], T[1] = {temperatureToSesame(temp)}, dPdr[1], dPdT[1]; EOS_INTEGER nxypairs = 1; EOS_INTEGER table = PofRT_table_; eosSafeInterpolate(&table, nxypairs, R, T, P, dPdr, dPdT, "PofRT", Verbosity::Quiet); return Real(pressureFromSesame(P[0])); +#endif // ON DEVICE } -SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real EOSPAC::EntropyFromDensityTemperature( const Real rho, const Real temperature, Indexer_t &&lambda) const { @@ -1306,11 +1294,13 @@ PORTABLE_INLINE_FUNCTION Real EOSPAC::EntropyFromDensityTemperature( return 1.0; } -SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION void EOSPAC::FillEos(Real &rho, Real &temp, Real &sie, Real &press, Real &cv, Real &bmod, const unsigned long output, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); +#else using namespace EospacWrapper; EOS_REAL R[1] = {rho}, T[1] = {temperatureToSesame(temp)}; EOS_REAL E[1] = {sieToSesame(sie)}, P[1] = {pressureToSesame(press)}; @@ -1388,42 +1378,61 @@ EOSPAC::FillEos(Real &rho, Real &temp, Real &sie, Real &press, Real &cv, Real &b } bmod = bulkModulusFromSesame(std::max(BMOD, 0.0)); } +#endif // ON DEVICE } -SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real EOSPAC::InternalEnergyFromDensityTemperature( const Real rho, const Real temp, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; Real RHO = rho, TEMP = temp, sie, press, cv, bmod; const unsigned long output = thermalqs::specific_internal_energy; FillEos(RHO, TEMP, sie, press, cv, bmod, output, lambda); return sie; +#endif // ON DEVICE } -SG_PIF_NOWARN + template PORTABLE_INLINE_FUNCTION Real EOSPAC::BulkModulusFromDensityTemperature( const Real rho, const Real temp, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; Real RHO = rho, TEMP = temp, sie, press, cv, bmod; const unsigned long output = thermalqs::bulk_modulus; FillEos(RHO, TEMP, sie, press, cv, bmod, output, lambda); return bmod; +#endif // ON DEVICE } -SG_PIF_NOWARN + template PORTABLE_INLINE_FUNCTION Real EOSPAC::SpecificHeatFromDensityTemperature( const Real rho, const Real temp, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; Real RHO = rho, TEMP = temp, sie, press, cv, bmod; const unsigned long output = thermalqs::specific_heat; FillEos(RHO, TEMP, sie, press, cv, bmod, output, lambda); return cv; +#endif // ON DEVICE } -SG_PIF_NOWARN + template PORTABLE_INLINE_FUNCTION Real EOSPAC::PressureFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; EOS_INTEGER options[]{EOS_Y_CONVERT, EOS_F_CONVERT}; EOS_REAL values[]{sieFromSesame(1.0), pressureFromSesame(1.0)}; @@ -1435,11 +1444,16 @@ PORTABLE_INLINE_FUNCTION Real EOSPAC::PressureFromDensityInternalEnergy( options, values, nopts); return Real(P[0]); +#endif // ON DEVICE } -SG_PIF_NOWARN + template PORTABLE_INLINE_FUNCTION Real EOSPAC::MinInternalEnergyFromDensity(const Real rho, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; EOS_INTEGER options[]{EOS_F_CONVERT}; EOS_REAL values[]{sieFromSesame(1.0)}; @@ -1451,36 +1465,55 @@ EOSPAC::MinInternalEnergyFromDensity(const Real rho, Indexer_t &&lambda) const { options, values, nopts); return Real(S[0]); +#endif // ON DEVICE } -SG_PIF_NOWARN + template PORTABLE_INLINE_FUNCTION Real EOSPAC::EntropyFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; const Real temp = TemperatureFromDensityInternalEnergy(rho, sie, lambda); return EntropyFromDensityTemperature(rho, temp, lambda); +#endif // ON DEVICE } -SG_PIF_NOWARN + template PORTABLE_INLINE_FUNCTION Real EOSPAC::SpecificHeatFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; Real temp = TemperatureFromDensityInternalEnergy(rho, sie, lambda); return SpecificHeatFromDensityTemperature(rho, temp, lambda); +#endif // ON DEVICE } -SG_PIF_NOWARN + template PORTABLE_INLINE_FUNCTION Real EOSPAC::BulkModulusFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; Real temp = TemperatureFromDensityInternalEnergy(rho, sie, lambda); return BulkModulusFromDensityTemperature(rho, temp, lambda); +#endif // ON DEVICE } -SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION Real EOSPAC::GruneisenParamFromDensityTemperature( const Real rho, const Real temperature, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else using namespace EospacWrapper; EOS_REAL R[1] = {rho}, T[1] = {temperatureToSesame(temperature)}; EOS_REAL E[1], P[1], dx[1], dy[1]; @@ -1494,19 +1527,27 @@ PORTABLE_INLINE_FUNCTION Real EOSPAC::GruneisenParamFromDensityTemperature( DPDT = dy[0]; DPDE = DPDT / DEDT; return robust::ratio(pressureFromSesame(sieToSesame(DPDE)), rho); +#endif // ON DEVICE } -SG_PIF_NOWARN + template PORTABLE_INLINE_FUNCTION Real EOSPAC::GruneisenParamFromDensityInternalEnergy( const Real rho, const Real sie, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); + return 0; // compiler happy +#else Real temperature = TemperatureFromDensityInternalEnergy(rho, sie, lambda); return GruneisenParamFromDensityTemperature(rho, temperature, lambda); +#endif // ON DEVICE } -SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION void EOSPAC::DensityEnergyFromPressureTemperature( const Real press, const Real temp, Indexer_t &&lambda, Real &rho, Real &sie) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); +#else using namespace EospacWrapper; EOS_REAL P[1] = {pressureToSesame(press)}; EOS_REAL T[1] = {temperatureToSesame(temp)}; @@ -1521,14 +1562,17 @@ PORTABLE_INLINE_FUNCTION void EOSPAC::DensityEnergyFromPressureTemperature( table = EofRT_table_; eosSafeInterpolate(&table, nxypairs, R, T, E, dx, dy, "EofPRT", Verbosity::Quiet); sie = sieFromSesame(E[0]); +#endif // ON DEVICE } -SG_PIF_NOWARN template PORTABLE_INLINE_FUNCTION void EOSPAC::ValuesAtReferenceState(Real &rho, Real &temp, Real &sie, Real &press, Real &cv, Real &bmod, Real &dpde, Real &dvdt, Indexer_t &&lambda) const { +#if SINGULARITY_ON_DEVICE + PORTABLE_ALWAYS_ABORT("EOSPAC calls not supported on device\n"); +#else using namespace EospacWrapper; rho = rho_ref_; temp = temp_ref_; @@ -1538,6 +1582,7 @@ EOSPAC::ValuesAtReferenceState(Real &rho, Real &temp, Real &sie, Real &press, Re bmod = bmod_ref_; dpde = dpde_ref_; dvdt = dvdt_ref_; +#endif // ON DEVICE } } // namespace singularity diff --git a/singularity-eos/eos/eos_variant.hpp b/singularity-eos/eos/eos_variant.hpp index 938bb1da40..36711df58f 100644 --- a/singularity-eos/eos/eos_variant.hpp +++ b/singularity-eos/eos/eos_variant.hpp @@ -81,8 +81,13 @@ class Variant { } template - constexpr void Evaluate(Functor_t &f) const { - return mpark::visit([&f](const auto &eos) { return eos.Evaluate(f); }, eos_); + PORTABLE_INLINE_FUNCTION void EvaluateDevice(const Functor_t f) const { + return mpark::visit([&f](const auto &eos) { return eos.EvaluateDevice(f); }, eos_); + } + + template + void EvaluateHost(Functor_t &f) const { + return mpark::visit([&f](const auto &eos) { return eos.EvaluateHost(f); }, eos_); } // EOS modifier object-oriented API diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 747cbf5c57..e01d0a01e1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -93,7 +93,7 @@ endif() include(Catch) catch_discover_tests(eos_analytic_unit_tests PROPERTIES TIMEOUT 60) catch_discover_tests(eos_infrastructure_tests PROPERTIES TIMEOUT 60) -catch_discover_tests(eos_tabulated_unit_tests PROPERTIES TIMEOUT 60) +catch_discover_tests(eos_tabulated_unit_tests PROPERTIES TIMEOUT 120) if (plugin_tests) catch_discover_tests(eos_plugin_tests PROPERTIES TIMEOUT 60) endif() diff --git a/test/test_closure_pte.cpp b/test/test_closure_pte.cpp index 8a4da2d6e9..fce46ac9ca 100644 --- a/test/test_closure_pte.cpp +++ b/test/test_closure_pte.cpp @@ -188,9 +188,8 @@ SCENARIO("Density-Temperature PTE Solver", "[PTE]") { constexpr Real Cv = 0.001072 * MJ_per_kg; // erg / g / K constexpr Real Q = 4.115 * MJ_per_kg; EOS davis_p_eos = DavisProducts(a, b, k, n, vc, pc, Cv).Modify(-Q); - // PTE parameters - auto default_PTE_params = MixParams{}; + const MixParams params; GIVEN("A difficult three-material state") { // Define the state constexpr Real spvol_bulk = 6.256037280402093e-01; @@ -213,7 +212,7 @@ SCENARIO("Density-Temperature PTE Solver", "[PTE]") { const Real u_scale = std::abs(u_bulk); const Real u_bulk_scale = ratio(u_bulk, u_scale); const Real residual = std::abs(u_bulk_scale - ratio(u_bulk_out, u_scale)); - CHECK(residual < default_PTE_params.pte_rel_tolerance_e); + CHECK(residual < params.pte_rel_tolerance_e); } // Free EOS copies on device PORTABLE_FREE(v_EOS); @@ -235,6 +234,7 @@ SCENARIO("Density-Temperature PTE Solver", "[PTE]") { Real u_bulk_out = std::numeric_limits::max(); const bool pte_converged = run_PTE_from_state(num_pte, v_EOS, spvol_bulk, sie_bulk, mass_frac, u_bulk_out); + const MixParams params; // CHECK(pte_converged); // AND_THEN("The solution satisfies the bulk internal energy constraint") { // // NOTE(@pdmullen): The following fails prior to PR401 @@ -242,7 +242,7 @@ SCENARIO("Density-Temperature PTE Solver", "[PTE]") { // const Real u_scale = std::abs(u_bulk); // const Real u_bulk_scale = ratio(u_bulk, u_scale); // const Real residual = std::abs(u_bulk_scale - ratio(u_bulk_out, u_scale)); - // CHECK(residual < default_PTE_params.pte_rel_tolerance_e); + // CHECK(residual < params.pte_rel_tolerance_e); // } // Free EOS copies on device PORTABLE_FREE(v_EOS); diff --git a/test/test_eos_ideal.cpp b/test/test_eos_ideal.cpp index b97f3de4de..9e52c81769 100644 --- a/test/test_eos_ideal.cpp +++ b/test/test_eos_ideal.cpp @@ -136,7 +136,7 @@ SCENARIO("Ideal gas vector Evaluate call", "[IdealGas][Evaluate]") { }); THEN("The vector Evaluate API can be used to compare") { CheckPofRE my_op(P, rho, sie, N); - eos_device.Evaluate(my_op); + eos_device.EvaluateHost(my_op); REQUIRE(my_op.nwrong == 0); } } diff --git a/test/test_eos_modifiers.cpp b/test/test_eos_modifiers.cpp index b75bfca16e..631d906ba9 100644 --- a/test/test_eos_modifiers.cpp +++ b/test/test_eos_modifiers.cpp @@ -62,7 +62,6 @@ using variadic_utils::transform_variadic_list; static constexpr const auto full_eos_list = tl{}; static constexpr const auto relativistic_eos_list = tl{}; static constexpr const auto unit_system_eos_list = tl{}; -static constexpr const auto apply_to_all = al{}; static constexpr const auto unit_system = transform_variadic_list(unit_system_eos_list, al{}); // variadic list of eos's with shifted or scaled modifiers