Skip to content

Commit 2b7ef1b

Browse files
authored
Correct logic for kokkos-kernels in package.py (#561)
* Correct logic for kokkos-kernels in package.py We really only need to require kokkos-kernels when we have the closure models enabled as well. Otherwise they aren't needed. This is also true for Eigen * Make kokkos-kernels changes to v2 spack as well * Update CHANGELOG.md * Fix broken markdown in CHANGELOG.md * Fix some more broken markdown and consistency stuff in CHANGELOG.md * Change logic so that +kokkos-kernels is associated with +kokkos+closure * We don't have a +openmp option and really we just want kokkos kernels to paired with kokkos regardless of the kokkos backend
1 parent c142562 commit 2b7ef1b

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
## Current develop
44

55
### Added (new features/APIs/variables/...)
6-
- [[PR556](https://github.com/lanl/singularity-eos/pull/556) Add introspection into types available in the variant
6+
- [[PR556]](https://github.com/lanl/singularity-eos/pull/556) Add introspection into types available in the variant
77

88
### Fixed (Repair bugs, etc)
9+
- [[PR561]](https://github.com/lanl/singularity-eos/pull/561) Fix logic for kokkos-kernels in spackage so that it is only required for closure models on GPU
910

1011
### Changed (changing behavior/API/variables/...)
1112

1213
### Infrastructure (changes irrelevant to downstream codes)
13-
- [[559]](https://github.com/lanl/singularity-eos/pull/559) Document the intent of the virtual keyword in solvers
14-
- [[558]](https://github.com/lanl/singularity-eos/pull/558) Make EOSPAC CMake options depend on SINGULARITY_USE_EOSPAC option
14+
- [[PR559]](https://github.com/lanl/singularity-eos/pull/559) Document the intent of the virtual keyword in solvers
15+
- [[PR558]](https://github.com/lanl/singularity-eos/pull/558) Make EOSPAC CMake options depend on SINGULARITY_USE_EOSPAC option
1516

1617
### Removed (removing behavior/API/varaibles/...)
1718

@@ -61,7 +62,7 @@ Date: 4/7/2025
6162
- [[PR444]](https://github.com/lanl/singularity-eos/pull/444) Add Z split modifier and electron ideal gas EOS
6263

6364
### Fixed (Repair bugs, etc)
64-
- [PR492](https://github.com/lanl/singularity-eos/pull/492) Fix import issue in spack's package.py.
65+
- [[PR492]](https://github.com/lanl/singularity-eos/pull/492) Fix import issue in spack's package.py.
6566
- [[PR485]](https://github.com/lanl/singularity-eos/pull/485) Fix segfault in Fortran interface related to EOSPAC initialization
6667
- [[PR478]](https://github.com/lanl/singularity-eos/pull/478) Fix bug in KPT test. Add more extensive clang build to github CI matrix.
6768
- [[PR473]](https://github.com/lanl/singularity-eos/pull/473) Resolve memory issue. Thanks for the catch, Richard!

spack-repo/v1/packages/singularity-eos/package.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class SingularityEos(CMakePackage, CudaPackage, ROCmPackage):
5757
# build with kokkos, kokkos-kernels for offloading support
5858
variant("kokkos", default=False, description="Enable kokkos")
5959
variant(
60-
"kokkos-kernels", default=False, description="Enable kokkos-kernals for linear algebra"
60+
"kokkos-kernels", default=False, description="Enable kokkos-kernels for linear algebra"
6161
)
6262

6363
# for compatibility with downstream projects
@@ -120,10 +120,13 @@ class SingularityEos(CMakePackage, CudaPackage, ROCmPackage):
120120
depends_on("catch2@3.0.1:", when="@1.9.0: +tests")
121121
depends_on("py-numpy", when="+python+tests")
122122

123-
# linear algebra when not using GPUs
124-
depends_on("eigen@3.3.8:", when="~kokkos-kernels")
125-
requires("+kokkos-kernels", when="+cuda")
126-
requires("+kokkos-kernels", when="+rocm")
123+
# Require kokkos for device/offloading support
124+
requires("+kokkos", when="+cuda")
125+
requires("+kokkos", when="+rocm")
126+
127+
# linear algebra when using closure models. Eigen without kokkos
128+
depends_on("eigen@3.3.8:", when="~kokkos-kernels+closure")
129+
requires("+kokkos-kernels", when="+kokkos+closure")
127130

128131
depends_on("eospac", when="+eospac")
129132

spack-repo/v2/spack_repo/singularity_eos/packages/singularity_eos/package.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class SingularityEos(CMakePackage, CudaPackage, ROCmPackage):
6060
# build with kokkos, kokkos-kernels for offloading support
6161
variant("kokkos", default=False, description="Enable kokkos")
6262
variant(
63-
"kokkos-kernels", default=False, description="Enable kokkos-kernals for linear algebra"
63+
"kokkos-kernels", default=False, description="Enable kokkos-kernels for linear algebra"
6464
)
6565

6666
# for compatibility with downstream projects
@@ -123,10 +123,13 @@ class SingularityEos(CMakePackage, CudaPackage, ROCmPackage):
123123
depends_on("catch2@3.0.1:", when="@1.9.0: +tests")
124124
depends_on("py-numpy", when="+python+tests")
125125

126-
# linear algebra when not using GPUs
127-
depends_on("eigen@3.3.8:", when="~kokkos-kernels")
128-
requires("+kokkos-kernels", when="+cuda")
129-
requires("+kokkos-kernels", when="+rocm")
126+
# Require kokkos for device/offloading support
127+
requires("+kokkos", when="+cuda")
128+
requires("+kokkos", when="+rocm")
129+
130+
# linear algebra when using closure models. Eigen without kokkos
131+
depends_on("eigen@3.3.8:", when="~kokkos-kernels+closure")
132+
requires("+kokkos-kernels", when="+kokkos+closure")
130133

131134
depends_on("eospac", when="+eospac")
132135

0 commit comments

Comments
 (0)