NWChem ARMCI-MPI variant and optional TCE builds (#43883)

* WIP NWChem with ARMCI-MPI and TCE optional
* rename armci-mpi to armcimpi
* add version for git
* add ARMCI-MPI support to NWChem package
   EXTERNAL_ARMCI_PATH needs to be set to the ARMCI-MPI package install prefix.
   I could not get it from spec["armcimpi"] but it worked to use the dependent build environment method to export a    generic environmental variable to use instead.
* i suppose i can maintain NWChem as well
* check rejects option that dozens of packages use
   i do not have time to fight with this nonsense
   Run . share/spack/setup-env.sh
   ==> Error: armcimpi version 'master' has extra arguments: 'branch'
   Valid arguments for a url fetcher are:
       'url', 'sha256', 'md5', 'sha1', 'sha224', 'sha384', 'sha512', and 'checksum'
   Error: Process completed with exit code 1.
* style
* ARMCI-MPI needs depends_on; the rest seems fixed
* fix ARMCI selection per review feedback from @zzzoom
   https://github.com/spack/spack/pull/43883#discussion_r1585014147
* address reviewer feedback from @yizeyi18
   https://github.com/spack/spack/pull/43883#discussion_r1587228084
   elaborate on what +extratce does, in terms of the NWChem build environment variables,
   some of which are documented on https://nwchemgit.github.io/TCE.html.
* style
* Update var/spack/repos/builtin/packages/nwchem/package.py

---------

Signed-off-by: Jeff Hammond <jeff.science@gmail.com>
Co-authored-by: Carlos Bederián <4043375+zzzoom@users.noreply.github.com>
This commit is contained in:
Jeff Hammond 2024-05-03 21:13:54 +03:00 committed by GitHub
parent e2329adac0
commit 23f16041cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 44 additions and 7 deletions

View file

@ -6,7 +6,7 @@
from spack.package import *
class ArmciMpi(AutotoolsPackage):
class Armcimpi(AutotoolsPackage):
"""ARMCI-MPI is an implementation of the ARMCI library used by Global Arrays.
MPI-3 one-sided communication is used to implement ARMCI.
"""
@ -26,6 +26,8 @@ class ArmciMpi(AutotoolsPackage):
variant("shared", default=True, description="Builds a shared version of the library")
variant("progress", default=False, description="Enable asynchronous progress")
provides("armci")
depends_on("autoconf", type="build")
depends_on("automake", type="build")
depends_on("libtool", type="build")
@ -41,3 +43,6 @@ def configure_args(self):
args.extend(self.enable_or_disable("shared"))
args.extend(self.with_or_without("progress"))
return args
def setup_dependent_build_environment(self, env, dependent_spec):
env.set("ARMCIMPI_DIR", self.prefix)

View file

@ -17,6 +17,8 @@ class Nwchem(Package):
tags = ["ecp", "ecp-apps"]
maintainers("jeffhammond")
version(
"7.2.2",
sha256="6b68e9c12eec38c09d92472bdd1ff130b93c1b5e1f65e4702aa7ee36c80e4af7",
@ -34,7 +36,17 @@ class Nwchem(Package):
)
variant("openmp", default=False, description="Enables OpenMP support")
variant("mpipr", default=False, description="Enables ARMCI with progress rank")
variant(
"armci",
values=("mpi-ts", "mpi-pr", "armcimpi", "mpi3", "openib", "ofi"),
default="mpi-ts",
description="ARMCI runtime",
)
variant(
"extratce",
default=False,
description="Enables rarely-used TCE features (CCSDTQ, CCSDTLR, EACCSD, IPCCSD, MRCC)",
)
variant("fftw3", default=False, description="Link against the FFTW library")
variant("libxc", default=False, description="Support additional functionals via libxc")
variant(
@ -60,6 +72,9 @@ class Nwchem(Package):
depends_on("blas")
depends_on("lapack")
depends_on("mpi")
depends_on("armcimpi", when="armci=armcimpi")
depends_on("libfabric", when="armci=ofi")
depends_on("rdma-core", when="armci=openib")
depends_on("scalapack")
depends_on("fftw-api@3", when="+fftw3")
depends_on("libxc", when="+libxc")
@ -88,10 +103,6 @@ def install(self, spec, prefix):
f"LAPACK_LIB={lapack.ld_flags}",
f"SCALAPACK_LIB={scalapack.ld_flags}",
"USE_NOIO=Y", # skip I/O algorithms
"MRCC_METHODS=y", # TCE extra module
"IPCCSD=y", # TCE extra module
"EACCSD=y", # TCE extra module
"CCSDTQ=y", # TCE extra module
"V=1", # verbose build
]
)
@ -121,11 +132,32 @@ def install(self, spec, prefix):
args.extend([f"NWCHEM_TARGET={target}"])
# These optional components of TCE are rarely used and in some cases
# increase the compilation time significantly (CCSDTLR and CCSDTQ).
if spec.satisfies("+extratce"):
args.extend(["MRCC_METHODS=y"])
args.extend(["IPCCSD=y"])
args.extend(["EACCSD=y"])
args.extend(["CCSDTLR=y"])
args.extend(["CCSDTQ=y"])
if spec.satisfies("+openmp"):
args.extend(["USE_OPENMP=y"])
if spec.satisfies("+mpipr"):
if self.spec.variants["armci"].value == "armcimpi":
armcimpi = spec["armci"]
args.extend(["ARMCI_NETWORK=ARMCI"])
args.extend([f"EXTERNAL_ARMCI_PATH={armcimpi.prefix}"])
elif self.spec.variants["armci"].value == "mpi-pr":
args.extend(["ARMCI_NETWORK=MPI-PR"])
elif self.spec.variants["armci"].value == "mpi-ts":
args.extend(["ARMCI_NETWORK=MPI-TS"])
elif self.spec.variants["armci"].value == "mpi3":
args.extend(["ARMCI_NETWORK=MPI3"])
elif self.spec.variants["armci"].value == "openib":
args.extend(["ARMCI_NETWORK=OPENIB"])
elif self.spec.variants["armci"].value == "ofi":
args.extend(["ARMCI_NETWORK=OFI"])
if spec.satisfies("+fftw3"):
args.extend(["USE_FFTW3=y"])