From d48d993ae7b90ae332111e8c68326fa50243efb5 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Mon, 28 Oct 2024 16:05:17 -0600 Subject: lammps: add heffte support (#47254) * lammps: add heffte support * Add Richard's suggestion --- var/spack/repos/builtin/packages/heffte/package.py | 3 ++- var/spack/repos/builtin/packages/lammps/package.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/heffte/package.py b/var/spack/repos/builtin/packages/heffte/package.py index 9496e1e23a..fd6d9ed5b4 100644 --- a/var/spack/repos/builtin/packages/heffte/package.py +++ b/var/spack/repos/builtin/packages/heffte/package.py @@ -21,6 +21,7 @@ class Heffte(CMakePackage, CudaPackage, ROCmPackage): license("BSD-3-Clause") version("develop", branch="master") + version("2.4.1", sha256="de2cf26df5d61baac7841525db3f393cb007f79612ac7534fd4757f154ba3e6c") version("2.4.0", sha256="02310fb4f9688df02f7181667e61c3adb7e38baf79611d80919d47452ff7881d") version("2.3.0", sha256="63db8c9a8822211d23e29f7adf5aa88bb462c91d7a18c296c3ef3a06be8d6171") version("2.2.0", sha256="332346d5c1d1032288d09839134c79e4a9704e213a2d53051e96c3c414c74df0") @@ -143,7 +144,7 @@ class Heffte(CMakePackage, CudaPackage, ROCmPackage): options = [cmake_dir] # changing the default install path search to newer cmake convention - if self.spec.satisfies("@develop"): + if self.spec.satisfies("@2.4.1:"): options.append(self.define("Heffte_ROOT", self.spec.prefix)) else: options.append(self.define("Heffte_DIR", self.spec.prefix.lib.cmake.Heffte)) diff --git a/var/spack/repos/builtin/packages/lammps/package.py b/var/spack/repos/builtin/packages/lammps/package.py index 097870aff6..5b8601dcf1 100644 --- a/var/spack/repos/builtin/packages/lammps/package.py +++ b/var/spack/repos/builtin/packages/lammps/package.py @@ -641,6 +641,13 @@ class Lammps(CMakePackage, CudaPackage, ROCmPackage, PythonExtension): values=("kiss", "fftw3", "mkl"), multi=False, ) + variant( + "heffte", + default=False, + when="+kspace @20240207:", + description="Use heffte as distubuted FFT engine", + ) + variant( "fft_kokkos", default="fftw3", @@ -663,6 +670,9 @@ class Lammps(CMakePackage, CudaPackage, ROCmPackage, PythonExtension): depends_on("mpi", when="+mpi") depends_on("mpi", when="+mpiio") depends_on("fftw-api@3", when="+kspace fft=fftw3") + depends_on("heffte", when="+heffte") + depends_on("heffte+fftw", when="+heffte fft=fftw3") + depends_on("heffte+mkl", when="+heffte fft=mkl") depends_on("mkl", when="+kspace fft=mkl") depends_on("hipfft", when="+kokkos+kspace+rocm fft_kokkos=hipfft") depends_on("fftw-api@3", when="+kokkos+kspace fft_kokkos=fftw3") @@ -927,6 +937,7 @@ class Lammps(CMakePackage, CudaPackage, ROCmPackage, PythonExtension): if spec.satisfies("+kspace"): args.append(self.define_from_variant("FFT", "fft")) + args.append(self.define_from_variant("FFT_USE_HEFFTE", "heffte")) if spec.satisfies("fft=fftw3 ^armpl-gcc") or spec.satisfies("fft=fftw3 ^acfl"): args.append(self.define("FFTW3_LIBRARY", self.spec["fftw-api"].libs[0])) args.append( -- cgit v1.2.3-70-g09d2