Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup test PTE structure and remove variant from shared header #420

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/tests_minimal.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests Minimal
name: Tests Minimal No Kokkos

on:
push:
Expand Down Expand Up @@ -32,6 +32,7 @@ jobs:
-DSINGULARITY_USE_SPINER_WITH_HDF5=OFF \
-DSINGULARITY_BUILD_TESTS=ON \
-DSINGULARITY_FORCE_SUBMODULE_MODE=ON \
-DSINGULARITY_USE_KOKKOS=OFF \
..
make
make install
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/tests_minimal_kokkos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tests Minimal With Kokkos

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
tests-minimal:
name: Run minimal set of tests, to constrain minimal build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set system to non-interactive mode
run: export DEBIAN_FRONTEND=noninteractive
- name: install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages -qq build-essential
- name: build and run tests
run: |
mkdir -p bin
cd bin
mkdir -p ${HOME}/install
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/install \
-DSINGULARITY_USE_SPINER=OFF \
-DSINGULARITY_USE_SPINER_WITH_HDF5=OFF \
-DSINGULARITY_BUILD_TESTS=ON \
-DSINGULARITY_FORCE_SUBMODULE_MODE=ON \
-DSINGULARITY_USE_KOKKOS=ON \
..
make
make install
make test
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [[PR330]](https://github.com/lanl/singularity-eos/pull/330) Piecewise grids for Spiner EOS.

### Fixed (Repair bugs, etc)
- [[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
- [[PR330]](https://github.com/lanl/singularity-eos/pull/330) Includes a fix for extrapolation of specific internal energy in SpinerEOS.
- [[PR401]](https://github.com/lanl/singularity-eos/pull/401) Fix for internal energy scaling in PTE closure
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ if(SINGULARITY_USE_HIGH_RISK_MATH)
target_compile_definitions(singularity-eos_Interface
INTERFACE SINGULARITY_USE_HIGH_RISK_MATH)
endif()
if (SINGULARITY_USE_TRUE_LOG_GRIDDING)
target_compile_definitions(singularity-eos_Interface
SINGULARITY_USE_TRUE_LOG_GRIDDING)
endif()
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved
if(SINGULARITY_TEST_SESAME)
target_compile_definitions(singularity-eos_Interface INTERFACE SINGULARITY_TEST_SESAME)
endif()
Expand Down
8 changes: 4 additions & 4 deletions test/pte_longtest_2phaseVinetSn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ inline void set_eos(T *eos) {
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};

EOS Snbeta = singularity::Vinet(7.285, 298.0, 0.529e12, 5.3345, 0.000072977, 0.2149e07,
0.658e09, 0.4419e07, d2to40);
EOS Sngamma = singularity::Vinet(7.271, 298.0, 0.3878e12, 6.0532, 0.0001085405,
0.2161e07, 1.025e09, 0.5051e07, d2to40);
T Snbeta = singularity::Vinet(7.285, 298.0, 0.529e12, 5.3345, 0.000072977, 0.2149e07,
0.658e09, 0.4419e07, d2to40);
T Sngamma = singularity::Vinet(7.271, 298.0, 0.3878e12, 6.0532, 0.0001085405, 0.2161e07,
1.025e09, 0.5051e07, d2to40);
eos[0] = Snbeta.GetOnDevice();
eos[1] = Sngamma.GetOnDevice();
return;
Expand Down
8 changes: 4 additions & 4 deletions test/pte_test_2phaseVinetSn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ inline void set_eos(T *eos) {
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};

EOS Snbeta = singularity::Vinet(7.285, 298.0, 0.529e12, 5.3345, 0.000072977, 0.2149e07,
0.658e09, 0.4419e07, d2to40);
EOS Sngamma = singularity::Vinet(7.271, 298.0, 0.3878e12, 6.0532, 0.0001085405,
0.2161e07, 1.025e09, 0.5051e07, d2to40);
T Snbeta = singularity::Vinet(7.285, 298.0, 0.529e12, 5.3345, 0.000072977, 0.2149e07,
0.658e09, 0.4419e07, d2to40);
T Sngamma = singularity::Vinet(7.271, 298.0, 0.3878e12, 6.0532, 0.0001085405, 0.2161e07,
1.025e09, 0.5051e07, d2to40);
eos[0] = Snbeta.GetOnDevice();
eos[1] = Sngamma.GetOnDevice();
return;
Expand Down
14 changes: 6 additions & 8 deletions test/pte_test_first.hpp → test/pte_test_3mat_analytic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ constexpr int HIST_SIZE = 10;
using singularity::DavisProducts;
using singularity::DavisReactants;
using singularity::Gruneisen;
using singularity::Variant;
using EOS = Variant<Gruneisen, DavisReactants, DavisProducts>;
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved

template <typename T>
inline void set_eos(T *eos) {
EOS gr = singularity::Gruneisen(394000.0, 1.489, 0.0, 0.0, 2.02, 0.47, 8.93, 297.0,
1.0e6, 0.383e7);
EOS dr = singularity::DavisReactants(1.890, 4.115e10, 1.0e6, 297.0, 1.8e5, 4.6, 0.34,
0.56, 0.0, 0.4265, 0.001074e10);
EOS dp = singularity::DavisProducts(0.798311, 0.58, 1.35, 2.66182, 0.75419, 3.2e10,
0.001072e10);
T gr = singularity::Gruneisen(394000.0, 1.489, 0.0, 0.0, 2.02, 0.47, 8.93, 297.0, 1.0e6,
0.383e7);
T dr = singularity::DavisReactants(1.890, 4.115e10, 1.0e6, 297.0, 1.8e5, 4.6, 0.34,
0.56, 0.0, 0.4265, 0.001074e10);
T dp = singularity::DavisProducts(0.798311, 0.58, 1.35, 2.66182, 0.75419, 3.2e10,
0.001072e10);
eos[0] = gr.GetOnDevice();
eos[1] = dr.GetOnDevice();
eos[2] = dp.GetOnDevice();
Expand Down
6 changes: 3 additions & 3 deletions test/pte_test_5phaseSesameSn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ inline void set_eos(T *eos) {

// bool invert_at_setup = true;

EOS Snbeta = singularity::EOSPAC(SnbetaID);
EOS Sngamma = singularity::EOSPAC(SngammaID);
T Snbeta = singularity::EOSPAC(SnbetaID);
T Sngamma = singularity::EOSPAC(SngammaID);
// EOS Sndelta = singularity::EOSPAC(SndeltaID);
EOS Snhcp = singularity::EOSPAC(SnhcpID);
T Snhcp = singularity::EOSPAC(SnhcpID);
// EOS Snliquid = singularity::EOSPAC(SnliquidID);

eos[0] = Snbeta.GetOnDevice();
Expand Down
1 change: 1 addition & 0 deletions test/test_get_sg_eos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <stdlib.h>

#include <ports-of-call/portability.hpp>
#include <pte_test_3mat_analytic.hpp>
#include <pte_test_utils.hpp>
#include <singularity-eos/closure/mixed_cell_models.hpp>
#include <singularity-eos/eos/eos.hpp>
Expand Down
4 changes: 3 additions & 1 deletion test/test_pte.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <ports-of-call/portability.hpp>
#include <ports-of-call/portable_arrays.hpp>
#include <pte_test_first.hpp>
#include <pte_test_3mat_analytic.hpp>
#include <pte_test_utils.hpp>
#include <singularity-eos/closure/mixed_cell_models.hpp>
#include <spiner/databox.hpp>
Expand All @@ -32,6 +32,8 @@
using DataBox = Spiner::DataBox<Real>;
using singularity::PTESolverRhoT;
using singularity::PTESolverRhoTRequiredScratch;
using singularity::Variant;
using EOS = Variant<Gruneisen, DavisReactants, DavisProducts>;

int main(int argc, char *argv[]) {

Expand Down
3 changes: 1 addition & 2 deletions test/test_pte_2phase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@
#include <singularity-eos/eos/eos_models.hpp>
#include <singularity-eos/eos/eos_variant.hpp>

// these two headers share a variant
using EOS = singularity::Variant<singularity::Vinet>;
#include <pte_longtest_2phaseVinetSn.hpp>
#include <pte_test_2phaseVinetSn.hpp>

using namespace pte_longtest_2phaseVinetSn;
using singularity::PTESolverRhoT;
using singularity::PTESolverRhoTRequiredScratch;
using EOS = singularity::Variant<singularity::Vinet>;

using DataBox = Spiner::DataBox<Real>;

Expand Down
2 changes: 1 addition & 1 deletion test/test_pte_3phase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#include <singularity-eos/eos/eos_models.hpp>
#include <singularity-eos/eos/eos_variant.hpp>

using EOS = singularity::Variant<singularity::EOSPAC>;
#include <pte_test_5phaseSesameSn.hpp>

using DataBox = Spiner::DataBox<Real>;
using singularity::PTESolverRhoT;
using singularity::PTESolverRhoTRequiredScratch;
using EOS = singularity::Variant<singularity::EOSPAC>;

int main(int argc, char *argv[]) {

Expand Down
Loading