gromacs: add cufftmp variant to enable distributed PME when using CUDA (#36552)

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:
Daniel Ahlin 2023-04-05 18:30:24 +02:00 committed by GitHub
parent eebfb1cf07
commit 4206478f5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,6 +87,7 @@ class Gromacs(CMakePackage, CudaPackage):
description="Produces a double precision version of the executables", description="Produces a double precision version of the executables",
) )
variant("plumed", default=False, description="Enable PLUMED support") variant("plumed", default=False, description="Enable PLUMED support")
variant("cufftmp", default=False, when="+cuda+mpi", description="Enable Multi GPU FFT support")
variant("opencl", default=False, description="Enable OpenCL support") variant("opencl", default=False, description="Enable OpenCL support")
variant("sycl", default=False, description="Enable SYCL support") variant("sycl", default=False, description="Enable SYCL support")
variant("nosuffix", default=False, description="Disable default suffixes") variant("nosuffix", default=False, description="Disable default suffixes")
@ -249,6 +250,8 @@ class Gromacs(CMakePackage, CudaPackage):
depends_on("cp2k@8.1:", when="+cp2k") depends_on("cp2k@8.1:", when="+cp2k")
depends_on("dbcsr", when="+cp2k") depends_on("dbcsr", when="+cp2k")
depends_on("nvhpc", when="+cufftmp")
patch("gmxDetectCpu-cmake-3.14.patch", when="@2018:2019.3^cmake@3.14.0:") patch("gmxDetectCpu-cmake-3.14.patch", when="@2018:2019.3^cmake@3.14.0:")
patch("gmxDetectSimd-cmake-3.14.patch", when="@5.0:2017^cmake@3.14.0:") patch("gmxDetectSimd-cmake-3.14.patch", when="@5.0:2017^cmake@3.14.0:")
@ -478,6 +481,13 @@ def cmake_args(self):
options.append("-DGMX_CP2K:BOOL=ON") options.append("-DGMX_CP2K:BOOL=ON")
options.append("-DCP2K_DIR:STRING={0}".format(self.spec["cp2k"].prefix)) options.append("-DCP2K_DIR:STRING={0}".format(self.spec["cp2k"].prefix))
if "+cufftmp" in self.spec:
options.append("-DGMX_USE_CUFFTMP=ON")
options.append(
f'-DcuFFTMp_ROOT={self.spec["nvhpc"].prefix}/Linux_{self.spec.target.family}'
+ f'/{self.spec["nvhpc"].version}/math_libs'
)
# Activate SIMD based on properties of the target # Activate SIMD based on properties of the target
target = self.spec.target target = self.spec.target
if target >= "zen4": if target >= "zen4":