legion: Add 23.06.0, variants for UCX, max nodes, update CUDA version. (#38759)

* legion: Add 23.06.0, variants for UCX, max nodes, update CUDA version.

* legion: Make newer CUDA versions dependent on newer Legion.

* legion: Update CUDA arch list so that we can stop tracking manually.
This commit is contained in:
Elliott Slaughter 2023-07-17 08:51:45 -07:00 committed by GitHub
parent bf43471a7c
commit dc216adde2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,7 @@ class Legion(CMakePackage, ROCmPackage):
maintainers("pmccormick", "streichler", "elliottslaughter") maintainers("pmccormick", "streichler", "elliottslaughter")
tags = ["e4s"] tags = ["e4s"]
version("23.06.0", tag="legion-23.06.0")
version("23.03.0", tag="legion-23.03.0") version("23.03.0", tag="legion-23.03.0")
version("22.12.0", tag="legion-22.12.0") version("22.12.0", tag="legion-22.12.0")
version("22.09.0", tag="legion-22.09.0") version("22.09.0", tag="legion-22.09.0")
@ -46,17 +47,19 @@ class Legion(CMakePackage, ROCmPackage):
# use for general (not legion development) use cases. # use for general (not legion development) use cases.
depends_on("mpi", when="network=mpi") depends_on("mpi", when="network=mpi")
depends_on("mpi", when="network=gasnet") # MPI is required to build gasnet (needs mpicc). depends_on("mpi", when="network=gasnet") # MPI is required to build gasnet (needs mpicc).
depends_on("ucx", when="network=ucx")
depends_on("ucx", when="conduit=ucx") depends_on("ucx", when="conduit=ucx")
depends_on("mpi", when="conduit=mpi") depends_on("mpi", when="conduit=mpi")
depends_on("cuda@10.0:11.9", when="+cuda_unsupported_compiler") depends_on("cray-pmi", when="conduit=ofi-slingshot11 ^cray-mpich")
depends_on("cuda@10.0:11.9", when="+cuda") depends_on("cuda@10.0:11.9", when="+cuda_unsupported_compiler @:23.03.0")
depends_on("cuda@10.0:11.9", when="+cuda @:23.03.0")
depends_on("cuda@10.0:12.2", when="+cuda_unsupported_compiler @23.06.0:")
depends_on("cuda@10.0:12.2", when="+cuda @23.06.0:")
depends_on("hdf5", when="+hdf5") depends_on("hdf5", when="+hdf5")
depends_on("hwloc", when="+hwloc") depends_on("hwloc", when="+hwloc")
# cuda-centric # cuda-centric
# reminder for arch numbers to names: 60=pascal, 70=volta, 75=turing, 80=ampere cuda_arch_list = CudaPackage.cuda_arch_values
# TODO: we could use a map here to clean up and use naming vs. numbers.
cuda_arch_list = ("60", "70", "75", "80")
for nvarch in cuda_arch_list: for nvarch in cuda_arch_list:
depends_on( depends_on(
"kokkos@3.3.01:+cuda+cuda_lambda+wrapper cuda_arch={0}".format(nvarch), "kokkos@3.3.01:+cuda+cuda_lambda+wrapper cuda_arch={0}".format(nvarch),
@ -118,7 +121,7 @@ class Legion(CMakePackage, ROCmPackage):
variant( variant(
"network", "network",
default="none", default="none",
values=("gasnet", "mpi", "none"), values=("gasnet", "mpi", "ucx", "none"),
description="The network communications/transport layer to use.", description="The network communications/transport layer to use.",
multi=False, multi=False,
) )
@ -160,7 +163,7 @@ def validate_gasnet_root(value):
"conduit", "conduit",
default="none", default="none",
values=("none", "aries", "ibv", "udp", "mpi", "ucx", "ofi-slingshot11"), values=("none", "aries", "ibv", "udp", "mpi", "ucx", "ofi-slingshot11"),
description="The gasnet conduit(s) to enable.", description="The GASNet conduit(s) to enable.",
sticky=True, sticky=True,
multi=False, multi=False,
) )
@ -261,7 +264,12 @@ def validate_gasnet_root(value):
default=512, default=512,
description="Maximum number of fields allowed in a logical region.", description="Maximum number of fields allowed in a logical region.",
) )
depends_on("cray-pmi", when="conduit=ofi-slingshot11 ^cray-mpich") variant(
"max_num_nodes",
values=int,
default=1024,
description="Maximum number of nodes supported by Legion.",
)
def setup_build_environment(self, build_env): def setup_build_environment(self, build_env):
spec = self.spec spec = self.spec
@ -297,6 +305,8 @@ def cmake_args(self):
options.append("-DLegion_EMBED_GASNet_CONFIGURE_ARGS=--enable-debug") options.append("-DLegion_EMBED_GASNet_CONFIGURE_ARGS=--enable-debug")
elif "network=mpi" in spec: elif "network=mpi" in spec:
options.append("-DLegion_NETWORKS=mpi") options.append("-DLegion_NETWORKS=mpi")
elif "network=ucx" in spec:
options.append("-DLegion_NETWORKS=ucx")
else: else:
options.append("-DLegion_EMBED_GASNet=OFF") options.append("-DLegion_EMBED_GASNet=OFF")
@ -410,6 +420,17 @@ def cmake_args(self):
maxfields = maxfields << 1 maxfields = maxfields << 1
options.append("-DLegion_MAX_FIELDS=%d" % maxfields) options.append("-DLegion_MAX_FIELDS=%d" % maxfields)
maxnodes = int(spec.variants["max_num_nodes"].value)
if maxnodes <= 0:
maxnodes = 1024
# make sure maxnodes is a power of two. if not,
# find the next largest power of two and use that...
if maxnodes & (maxnodes - 1) != 0:
while maxnodes & maxnodes - 1:
maxnodes = maxnodes & maxnodes - 1
maxnodes = maxnodes << 1
options.append("-DLegion_MAX_NUM_NODES=%d" % maxnodes)
# This disables Legion's CMake build system's logic for targeting the native # This disables Legion's CMake build system's logic for targeting the native
# CPU architecture in favor of Spack-provided compiler flags # CPU architecture in favor of Spack-provided compiler flags
options.append("-DBUILD_MARCH:STRING=") options.append("-DBUILD_MARCH:STRING=")