From f4bbc0dbd2747c2ebdf5ccbd366cc6d5e924ebf9 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Wed, 25 Oct 2023 12:13:32 +0200 Subject: Add dlaf variant to cp2k (#40702) --- var/spack/repos/builtin/packages/cp2k/package.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/var/spack/repos/builtin/packages/cp2k/package.py b/var/spack/repos/builtin/packages/cp2k/package.py index 27deecf784..2e765c7539 100644 --- a/var/spack/repos/builtin/packages/cp2k/package.py +++ b/var/spack/repos/builtin/packages/cp2k/package.py @@ -83,6 +83,13 @@ class Cp2k(MakefilePackage, CudaPackage, CMakePackage, ROCmPackage): description="Enable optimised diagonalisation routines from ELPA", when="@6.1:", ) + variant( + "dlaf", + default=False, + description="Enable DLA-Future eigensolver and Cholesky decomposition", + # TODO: Pin version when integrated in a release + when="@master build_system=cmake", + ) variant( "sirius", default=False, @@ -226,6 +233,15 @@ class Cp2k(MakefilePackage, CudaPackage, CMakePackage, ROCmPackage): depends_on("elpa@2021.11.001:", when="@9.1:") depends_on("elpa@2023.05.001:", when="@2023.2:") + with when("+dlaf"): + conflicts( + "~mpi", msg="DLA-Future requires MPI. Only the distributed eigensolver is available." + ) + depends_on("dla-future@0.2.1: +scalapack") + depends_on("dla-future ~cuda~rocm", when="~cuda~rocm") + depends_on("dla-future +cuda", when="+cuda") + depends_on("dla-future +rocm", when="+rocm") + with when("+plumed"): depends_on("plumed+shared") depends_on("plumed+mpi", when="+mpi") @@ -945,6 +961,7 @@ class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): args += [ self.define_from_variant("CP2K_ENABLE_REGTESTS", "enable_regtests"), self.define_from_variant("CP2K_USE_ELPA", "elpa"), + self.define_from_variant("CP2K_USE_DLAF", "dlaf"), self.define_from_variant("CP2K_USE_LIBINT2", "libint"), self.define_from_variant("CP2K_USE_SIRIUS", "sirius"), self.define_from_variant("CP2K_USE_SPLA", "spla"), -- cgit v1.2.3-70-g09d2