summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/gromacs
diff options
context:
space:
mode:
authorAndrey Parfenov <a1994ndrey@gmail.com>2023-05-11 16:23:04 +0200
committerGitHub <noreply@github.com>2023-05-11 09:23:04 -0500
commitc0f020d021d6d9e7869bfa91eaa0de5e681112d4 (patch)
tree28787ed3e11cacaebd75b6077d84d7c48aa33d20 /var/spack/repos/builtin/packages/gromacs
parentdc58449bbf2eb28c1670ae5ae5d4efffaeded573 (diff)
downloadspack-c0f020d021d6d9e7869bfa91eaa0de5e681112d4.tar.gz
spack-c0f020d021d6d9e7869bfa91eaa0de5e681112d4.tar.bz2
spack-c0f020d021d6d9e7869bfa91eaa0de5e681112d4.tar.xz
spack-c0f020d021d6d9e7869bfa91eaa0de5e681112d4.zip
add openmp_max_threads variant and enable avx 512 optimizations for icelake (#37379)
* add openmp_max_threads variant and enable avx 512 optimizations for icelake and cascadelake Signed-off-by: Andrey Parfenov <andrey.parfenov@intel.com> * revert manual enabling of avx512 for icelake and cascadelake Signed-off-by: Andrey Parfenov <andrey.parfenov@intel.com> --------- Signed-off-by: Andrey Parfenov <andrey.parfenov@intel.com>
Diffstat (limited to 'var/spack/repos/builtin/packages/gromacs')
-rw-r--r--var/spack/repos/builtin/packages/gromacs/package.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py
index 8ea0e7abee..d255bdff68 100644
--- a/var/spack/repos/builtin/packages/gromacs/package.py
+++ b/var/spack/repos/builtin/packages/gromacs/package.py
@@ -115,6 +115,10 @@ class Gromacs(CMakePackage, CudaPackage):
"+mdrun_only", when="@2021:", msg="mdrun-only build option was removed for GROMACS 2021."
)
variant("openmp", default=True, description="Enables OpenMP at configure time")
+ variant("openmp_max_threads", default="none", description="Max number of OpenMP threads")
+ conflicts(
+ "+openmp_max_threads", when="~openmp", msg="OpenMP is off but OpenMP Max threads is set"
+ )
variant(
"sve",
default=True,
@@ -570,6 +574,11 @@ class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
else:
options.append("-DGMX_CYCLE_SUBCOUNTERS:BOOL=OFF")
+ if "+openmp" in self.spec and self.spec.variants["openmp_max_threads"].value != "none":
+ options.append(
+ "-DGMX_OPENMP_MAX_THREADS=%s" % self.spec.variants["openmp_max_threads"].value
+ )
+
if "^mkl" in self.spec:
# fftw-api@3 is provided by intel-mkl or intel-parllel-studio
# we use the mkl interface of gromacs