Skip to content

Commit

Permalink
Update and standardize implementation of RADIUSS packages (spack#45648)
Browse files Browse the repository at this point in the history
* Add latest releases of Camp, RAJA, Umpire, CHAI and CARE
* Address review comments + blt requirement in Umpire
* CARE @develop & @main: Submodules -> False
* Changes in Umpire
* Changes in RAJA
* Changes in CHAI
* Changes in RAJA: prefer 'spec.satisfies' to 'in spec'
   This is due to a non-equivalence in Spack with providers like mpi.
   See e.g. spack#46126
* Changes in Umpire: prefer 'spec.satisfies' to 'in spec'
   This is due to a non-equivalence in Spack with providers like mpi.
   See e.g. spack#46126
* Changes in CARE:
   Still need to update to CachedCMakePackage based on RADIUSS Spack Configs version
* Missing change in RAJA + changes in fmt
* Fix synta
* Changes in Camp
* Fix style
* CHAI: when ~raja, turn off RAJA in build system
* Fix: [email protected] does not support [email protected]
* Enforce same version constraint on Umpire as for RAJA
* Enforce preferred version of vtk-m in ascent 0.9.3
* Migrate CARE package to CachedCMakePackage
* Fix style in CARE package
* CARE: Apply changes for uniform implementation accross RADIUSS projects
* Caliper: move to CachedCMakePackage, from RADIUSS Spack Configs
* Adapt RAJA Perf to spack CI
* Activate CHAI, CARE and RAJAPerf in Spack CI
* Fixes and diffs with RADIUSS Spack Configs
* Caliper: fix
* Caliper : fix + RAJAPerf : style
* RAJAPerf: fixes
* Update maintainers
* raja-perf: fix license header
* raja-perf: Fix variant naming openmp_target -> omptarget
* raja-perf: style and blt dependency versions
* CARE: benchmark and examples off by default (like tests)
* CARE: fix missing variable
* Update var/spack/repos/builtin/packages/raja-perf/package.py
* CARE: fix branch name
* Revert changes in MFEM to pass CI
* Fix CXX17 condition in RAJA + add sycl option in RAJAPerf

---------

Co-authored-by: Rich Hornung <[email protected]>
  • Loading branch information
adrienbernede and rhornung67 authored Sep 30, 2024
1 parent cb43019 commit d7f5dba
Show file tree
Hide file tree
Showing 10 changed files with 834 additions and 233 deletions.
5 changes: 3 additions & 2 deletions share/spack/gitlab/cloud_pipelines/stacks/radiuss/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ spack:
- axom
- blt
- caliper
#- care ## ~benchmarks ~examples ~tests
#- chai ## ~examples
- care # ~benchmarks ~examples ~tests
- chai # ~examples
- conduit # ^hdf5+shared
- flux-core
#- flux-sched
Expand All @@ -31,6 +31,7 @@ spack:
- py-merlin
- py-shroud
- raja # ~examples # ~tests
- raja-perf
- samrai
- scr
- sundials
Expand Down
5 changes: 3 additions & 2 deletions var/spack/repos/builtin/packages/ascent/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ class Ascent(CMakePackage, CudaPackage):
#######################
with when("+raja"):
depends_on("raja")
depends_on("[email protected]:", when="@0.9.3:")
depends_on("[email protected]:2024.02.99", when="@0.9.3:")
depends_on("raja+openmp", when="+openmp")
depends_on("raja~openmp", when="~openmp")

with when("+umpire"):
depends_on("umpire")
depends_on("umpire@:2023.06.0", when="@:0.9.2")
depends_on("[email protected]:", when="@0.9.3:")
depends_on("[email protected]:2024.02.99", when="@0.9.3:")

#######################
# BabelFlow
Expand All @@ -216,6 +216,7 @@ class Ascent(CMakePackage, CudaPackage):
#######################
with when("+vtkh"):
depends_on("vtk-m +doubleprecision ~64bitids")
depends_on("[email protected]:", when="@0.9.3:")
depends_on("[email protected]:", when="@0.9.2:")
# 2.1 support needs commit e52b7bb8c9fd131f2fd49edf58037cc5ef77a166
depends_on("vtk-m@:2.0", when="@:0.9.2")
Expand Down
144 changes: 92 additions & 52 deletions var/spack/repos/builtin/packages/caliper/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from spack.package import *


class Caliper(CMakePackage, CudaPackage, ROCmPackage):
class Caliper(CachedCMakePackage, CudaPackage, ROCmPackage):
"""Caliper is a program instrumentation and performance measurement
framework. It is designed as a performance analysis toolbox in a
library, allowing one to bake performance analysis capabilities
Expand All @@ -21,7 +21,7 @@ class Caliper(CMakePackage, CudaPackage, ROCmPackage):
url = "https://github.com/LLNL/Caliper/archive/v2.11.0.tar.gz"
tags = ["e4s", "radiuss"]

maintainers("daboehme")
maintainers("daboehme", "adrienbernede")

test_requires_compiler = True

Expand Down Expand Up @@ -134,69 +134,109 @@ class Caliper(CMakePackage, CudaPackage, ROCmPackage):
when="@2.9.0:2.9.1 +libunwind +sampler",
)

def cmake_args(self):
def _get_sys_type(self, spec):
sys_type = spec.architecture
if "SYS_TYPE" in env:
sys_type = env["SYS_TYPE"]
return sys_type

def initconfig_compiler_entries(self):
spec = self.spec
entries = super().initconfig_compiler_entries()

if spec.satisfies("+rocm"):
entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc))

entries.append(cmake_cache_option("WITH_FORTRAN", spec.satisfies("+fortran")))

entries.append(cmake_cache_option("BUILD_SHARED_LIBS", spec.satisfies("+shared")))
entries.append(cmake_cache_option("BUILD_TESTING", spec.satisfies("+tests")))
entries.append(cmake_cache_option("BUILD_DOCS", False))
entries.append(cmake_cache_path("PYTHON_EXECUTABLE", spec["python"].command.path))

return entries

def initconfig_hardware_entries(self):
spec = self.spec
entries = super().initconfig_hardware_entries()

if spec.satisfies("+cuda"):
entries.append(cmake_cache_option("WITH_CUPTI", True))
entries.append(cmake_cache_option("WITH_NVTX", True))
entries.append(cmake_cache_path("CUDA_TOOLKIT_ROOT_DIR", spec["cuda"].prefix))
entries.append(cmake_cache_path("CUPTI_PREFIX", spec["cuda"].prefix))
else:
entries.append(cmake_cache_option("WITH_CUPTI", False))
entries.append(cmake_cache_option("WITH_NVTX", False))

if spec.satisfies("+rocm"):
entries.append(cmake_cache_option("WITH_ROCTRACER", True))
entries.append(cmake_cache_option("WITH_ROCTX", True))
else:
entries.append(cmake_cache_option("WITH_ROCTRACER", False))
entries.append(cmake_cache_option("WITH_ROCTX", False))

return entries

def initconfig_mpi_entries(self):
spec = self.spec
entries = super().initconfig_mpi_entries()

args = [
"-DBUILD_TESTING=Off",
"-DBUILD_DOCS=Off",
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define_from_variant("WITH_ADIAK", "adiak"),
self.define_from_variant("WITH_GOTCHA", "gotcha"),
self.define_from_variant("WITH_PAPI", "papi"),
self.define_from_variant("WITH_LIBDW", "libdw"),
self.define_from_variant("WITH_LIBPFM", "libpfm"),
self.define_from_variant("WITH_SOSFLOW", "sosflow"),
self.define_from_variant("WITH_SAMPLER", "sampler"),
self.define_from_variant("WITH_MPI", "mpi"),
self.define_from_variant("WITH_FORTRAN", "fortran"),
self.define_from_variant("WITH_CUPTI", "cuda"),
self.define_from_variant("WITH_NVTX", "cuda"),
self.define_from_variant("WITH_ROCTRACER", "rocm"),
self.define_from_variant("WITH_ROCTX", "rocm"),
self.define_from_variant("WITH_VARIORUM", "variorum"),
self.define_from_variant("WITH_VTUNE", "vtune"),
self.define_from_variant("WITH_KOKKOS", "kokkos"),
]
entries.append(cmake_cache_option("WITH_MPI", spec.satisfies("+mpi")))

return entries

def initconfig_package_entries(self):
spec = self.spec
entries = []

# TPL locations
entries.append("#------------------{0}".format("-" * 60))
entries.append("# TPLs")
entries.append("#------------------{0}\n".format("-" * 60))

if spec.satisfies("+adiak"):
entries.append(cmake_cache_path("adiak_DIR", spec["adiak"].prefix))
if spec.satisfies("+papi"):
args.append("-DPAPI_PREFIX=%s" % spec["papi"].prefix)
entries.append(cmake_cache_path("PAPI_PREFIX", spec["papi"].prefix))
if spec.satisfies("+libdw"):
args.append("-DLIBDW_PREFIX=%s" % spec["elfutils"].prefix)
entries.append(cmake_cache_path("LIBDW_PREFIX", spec["elfutils"].prefix))
if spec.satisfies("+libpfm"):
args.append("-DLIBPFM_INSTALL=%s" % spec["libpfm4"].prefix)
entries.append(cmake_cache_path("LIBPFM_INSTALL", spec["libpfm4"].prefix))
if spec.satisfies("+sosflow"):
args.append("-DSOS_PREFIX=%s" % spec["sosflow"].prefix)
entries.append(cmake_cache_path("SOS_PREFIX", spec["sosflow"].prefix))
if spec.satisfies("+variorum"):
args.append("-DVARIORUM_PREFIX=%s" % spec["variorum"].prefix)
entries.append(cmake_cache_path("VARIORUM_PREFIX", spec["variorum"].prefix))
if spec.satisfies("+vtune"):
itt_dir = join_path(spec["intel-oneapi-vtune"].prefix, "vtune", "latest")
entries.append(cmake_cache_path("ITT_PREFIX", itt_dir))
if spec.satisfies("+libunwind"):
entries.append(cmake_cache_path("LIBUNWIND_PREFIX", spec["unwind"].prefix))

# Build options
entries.append("#------------------{0}".format("-" * 60))
entries.append("# Build Options")
entries.append("#------------------{0}\n".format("-" * 60))

entries.append(cmake_cache_option("WITH_ADIAK", spec.satisfies("+adiak")))
entries.append(cmake_cache_option("WITH_GOTCHA", spec.satisfies("+gotcha")))
entries.append(cmake_cache_option("WITH_SAMPLER", spec.satisfies("+sampler")))
entries.append(cmake_cache_option("WITH_PAPI", spec.satisfies("+papi")))
entries.append(cmake_cache_option("WITH_LIBDW", spec.satisfies("+libdw")))
entries.append(cmake_cache_option("WITH_LIBPFM", spec.satisfies("+libpfm")))
entries.append(cmake_cache_option("WITH_SOSFLOW", spec.satisfies("+sosflow")))
entries.append(cmake_cache_option("WITH_KOKKOS", spec.satisfies("+kokkos")))
entries.append(cmake_cache_option("WITH_VARIORUM", spec.satisfies("+variorum")))
entries.append(cmake_cache_option("WITH_VTUNE", spec.satisfies("+vtune")))

# -DWITH_CALLPATH was renamed -DWITH_LIBUNWIND in 2.5
callpath_flag = "LIBUNWIND" if spec.satisfies("@2.5:") else "CALLPATH"
if spec.satisfies("+libunwind"):
args.append("-DLIBUNWIND_PREFIX=%s" % spec["unwind"].prefix)
args.append("-DWITH_%s=On" % callpath_flag)
else:
args.append("-DWITH_%s=Off" % callpath_flag)
entries.append(cmake_cache_option("WITH_%s" % callpath_flag, spec.satisfies("+libunwind")))

if spec.satisfies("+mpi"):
args.append("-DMPI_C_COMPILER=%s" % spec["mpi"].mpicc)
args.append("-DMPI_CXX_COMPILER=%s" % spec["mpi"].mpicxx)
return entries

if spec.satisfies("+cuda"):
args.append("-DCUDA_TOOLKIT_ROOT_DIR=%s" % spec["cuda"].prefix)
# technically only works with cuda 10.2+, otherwise cupti is in
# ${CUDA_TOOLKIT_ROOT_DIR}/extras/CUPTI
args.append("-DCUPTI_PREFIX=%s" % spec["cuda"].prefix)

if spec.satisfies("+vtune"):
itt_dir = join_path(spec["intel-oneapi-vtune"].prefix, "vtune", "latest")
args.append("-DITT_PREFIX=%s" % itt_dir)

if spec.satisfies("+rocm"):
args.append("-DCMAKE_CXX_COMPILER={0}".format(spec["hip"].hipcc))
args.append("-DROCM_PREFIX=%s" % spec["hsa-rocr-dev"].prefix)

return args
def cmake_args(self):
return []

@run_after("install")
def cache_test_sources(self):
Expand Down
29 changes: 26 additions & 3 deletions var/spack/repos/builtin/packages/camp/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ class Camp(CMakePackage, CudaPackage, ROCmPackage):
license("BSD-3-Clause")

version("main", branch="main", submodules=False)
version(
"2024.07.0",
tag="v2024.07.0",
commit="0f07de4240c42e0b38a8d872a20440cb4b33d9f5",
submodules=False,
)
version(
"2024.02.1",
tag="v2024.02.",
tag="v2024.02.1",
commit="79c320fa09db987923b56884afdc9f82f4b70fc4",
submodules=False,
)
Expand Down Expand Up @@ -53,12 +59,14 @@ class Camp(CMakePackage, CudaPackage, ROCmPackage):
# TODO: figure out gtest dependency and then set this default True.
variant("tests", default=False, description="Build tests")
variant("openmp", default=False, description="Build with OpenMP support")
variant("omptarget", default=False, description="Build with OpenMP Target support")
variant("sycl", default=False, description="Build with Sycl support")

depends_on("cub", when="+cuda")

depends_on("blt", type="build")
depends_on("[email protected]:", type="build", when="@2024.02.1:")
depends_on("[email protected]:", type="build", when="@2024.02.0:")
depends_on("[email protected]", type="build", when="@2024.02.0")
depends_on("[email protected]:0.5.3", type="build", when="@2022.03.0:2023.06.0")

patch("libstdc++-13-missing-header.patch", when="@:2022.10")
Expand All @@ -67,6 +75,16 @@ class Camp(CMakePackage, CudaPackage, ROCmPackage):

conflicts("^blt@:0.3.6", when="+rocm")

conflicts("+omptarget +rocm")
conflicts("+sycl +omptarget")
conflicts("+sycl +rocm")
conflicts(
"+sycl",
when="@:2024.02.99",
msg="Support for SYCL was introduced in RAJA after 2024.02 release, "
"please use a newer release.",
)

def cmake_args(self):
spec = self.spec

Expand Down Expand Up @@ -94,7 +112,12 @@ def cmake_args(self):
options.append("-DGPU_TARGETS={0}".format(archs))
options.append("-DAMDGPU_TARGETS={0}".format(archs))

options.append(self.define_from_variant("ENABLE_OPENMP", "openmp"))
if spec.satisfies("+omptarget"):
options.append(cmake_cache_string("RAJA_DATA_ALIGN", 64))

options.append(self.define_from_variant("ENABLE_TESTS", "tests"))
options.append(self.define_from_variant("ENABLE_OPENMP", "openmp"))
options.append(self.define_from_variant("CAMP_ENABLE_TARGET_OPENMP", "omptarget"))
options.append(self.define_from_variant("ENABLE_SYCL", "sycl"))

return options
Loading

0 comments on commit d7f5dba

Please sign in to comment.