From 216619bb531f966e6cb08607f4fdd2addbfbdde9 Mon Sep 17 00:00:00 2001 From: AMD Toolchain Support <73240730+amd-toolchain-support@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:42:16 +0530 Subject: [PATCH] namd: variant updates (#45825) * Add missing variant, already used in recipe (avxtiles) * Add memopt variant Co-authored-by: viveshar --- .../repos/builtin/packages/namd/package.py | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/namd/package.py b/var/spack/repos/builtin/packages/namd/package.py index 273835e07ef..2e9fc20f794 100644 --- a/var/spack/repos/builtin/packages/namd/package.py +++ b/var/spack/repos/builtin/packages/namd/package.py @@ -75,9 +75,24 @@ class Namd(MakefilePackage, CudaPackage, ROCmPackage): description="Enables Tcl and/or python interface", ) - variant("avxtiles", when="target=x86_64_v4:", default=False, description="Enable avxtiles") + variant( + "avxtiles", + when="target=x86_64_v4: @2.15:", + default=False, + description="Enable avxtiles supported with NAMD 2.15+", + ) variant("single_node_gpu", default=False, description="Single node GPU") + # Adding memopt variant to build memory-optimized mode that utilizes a compressed + # version of the molecular structure and also supports parallel I/O. + # Refer: https://www.ks.uiuc.edu/Research/namd/wiki/index.cgi?NamdMemoryReduction + variant( + "memopt", + when="@2.8:", + default=False, + description="Enable memory-optimized build supported with NAMD 2.8+", + ) + # init_tcl_pointers() declaration and implementation are inconsistent # "src/colvarproxy_namd.C", line 482: error: inherited member is not # allowed @@ -103,9 +118,13 @@ class Namd(MakefilePackage, CudaPackage, ROCmPackage): depends_on("tcl", when="interface=python") depends_on("python", when="interface=python") - conflicts("+avxtiles", when="@:2.14,3:", msg="AVXTiles algorithm requires NAMD 2.15") conflicts("+rocm", when="+cuda", msg="NAMD supports only one GPU backend at a time") conflicts("+single_node_gpu", when="~cuda~rocm") + conflicts( + "+memopt", + when="+single_node_gpu", + msg="memopt mode is not compatible with GPU-resident builds", + ) # https://www.ks.uiuc.edu/Research/namd/2.12/features.html # https://www.ks.uiuc.edu/Research/namd/2.13/features.html @@ -304,6 +323,9 @@ def edit(self, spec, prefix): if "+single_node_gpu" in spec: opts.extend(["--with-single-node-hip"]) + if spec.satisfies("+memopt"): + opts.append("--with-memopt") + config = Executable("./config") config(self.build_directory, *opts)