From b10f51f02083495ee98a90f94313e6d3bdbd95f8 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Mon, 15 Apr 2024 16:28:31 +0200 Subject: [PATCH] charmpp: add archs including Cray shasta with ARM (#43191) Co-authored-by: RMeli --- .../packages/charmpp/ofi-crayshasta-arm.patch | 13 +++++ .../repos/builtin/packages/charmpp/package.py | 52 ++++++++++++++----- 2 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 var/spack/repos/builtin/packages/charmpp/ofi-crayshasta-arm.patch diff --git a/var/spack/repos/builtin/packages/charmpp/ofi-crayshasta-arm.patch b/var/spack/repos/builtin/packages/charmpp/ofi-crayshasta-arm.patch new file mode 100644 index 0000000000..ce21509fb5 --- /dev/null +++ b/var/spack/repos/builtin/packages/charmpp/ofi-crayshasta-arm.patch @@ -0,0 +1,13 @@ +diff --git a/src/arch/ofi-crayshasta/conv-mach.h b/src/arch/ofi-crayshasta/conv-mach.h +index 61d295df3..9e15fd2a9 100644 +--- a/src/arch/ofi-crayshasta/conv-mach.h ++++ b/src/arch/ofi-crayshasta/conv-mach.h +@@ -74,7 +74,7 @@ + #define CMK_LBDB_ON 1 + + #define CMK_64BIT 1 +-#define CMK_AMD64 1 ++#define CMK_ARM 1 + + /* Other possible definitions: + diff --git a/var/spack/repos/builtin/packages/charmpp/package.py b/var/spack/repos/builtin/packages/charmpp/package.py index 637b111dac..5225c20b43 100644 --- a/var/spack/repos/builtin/packages/charmpp/package.py +++ b/var/spack/repos/builtin/packages/charmpp/package.py @@ -58,6 +58,9 @@ class Charmpp(Package): # Ignore compiler warnings while configuring patch("strictpass.patch", when="@:6.8.2") + # Support Cray Shasta with ARM + patch("ofi-crayshasta-arm.patch", when="backend=ofi pmi=cray-pmi target=aarch64:") + # Build targets # "target" is reserved, so we have to use something else. variant( @@ -86,7 +89,7 @@ class Charmpp(Package): variant( "pmi", default="none", - values=("none", "simplepmi", "slurmpmi", "slurmpmi2", "pmix"), + values=("none", "simplepmi", "slurmpmi", "slurmpmi2", "pmix", "cray-pmi"), description="The ucx/ofi/gni backends need PMI to run!", ) @@ -112,6 +115,7 @@ class Charmpp(Package): depends_on("cuda", when="+cuda") depends_on("ucx", when="backend=ucx") + depends_on("libfabric", when="backend=ofi") depends_on("slurm@:17-11-9-2", when="pmi=slurmpmi") depends_on("slurm@17-11-9-2:", when="pmi=slurmpmi2") @@ -123,6 +127,7 @@ class Charmpp(Package): depends_on("mpi", when="pmi=simplepmi") depends_on("mpi", when="pmi=slurmpmi") depends_on("mpi", when="pmi=slurmpmi2") + depends_on("cray-mpich", when="pmi=cray-pmi") # Git versions of Charm++ require automake and autoconf depends_on("automake", when="@develop") @@ -180,7 +185,6 @@ def charmarch(self): ("linux", "x86_64", "netlrts"): "netlrts-linux-x86_64", ("linux", "x86_64", "verbs"): "verbs-linux-x86_64", ("linux", "x86_64", "ofi"): "ofi-linux-x86_64", - ("linux", "x86_64", "ucx"): "ucx-linux-x86_64", ("linux", "ppc", "mpi"): "mpi-linux-ppc", ("linux", "ppc", "multicore"): "multicore-linux-ppc", ("linux", "ppc", "netlrts"): "netlrts-linux-ppc", @@ -195,29 +199,53 @@ def charmarch(self): ("cnl", "x86_64", "mpi"): "mpi-crayxc", } - # Some versions were renamed/removed in 6.11 - if self.spec.version < Version("6.11.0"): - versions.update({("linux", "i386", "mpi"): "mpi-linux"}) - versions.update({("linux", "i386", "multicore"): "multicore-linux"}) - versions.update({("linux", "i386", "netlrts"): "netlrts-linux"}) - versions.update({("linux", "i386", "uth"): "uth-linux"}) + if self.spec.satisfies("@6.10:"): versions.update( { + ("linux", "x86_64", "ucx"): "ucx-linux-x86_64", + ("linux", "aarch64", "ucx"): "ucx-linux-arm8", + } + ) + + # Some versions were renamed/removed in 6.11 + if self.spec.version < Version("6.11.0"): + versions.update( + { + ("linux", "i386", "mpi"): "mpi-linux", + ("linux", "i386", "multicore"): "multicore-linux", + ("linux", "i386", "netlrts"): "netlrts-linux", + ("linux", "i386", "uth"): "uth-linux", ("linux", "arm", "multicore"): "multicore-arm7", ("linux", "aarch64", "multicore"): "multicore-arm8", } ) else: - versions.update({("linux", "i386", "mpi"): "mpi-linux-i386"}) - versions.update({("linux", "i386", "multicore"): "multicore-linux-i386"}) - versions.update({("linux", "i386", "netlrts"): "netlrts-linux-i386"}) versions.update( { + ("linux", "i386", "mpi"): "mpi-linux-i386", + ("linux", "i386", "multicore"): "multicore-linux-i386", + ("linux", "i386", "netlrts"): "netlrts-linux-i386", ("linux", "arm", "multicore"): "multicore-linux-arm7", ("linux", "aarch64", "multicore"): "multicore-linux-arm8", } ) + if self.spec.satisfies("@7:"): + versions.update( + { + ("linux", "arm", "mpi"): "mpi-linux-arm7", + ("linux", "aarch64", "mpi"): "mpi-linux-arm8", + } + ) + + if self.spec.satisfies("backend=ofi pmi=cray-pmi"): + versions.update( + { + ("linux", "x86_64", "ofi"): "ofi-crayshasta", + ("linux", "aarch64", "ofi"): "ofi-crayshasta", + } + ) + if (plat, mach, comm) not in versions: raise InstallError( "The communication mechanism %s is not supported " @@ -394,4 +422,4 @@ def setup_dependent_package(self, module, dependent_spec): self.spec.mpicxx = self.prefix.bin.ampicxx self.spec.mpifc = self.prefix.bin.ampif90 self.spec.mpif77 = self.prefix.bin.ampif77 - self.spec.charmarch = self.charmarch + self.spec.charmarch = self.charmarch + "-smp" if self.spec.satisfies("+smp") else ""