From d8e78420374a6b0313d3d5618a37400442121dad Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Wed, 2 Nov 2022 18:25:58 +0100 Subject: [PATCH 01/63] Update local packages with latest release --- blt | 2 +- scripts/spack_packages/camp/package.py | 1 + scripts/spack_packages/raja/package.py | 1 + scripts/spack_packages/umpire/package.py | 1 + src/tpl/raja | 2 +- src/tpl/umpire | 2 +- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/blt b/blt index 84fe0d15..296bf64e 160000 --- a/blt +++ b/blt @@ -1 +1 @@ -Subproject commit 84fe0d15d841a79d923e97a9105b86b59147bfed +Subproject commit 296bf64e64edfcfcce6a53e3b396d6529e76b986 diff --git a/scripts/spack_packages/camp/package.py b/scripts/spack_packages/camp/package.py index 3bff14ef..2a0b0c00 100644 --- a/scripts/spack_packages/camp/package.py +++ b/scripts/spack_packages/camp/package.py @@ -21,6 +21,7 @@ class Camp(CMakePackage, CudaPackage, ROCmPackage): maintainers = ['trws'] version('main', branch='main', submodules='True') + version('2022.10.0', sha256='3561c3ef00bbcb61fe3183c53d49b110e54910f47e7fc689ad9ccce57e55d6b8') version('2022.03.0', sha256='e9090d5ee191ea3a8e36b47a8fe78f3ac95d51804f1d986d931e85b8f8dad721') version('0.3.0', sha256='129431a049ca5825443038ad5a37a86ba6d09b2618d5fe65d35f83136575afdb') version('0.2.3', sha256='58a0f3bd5eadb588d7dc83f3d050aff8c8db639fc89e8d6553f9ce34fc2421a7') diff --git a/scripts/spack_packages/raja/package.py b/scripts/spack_packages/raja/package.py index 88812cd6..65f7a34b 100644 --- a/scripts/spack_packages/raja/package.py +++ b/scripts/spack_packages/raja/package.py @@ -63,6 +63,7 @@ class Raja(CMakePackage, CudaPackage, ROCmPackage): version('develop', branch='develop', submodules='True') version('main', branch='main', submodules='True') + version('2022.10.0', tag='v2022.10.0', submodules='True') version('2022.03.0', tag='v2022.03.0', submodules='True') version('0.14.1', tag='v0.14.1', submodules="True") version('0.14.0', tag='v0.14.0', submodules="True") diff --git a/scripts/spack_packages/umpire/package.py b/scripts/spack_packages/umpire/package.py index c3deab95..49fe704f 100644 --- a/scripts/spack_packages/umpire/package.py +++ b/scripts/spack_packages/umpire/package.py @@ -24,6 +24,7 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): version('develop', branch='develop', submodules='True') version('main', branch='main', submodules='True') + version('2022.10.0', tag='v2022.10.0', submodules=True) version('2022.03.0', tag='v2022.03.0', submodules=True) version('6.0.0', tag='v6.0.0', submodules=True) version('5.0.1', tag='v5.0.1', submodules=True) diff --git a/src/tpl/raja b/src/tpl/raja index 5f3282c9..4351fe6a 160000 --- a/src/tpl/raja +++ b/src/tpl/raja @@ -1 +1 @@ -Subproject commit 5f3282c90a069915f76799bc337c9104f39c6d14 +Subproject commit 4351fe6a50bd579511a625b017c9e054885e7fd2 diff --git a/src/tpl/umpire b/src/tpl/umpire index 93b1441a..2db6224a 160000 --- a/src/tpl/umpire +++ b/src/tpl/umpire @@ -1 +1 @@ -Subproject commit 93b1441aaa258c1dcd211a552b75cff6461a2a8a +Subproject commit 2db6224ae0c3f3e0bbd6722e95c1167b7f79be7b From f87bacc8b0e0562f275eb780b7d964b89582b02b Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 3 Nov 2022 12:21:44 +0100 Subject: [PATCH 02/63] =?UTF-8?q?Update=20cmake=20requirements=20in=20RAJA?= =?UTF-8?q?=E2=80=AFpackage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/spack_packages/raja/package.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/spack_packages/raja/package.py b/scripts/spack_packages/raja/package.py index 65f7a34b..3b0ba74b 100644 --- a/scripts/spack_packages/raja/package.py +++ b/scripts/spack_packages/raja/package.py @@ -91,7 +91,10 @@ class Raja(CMakePackage, CudaPackage, ROCmPackage): multi=False, description='Tests to run') variant('desul', default=False, description='Build Desul Atomics backend') - depends_on('cmake@3.9:', type='build') + depends_on("cmake@3.20:", when="@2022.10.0:", type="build") + depends_on("cmake@3.23:", when="@2022.10.0: +rocm", type="build") + depends_on("cmake@3.14:", when="@2022.03.0:", type="build") + depends_on("cmake@:3.20", when="@2022.03.0:2022.03 +rocm", type="build") depends_on('blt@0.4.1', type='build', when='@main') depends_on('blt@0.4.1:', type='build') @@ -296,7 +299,7 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): if not spec.satisfies('cuda_arch=none'): cuda_arch = spec.variants['cuda_arch'].value - cfg.write(cmake_cache_string("CUDA_ARCH", 'sm_{0}'.format(cuda_arch[0]))) + cfg.write(cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", '{0}'.format(cuda_arch[0]))) else: cfg.write(cmake_cache_option("ENABLE_CUDA", False)) From e318e33246197099232977f1e13da5d075402ed5 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 7 Nov 2022 17:17:17 +0100 Subject: [PATCH 03/63] Update dependencies packages --- scripts/spack_packages/blt/package.py | 40 +- scripts/spack_packages/camp/package.py | 102 ++-- scripts/spack_packages/raja/package.py | 574 +++++++----------- .../umpire/cmake_version_check.patch | 13 + .../missing_header_for_numeric_limits.patch | 12 + scripts/spack_packages/umpire/package.py | 419 ++++++++----- .../umpire/std-filesystem-pr784.patch | 33 + 7 files changed, 642 insertions(+), 551 deletions(-) create mode 100644 scripts/spack_packages/umpire/cmake_version_check.patch create mode 100644 scripts/spack_packages/umpire/missing_header_for_numeric_limits.patch create mode 100644 scripts/spack_packages/umpire/std-filesystem-pr784.patch diff --git a/scripts/spack_packages/blt/package.py b/scripts/spack_packages/blt/package.py index 507b02aa..87fb122d 100644 --- a/scripts/spack_packages/blt/package.py +++ b/scripts/spack_packages/blt/package.py @@ -3,36 +3,38 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack import * +from spack.package import * class Blt(Package): """BLT is a streamlined CMake-based foundation for Building, Linking and - Testing large-scale high performance computing (HPC) applications.""" + Testing large-scale high performance computing (HPC) applications.""" homepage = "https://github.com/LLNL/blt" - url = "https://github.com/LLNL/blt/archive/v0.4.0.tar.gz" - git = "https://github.com/LLNL/blt.git" - tags = ['radiuss'] + url = "https://github.com/LLNL/blt/archive/v0.4.0.tar.gz" + git = "https://github.com/LLNL/blt.git" + tags = ["radiuss"] - maintainers = ['white238', 'davidbeckingsale'] + maintainers = ["white238", "davidbeckingsale"] - version('develop', branch='develop') - version('main', branch='main') + version("develop", branch="develop") + version("main", branch="main") # Note: 0.4.0+ contains a breaking change to BLT created targets # if you export targets this could cause problems in downstream # projects if not handled properly. More info here: # https://llnl-blt.readthedocs.io/en/develop/tutorial/exporting_targets.html - version('0.5.0', sha256='5f680ef922d0e0a7ff1b1a5fc8aa107cd4f543ad888cbc9b12639bea72a6ab1f') - version('0.4.1', sha256='16cc3e067ddcf48b99358107e5035a17549f52dcc701a35cd18a9d9f536826c1') - version('0.4.0', sha256='f3bc45d28b9b2eb6df43b75d4f6f89a1557d73d012da7b75bac1be0574767193') - version('0.3.6', sha256='6276317c29e7ff8524fbea47d9288ddb40ac06e9f9da5e878bf9011e2c99bf71') - version('0.3.5', sha256='68a1c224bb9203461ae6f5ab0ff3c50b4a58dcce6c2d2799489a1811f425fb84') - version('0.3.0', sha256='bb917a67cb7335d6721c997ba9c5dca70506006d7bba5e0e50033dd0836481a5') - version('0.2.5', sha256='3a000f60194e47b3e5623cc528cbcaf88f7fea4d9620b3c7446ff6658dc582a5') - version('0.2.0', sha256='c0cadf1269c2feb189e398a356e3c49170bc832df95e5564e32bdbb1eb0fa1b3') - - depends_on('cmake', type='run') + version("0.5.2", sha256="95b924cfbb2bddd9b1a92e96603b2fd485a19721d59ddf8ff50baefc1714d7ea") + version("0.5.1", sha256="ff7e87eefc48704a0721b66174612b945955adaa0a56aa69dd0473074fa4badf") + version("0.5.0", sha256="5f680ef922d0e0a7ff1b1a5fc8aa107cd4f543ad888cbc9b12639bea72a6ab1f") + version("0.4.1", sha256="16cc3e067ddcf48b99358107e5035a17549f52dcc701a35cd18a9d9f536826c1") + version("0.4.0", sha256="f3bc45d28b9b2eb6df43b75d4f6f89a1557d73d012da7b75bac1be0574767193") + version("0.3.6", sha256="6276317c29e7ff8524fbea47d9288ddb40ac06e9f9da5e878bf9011e2c99bf71") + version("0.3.5", sha256="68a1c224bb9203461ae6f5ab0ff3c50b4a58dcce6c2d2799489a1811f425fb84") + version("0.3.0", sha256="bb917a67cb7335d6721c997ba9c5dca70506006d7bba5e0e50033dd0836481a5") + version("0.2.5", sha256="3a000f60194e47b3e5623cc528cbcaf88f7fea4d9620b3c7446ff6658dc582a5") + version("0.2.0", sha256="c0cadf1269c2feb189e398a356e3c49170bc832df95e5564e32bdbb1eb0fa1b3") + + depends_on("cmake", type="run") def install(self, spec, prefix): - install_tree('.', prefix) \ No newline at end of file + install_tree(".", prefix) diff --git a/scripts/spack_packages/camp/package.py b/scripts/spack_packages/camp/package.py index 2a0b0c00..4e25af80 100644 --- a/scripts/spack_packages/camp/package.py +++ b/scripts/spack_packages/camp/package.py @@ -8,6 +8,24 @@ from spack.package import * +def hip_repair_options(options, spec): + # there is only one dir like this, but the version component is unknown + options.append( + "-DHIP_CLANG_INCLUDE_PATH=" + + glob.glob("{}/lib/clang/*/include".format(spec["llvm-amdgpu"].prefix))[0] + ) + + +def hip_repair_cache(options, spec): + # there is only one dir like this, but the version component is unknown + options.append( + cmake_cache_path( + "HIP_CLANG_INCLUDE_PATH", + glob.glob("{}/lib/clang/*/include".format(spec["llvm-amdgpu"].prefix))[0], + ) + ) + + class Camp(CMakePackage, CudaPackage, ROCmPackage): """ Compiler agnostic metaprogramming library providing concepts, @@ -15,70 +33,66 @@ class Camp(CMakePackage, CudaPackage, ROCmPackage): """ homepage = "https://github.com/LLNL/camp" - git = "https://github.com/LLNL/camp.git" - url = "https://github.com/LLNL/camp/archive/v0.1.0.tar.gz" + git = "https://github.com/LLNL/camp.git" + url = "https://github.com/LLNL/camp/archive/v0.1.0.tar.gz" - maintainers = ['trws'] + maintainers = ["trws"] - version('main', branch='main', submodules='True') - version('2022.10.0', sha256='3561c3ef00bbcb61fe3183c53d49b110e54910f47e7fc689ad9ccce57e55d6b8') - version('2022.03.0', sha256='e9090d5ee191ea3a8e36b47a8fe78f3ac95d51804f1d986d931e85b8f8dad721') - version('0.3.0', sha256='129431a049ca5825443038ad5a37a86ba6d09b2618d5fe65d35f83136575afdb') - version('0.2.3', sha256='58a0f3bd5eadb588d7dc83f3d050aff8c8db639fc89e8d6553f9ce34fc2421a7') - version('0.2.2', sha256='194d38b57e50e3494482a7f94940b27f37a2bee8291f2574d64db342b981d819') - version('0.1.0', sha256='fd4f0f2a60b82a12a1d9f943f8893dc6fe770db493f8fae5ef6f7d0c439bebcc') + version("main", branch="main", submodules="True") + version("2022.10.0", sha256="3561c3ef00bbcb61fe3183c53d49b110e54910f47e7fc689ad9ccce57e55d6b8") + version("2022.03.2", sha256="bc4aaeacfe8f2912e28f7a36fc731ab9e481bee15f2c6daf0cb208eed3f201eb") + version("2022.03.0", sha256="e9090d5ee191ea3a8e36b47a8fe78f3ac95d51804f1d986d931e85b8f8dad721") + version("0.3.0", sha256="129431a049ca5825443038ad5a37a86ba6d09b2618d5fe65d35f83136575afdb") + version("0.2.3", sha256="58a0f3bd5eadb588d7dc83f3d050aff8c8db639fc89e8d6553f9ce34fc2421a7") + version("0.2.2", sha256="194d38b57e50e3494482a7f94940b27f37a2bee8291f2574d64db342b981d819") + version("0.1.0", sha256="fd4f0f2a60b82a12a1d9f943f8893dc6fe770db493f8fae5ef6f7d0c439bebcc") # 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("tests", default=False, description="Build tests") + variant("openmp", default=False, description="Build with OpenMP support") - depends_on('cub', when='+cuda') + depends_on("cub", when="+cuda") - depends_on('blt') + depends_on("blt") def cmake_args(self): spec = self.spec options = [] - options.append("-DBLT_SOURCE_DIR={0}".format(spec['blt'].prefix)) + options.append("-DBLT_SOURCE_DIR={0}".format(spec["blt"].prefix)) - if '+cuda' in spec: + if "+cuda" in spec: options.extend([ - '-DENABLE_CUDA=ON', - '-DCUDA_TOOLKIT_ROOT_DIR=%s' % (spec['cuda'].prefix)]) - - if not spec.satisfies('cuda_arch=none'): - cuda_arch = spec.variants['cuda_arch'].value - options.append('-DCMAKE_CUDA_ARCHITECTURES={0}'.format(cuda_arch[0])) - options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0])) - flag = '-arch sm_{0}'.format(cuda_arch[0]) - options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag)) + "-DENABLE_CUDA=ON", + "-DCUDA_TOOLKIT_ROOT_DIR=%s" % (spec["cuda"].prefix) + ]) + + if not spec.satisfies("cuda_arch=none"): + cuda_arch = spec.variants["cuda_arch"].value + options.append("-DCMAKE_CUDA_ARCHITECTURES={0}".format(cuda_arch[0])) + options.append("-DCUDA_ARCH=sm_{0}".format(cuda_arch[0])) + flag = "-arch sm_{0}".format(cuda_arch[0]) + options.append("-DCMAKE_CUDA_FLAGS:STRING={0}".format(flag)) else: - options.append('-DENABLE_CUDA=OFF') + options.append("-DENABLE_CUDA=OFF") - if '+rocm' in spec: + if "+rocm" in spec: options.extend([ - '-DENABLE_HIP=ON', - '-DHIP_ROOT_DIR={0}'.format(spec['hip'].prefix) + "-DENABLE_HIP=ON", + "-DHIP_ROOT_DIR={0}".format(spec["hip"].prefix) ]) - archs = self.spec.variants['amdgpu_target'].value - if archs != 'none': + + hip_repair_options(options, spec) + + archs = self.spec.variants["amdgpu_target"].value + if archs != "none": arch_str = ",".join(archs) - options.append( - '-DHIP_HIPCC_FLAGS=--amdgpu-target={0}'.format(arch_str) - ) - # there is only one dir like this, but the version component is unknown - options.append( - "-DHIP_CLANG_INCLUDE_PATH=" + glob.glob( - "{}/lib/clang/*/include".format(spec['llvm-amdgpu'].prefix) - )[0] - ) + options.append("-DHIP_HIPCC_FLAGS=--amdgpu-target={0}".format(arch_str)) else: - options.append('-DENABLE_HIP=OFF') - - options.append(self.define_from_variant('ENABLE_TESTS', 'tests')) - options.append(self.define_from_variant('ENABLE_OPENMP', 'openmp')) + options.append("-DENABLE_HIP=OFF") + options.append(self.define_from_variant("ENABLE_OPENMP", "openmp")) + options.append(self.define_from_variant("ENABLE_TESTS", "tests")) return options diff --git a/scripts/spack_packages/raja/package.py b/scripts/spack_packages/raja/package.py index 3b0ba74b..16e1996a 100644 --- a/scripts/spack_packages/raja/package.py +++ b/scripts/spack_packages/raja/package.py @@ -1,387 +1,271 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - -import glob -import os import socket +import glob -from os import environ as env -from os.path import join as pjoin - -import re - -def cmake_cache_entry(name, value, comment=""): - """Generate a string for a cmake cache variable""" - - return 'set(%s "%s" CACHE PATH "%s")\n\n' % (name,value,comment) - - -def cmake_cache_string(name, string, comment=""): - """Generate a string for a cmake cache variable""" - - return 'set(%s "%s" CACHE STRING "%s")\n\n' % (name,string,comment) - - -def cmake_cache_option(name, boolean_value, comment=""): - """Generate a string for a cmake configuration option""" - - value = "ON" if boolean_value else "OFF" - return 'set(%s %s CACHE BOOL "%s")\n\n' % (name,value,comment) - - -def get_spec_path(spec, package_name, path_replacements = {}, use_bin = False) : - """Extracts the prefix path for the given spack package - path_replacements is a dictionary with string replacements for the path. - """ - - if not use_bin: - path = spec[package_name].prefix - else: - path = spec[package_name].prefix.bin - - path = os.path.realpath(path) - - for key in path_replacements: - path = path.replace(key, path_replacements[key]) - - return path - - -class Raja(CMakePackage, CudaPackage, ROCmPackage): - """RAJA Performance Portability Abstractions for C++ HPC Applications.""" - - homepage = "https://github.com/LLNL/RAJA" - git = "https://github.com/LLNL/RAJA.git" - tags = ['radiuss', 'e4s'] - - maintainers = ['davidbeckingsale'] - - version('develop', branch='develop', submodules='True') - version('main', branch='main', submodules='True') - version('2022.10.0', tag='v2022.10.0', submodules='True') - version('2022.03.0', tag='v2022.03.0', submodules='True') - version('0.14.1', tag='v0.14.1', submodules="True") - version('0.14.0', tag='v0.14.0', submodules="True") - version('0.13.0', tag='v0.13.0', submodules="True") - version('0.12.1', tag='v0.12.1', submodules="True") - version('0.12.0', tag='v0.12.0', submodules="True") - version('0.11.0', tag='v0.11.0', submodules="True") - version('0.10.1', tag='v0.10.1', submodules="True") - version('0.10.0', tag='v0.10.0', submodules="True") - version('0.9.0', tag='v0.9.0', submodules="True") - version('0.8.0', tag='v0.8.0', submodules="True") - version('0.7.0', tag='v0.7.0', submodules="True") - version('0.6.0', tag='v0.6.0', submodules="True") - version('0.5.3', tag='v0.5.3', submodules="True") - version('0.5.2', tag='v0.5.2', submodules="True") - version('0.5.1', tag='v0.5.1', submodules="True") - version('0.5.0', tag='v0.5.0', submodules="True") - version('0.4.1', tag='v0.4.1', submodules="True") - version('0.4.0', tag='v0.4.0', submodules="True") - - variant('openmp', default=True, description='Build OpenMP backend') - variant('shared', default=False, description='Build Shared Libs') - variant('libcpp', default=False, description='Uses libc++ instead of libstdc++') - variant('tests', default='basic', values=('none', 'basic', 'benchmarks'), - multi=False, description='Tests to run') - variant('desul', default=False, description='Build Desul Atomics backend') +from spack.package import * +from spack.pkg.builtin.camp import hip_repair_cache + + +class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): + """RAJA Parallel Framework.""" + + homepage = "https://software.llnl.gov/RAJA/" + git = "https://github.com/LLNL/RAJA.git" + tags = ["radiuss", "e4s"] + + maintainers = ["davidbeckingsale"] + + version("develop", branch="develop", submodules=False) + version("main", branch="main", submodules=False) + version("2022.10.1", tag="v2022.10.1", submodules=False) + version("2022.10.0", tag="v2022.10.0", submodules=False) + version("2022.03.1", tag="v2022.03.1", submodules=False) + version("2022.03.0", tag="v2022.03.0", submodules=False) + version("0.14.0", tag="v0.14.0", submodules="True") + version("0.13.0", tag="v0.13.0", submodules="True") + version("0.12.1", tag="v0.12.1", submodules="True") + version("0.12.0", tag="v0.12.0", submodules="True") + version("0.11.0", tag="v0.11.0", submodules="True") + version("0.10.1", tag="v0.10.1", submodules="True") + version("0.10.0", tag="v0.10.0", submodules="True") + version("0.9.0", tag="v0.9.0", submodules="True") + version("0.8.0", tag="v0.8.0", submodules="True") + version("0.7.0", tag="v0.7.0", submodules="True") + version("0.6.0", tag="v0.6.0", submodules="True") + version("0.5.3", tag="v0.5.3", submodules="True") + version("0.5.2", tag="v0.5.2", submodules="True") + version("0.5.1", tag="v0.5.1", submodules="True") + version("0.5.0", tag="v0.5.0", submodules="True") + version("0.4.1", tag="v0.4.1", submodules="True") + version("0.4.0", tag="v0.4.0", submodules="True") + + # export targets when building pre-2.4.0 release with BLT 0.4.0+ + patch( + "https://github.com/LLNL/RAJA/commit/eca1124ee4af380d6613adc6012c307d1fd4176b.patch?full_index=1", + sha256="12bb78c00b6683ad3e7fd4e3f87f9776bae074b722431b79696bc862816735ef", + when="@:0.13.0 ^blt@0.4:", + ) + + variant("openmp", default=True, description="Build OpenMP backend") + variant("shared", default=True, description="Build Shared Libs") + variant("examples", default=True, description="Build examples.") + variant("exercises", default=True, description="Build exercises.") + # TODO: figure out gtest dependency and then set this default True + # and remove the +tests conflict below. + variant("tests", default=False, description="Build tests") + variant("libcpp", default=False, description="Uses libc++ instead of libstdc++") + variant("desul", default=False, description="Build Desul Atomics backend") + + depends_on("blt") + depends_on("blt@0.5.2:", type="build", when="@2022.10.0:") + depends_on("blt@0.5.0:", type="build", when="@0.14.1:") + depends_on("blt@0.4.1", type="build", when="@0.14.0") + depends_on("blt@0.4.0:", type="build", when="@0.13.0") + depends_on("blt@0.3.6:", type="build", when="@:0.12.0") + + depends_on("camp@0.2.2:0.2.3", when="@0.14.0") + depends_on("camp@0.1.0", when="@0.10.0:0.13.0") + depends_on("camp@2022.10.0:", when="@2022.10.0:") + depends_on("camp@2022.03.2:", when="@2022.03.0:") + depends_on("camp@main", when="@main") + depends_on("camp@main", when="@develop") + depends_on("camp+openmp", when="+openmp") depends_on("cmake@3.20:", when="@2022.10.0:", type="build") depends_on("cmake@3.23:", when="@2022.10.0: +rocm", type="build") depends_on("cmake@3.14:", when="@2022.03.0:", type="build") depends_on("cmake@:3.20", when="@2022.03.0:2022.03 +rocm", type="build") - depends_on('blt@0.4.1', type='build', when='@main') - depends_on('blt@0.4.1:', type='build') - - depends_on('camp') - depends_on('camp@main') # TODO: remove this ASAP - depends_on('camp+rocm', when='+rocm') - depends_on('camp+openmp', when='+openmp') - for val in ROCmPackage.amdgpu_targets: - depends_on('camp amdgpu_target=%s' % val, when='amdgpu_target=%s' % val) - - depends_on('camp+cuda', when='+cuda') - for sm_ in CudaPackage.cuda_arch_values: - depends_on('camp cuda_arch={0}'.format(sm_), - when='cuda_arch={0}'.format(sm_)) + depends_on("llvm-openmp", when="+openmp %apple-clang") - conflicts('+openmp', when='+rocm') - depends_on('rocprim', when='+rocm') + depends_on("rocprim", when="+rocm") + with when("+rocm @0.12.0:"): + depends_on("camp+rocm") + for arch in ROCmPackage.amdgpu_targets: + depends_on( + "camp+rocm amdgpu_target={0}".format(arch), when="amdgpu_target={0}".format(arch) + ) + conflicts("+openmp") - phases = ['hostconfig', 'cmake', 'build', 'install'] + with when("+cuda @0.12.0:"): + depends_on("camp+cuda") + for sm_ in CudaPackage.cuda_arch_values: + depends_on("camp +cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) def _get_sys_type(self, spec): - sys_type = str(spec.architecture) - # if on llnl systems, we can use the SYS_TYPE + sys_type = spec.architecture if "SYS_TYPE" in env: sys_type = env["SYS_TYPE"] return sys_type - def _get_host_config_path(self, spec): - var='' - if '+cuda' in spec: - var= '-'.join([var,'cuda']) - if '+libcpp' in spec: - var='-'.join([var,'libcpp']) - - host_config_path = "hc-%s-%s-%s%s-%s.cmake" % (socket.gethostname().rstrip('1234567890'), - self._get_sys_type(spec), - spec.compiler, - var, - spec.dag_hash()) - dest_dir = self.stage.source_path - host_config_path = os.path.abspath(pjoin(dest_dir, host_config_path)) - return host_config_path - - def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): - """ - This method creates a 'host-config' file that specifies - all of the options used to configure and build Umpire. - - For more details about 'host-config' files see: - http://software.llnl.gov/conduit/building.html - - Note: - The `py_site_pkgs_dir` arg exists to allow a package that - subclasses this package provide a specific site packages - dir when calling this function. `py_site_pkgs_dir` should - be an absolute path or `None`. - - This is necessary because the spack `site_packages_dir` - var will not exist in the base class. For more details - on this issue see: https://github.com/spack/spack/issues/6261 - """ - - ####################### - # Compiler Info - ####################### - c_compiler = env["SPACK_CC"] - cpp_compiler = env["SPACK_CXX"] - - # Even though we don't have fortran code in our project we sometimes - # use the Fortran compiler to determine which libstdc++ to use - f_compiler = "" - if "SPACK_FC" in env.keys(): - # even if this is set, it may not exist - # do one more sanity check - if os.path.isfile(env["SPACK_FC"]): - f_compiler = env["SPACK_FC"] - - ####################################################################### - # By directly fetching the names of the actual compilers we appear - # to doing something evil here, but this is necessary to create a - # 'host config' file that works outside of the spack install env. - ####################################################################### - - sys_type = self._get_sys_type(spec) - - ############################################## - # Find and record what CMake is used - ############################################## - - cmake_exe = spec['cmake'].command.path - cmake_exe = os.path.realpath(cmake_exe) - - host_config_path = self._get_host_config_path(spec) - cfg = open(host_config_path, "w") - cfg.write("###################\n".format("#" * 60)) - cfg.write("# Generated host-config - Edit at own risk!\n") - cfg.write("###################\n".format("#" * 60)) - cfg.write("# Copyright 2016-22, Lawrence Livermore National Security, LLC\n") - cfg.write("# and RAJA project contributors. See the RAJA/LICENSE file\n") - cfg.write("# for details.\n") - cfg.write("#\n") - cfg.write("# SPDX-License-Identifier: (BSD-3-Clause) \n") - cfg.write("###################\n\n".format("#" * 60)) - - cfg.write("#------------------\n".format("-" * 60)) - cfg.write("# SYS_TYPE: {0}\n".format(sys_type)) - cfg.write("# Compiler Spec: {0}\n".format(spec.compiler)) - cfg.write("# CMake executable path: %s\n" % cmake_exe) - cfg.write("#------------------\n\n".format("-" * 60)) - - cfg.write(cmake_cache_string("CMAKE_BUILD_TYPE", spec.variants['build_type'].value)) - - ####################### - # Compiler Settings - ####################### - - cfg.write("#------------------\n".format("-" * 60)) - cfg.write("# Compilers\n") - cfg.write("#------------------\n\n".format("-" * 60)) - cfg.write(cmake_cache_entry("CMAKE_C_COMPILER", c_compiler)) - cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler)) - - # use global spack compiler flags - cflags = ' '.join(spec.compiler_flags['cflags']) - if "+libcpp" in spec: - cflags += ' '.join([cflags,"-DGTEST_HAS_CXXABI_H_=0"]) - if cflags: - cfg.write(cmake_cache_entry("CMAKE_C_FLAGS", cflags)) + @property + # TODO: name cache file conditionally to cuda and libcpp variants + def cache_name(self): + hostname = socket.gethostname() + if "SYS_TYPE" in env: + hostname = hostname.rstrip("1234567890") + return "{0}-{1}-{2}@{3}.cmake".format( + hostname, + self._get_sys_type(self.spec), + self.spec.compiler.name, + self.spec.compiler.version, + ) + + def initconfig_hardware_entries(self): + spec = self.spec + entries = super(Raja, self).initconfig_hardware_entries() - cxxflags = ' '.join(spec.compiler_flags['cxxflags']) - if "+libcpp" in spec: - cxxflags += ' '.join([cxxflags,"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0"]) - if cxxflags: - cfg.write(cmake_cache_entry("CMAKE_CXX_FLAGS", cxxflags)) - - # TODO (bernede1@llnl.gov): Is this useful for RAJA? - if ("gfortran" in f_compiler) and ("clang" in cpp_compiler): - libdir = pjoin(os.path.dirname( - os.path.dirname(f_compiler)), "lib") - flags = "" - for _libpath in [libdir, libdir + "64"]: - if os.path.exists(_libpath): - flags += " -Wl,-rpath,{0}".format(_libpath) - description = ("Adds a missing libstdc++ rpath") - #if flags: - # cfg.write(cmake_cache_string("BLT_EXE_LINKER_FLAGS", flags, - # description)) - - gcc_toolchain_regex = re.compile("--gcc-toolchain=(.*)") - gcc_name_regex = re.compile(".*gcc-name.*") - - using_toolchain = list(filter(gcc_toolchain_regex.match, spec.compiler_flags['cxxflags'])) - if(using_toolchain): - gcc_toolchain_path = gcc_toolchain_regex.match(using_toolchain[0]) - using_gcc_name = list(filter(gcc_name_regex.match, spec.compiler_flags['cxxflags'])) - compilers_using_toolchain = ["pgi", "xl", "icpc"] - if any(compiler in cpp_compiler for compiler in compilers_using_toolchain): - if using_toolchain or using_gcc_name: - cfg.write(cmake_cache_entry("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) - - compilers_using_cxx14 = ["intel-17", "intel-18", "xl"] - if any(compiler in cpp_compiler for compiler in compilers_using_cxx14): - cfg.write(cmake_cache_entry("BLT_CXX_STD", "c++14")) + entries.append(cmake_cache_option("ENABLE_OPENMP", "+openmp" in spec)) if "+cuda" in spec: - cfg.write("#------------------{0}\n".format("-" * 60)) - cfg.write("# Cuda\n") - cfg.write("#------------------{0}\n\n".format("-" * 60)) - - cfg.write(cmake_cache_option("ENABLE_CUDA", True)) - - cudatoolkitdir = spec['cuda'].prefix - cfg.write(cmake_cache_entry("CUDA_TOOLKIT_ROOT_DIR", - cudatoolkitdir)) - cudacompiler = "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" - cfg.write(cmake_cache_entry("CMAKE_CUDA_COMPILER", - cudacompiler)) - - if ("xl" in cpp_compiler): - cfg.write(cmake_cache_entry("CMAKE_CUDA_FLAGS", "-Xcompiler -O3 -Xcompiler -qxlcompatmacros -Xcompiler -qalias=noansi " + - "-Xcompiler -qsmp=omp -Xcompiler -qhot -Xcompiler -qnoeh -Xcompiler -qsuppress=1500-029 " + - "-Xcompiler -qsuppress=1500-036 -Xcompiler -qsuppress=1500-030")) - cuda_release_flags = "-O3" - cuda_reldebinf_flags = "-O3 -g" - cuda_debug_flags = "-O0 -g" - - cfg.write(cmake_cache_string("BLT_CXX_STD", "c++14")) - elif ("gcc" in cpp_compiler): - cuda_release_flags = "-O3 -Xcompiler -Ofast -Xcompiler -finline-functions -Xcompiler -finline-limit=20000" - cuda_reldebinf_flags = "-O3 -g -Xcompiler -Ofast -Xcompiler -finline-functions -Xcompiler -finline-limit=20000" - cuda_debug_flags = "-O0 -g -Xcompiler -O0 -Xcompiler -finline-functions -Xcompiler -finline-limit=20000" - else: - cuda_release_flags = "-O3 -Xcompiler -Ofast -Xcompiler -finline-functions" - cuda_reldebinf_flags = "-O3 -g -Xcompiler -Ofast -Xcompiler -finline-functions" - cuda_debug_flags = "-O0 -g -Xcompiler -O0 -Xcompiler -finline-functions" - - cfg.write(cmake_cache_string("CMAKE_CUDA_FLAGS_RELEASE", cuda_release_flags)) - cfg.write(cmake_cache_string("CMAKE_CUDA_FLAGS_RELWITHDEBINFO", cuda_reldebinf_flags)) - cfg.write(cmake_cache_string("CMAKE_CUDA_FLAGS_DEBUG", cuda_debug_flags)) - - if not spec.satisfies('cuda_arch=none'): - cuda_arch = spec.variants['cuda_arch'].value - cfg.write(cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", '{0}'.format(cuda_arch[0]))) + entries.append(cmake_cache_option("ENABLE_CUDA", True)) + if not spec.satisfies("cuda_arch=none"): + cuda_arch = spec.variants["cuda_arch"].value + entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) + entries.append( + cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) + ) else: - cfg.write(cmake_cache_option("ENABLE_CUDA", False)) + entries.append(cmake_cache_option("ENABLE_CUDA", False)) if "+rocm" in spec: - cfg.write("#------------------{0}\n".format("-" * 60)) - cfg.write("# HIP\n") - cfg.write("#------------------{0}\n\n".format("-" * 60)) - - cfg.write(cmake_cache_option("ENABLE_HIP", True)) - - hip_root = spec['hip'].prefix - rocm_root = hip_root + "/.." - hip_arch = spec.variants['amdgpu_target'].value - cfg.write(cmake_cache_entry("HIP_ROOT_DIR", - hip_root)) - # there is only one dir like this, but the version component is unknown - cfg.write( - cmake_cache_path( - "HIP_CLANG_INCLUDE_PATH", - glob.glob( - "{}/lib/clang/*/include".format(spec['llvm-amdgpu'].prefix) - )[0] + entries.append(cmake_cache_option("ENABLE_HIP", True)) + entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) + hip_repair_cache(entries, spec) + archs = self.spec.variants["amdgpu_target"].value + if archs != "none": + arch_str = ",".join(archs) + entries.append( + cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) + ) + entries.append( + cmake_cache_string("CMAKE_HIP_ARCHITECTURES", arch_str) ) - ) - cfg.write(cmake_cache_entry("ROCM_ROOT_DIR", - rocm_root)) - cfg.write(cmake_cache_entry("HIP_PATH", - rocm_root + '/llvm/bin')) - cfg.write(cmake_cache_entry("CMAKE_HIP_ARCHITECTURES", hip_arch[0])) - - if ('%gcc' in spec) or (using_toolchain): - if ('%gcc' in spec): - gcc_bin = os.path.dirname(self.compiler.cxx) - gcc_prefix = join_path(gcc_bin, '..') - else: - gcc_prefix = gcc_toolchain_path.group(1) - cfg.write(cmake_cache_entry("HIP_CLANG_FLAGS", - "--gcc-toolchain={0}".format(gcc_prefix))) - cfg.write(cmake_cache_entry("CMAKE_EXE_LINKER_FLAGS", - " -Wl,-rpath {}/lib64".format(gcc_prefix))) - else: - cfg.write(cmake_cache_option("ENABLE_HIP", False)) + entries.append(cmake_cache_option("ENABLE_HIP", False)) - cfg.write("#------------------{0}\n".format("-" * 60)) - cfg.write("# Other\n") - cfg.write("#------------------{0}\n\n".format("-" * 60)) + return entries + + def initconfig_package_entries(self): + spec = self.spec + entries = [] - cfg.write(cmake_cache_string("RAJA_RANGE_ALIGN", "4")) - cfg.write(cmake_cache_string("RAJA_RANGE_MIN_LENGTH", "32")) - cfg.write(cmake_cache_string("RAJA_DATA_ALIGN", "64")) + option_prefix = "RAJA_" if spec.satisfies("@0.14.0:") else "" - cfg.write(cmake_cache_option("RAJA_HOST_CONFIG_LOADED", True)) + entries.append(cmake_cache_option("RAJA_ENABLE_DESUL_ATOMICS", "+desul" in spec)) - # shared vs static libs - cfg.write(cmake_cache_option("BUILD_SHARED_LIBS","+shared" in spec)) - cfg.write(cmake_cache_option("ENABLE_OPENMP","+openmp" in spec)) - cfg.write(cmake_cache_option("RAJA_ENABLE_DESUL_ATOMICS","+desul" in spec)) + # use global spack compiler flags + cflags = " ".join(spec.compiler_flags["cflags"]) + if "+libcpp" in spec: + cflags += " ".join([cflags,"-DGTEST_HAS_CXXABI_H_=0"]) + if cflags: + entries.append(cmake_cache_string("CMAKE_C_FLAGS", cflags)) + + cxxflags = " ".join(spec.compiler_flags["cxxflags"]) + if "+libcpp" in spec: + cxxflags += " ".join([cxxflags,"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0"]) + if cxxflags: + entries.append(cmake_cache_string("CMAKE_CXX_FLAGS", cxxflags)) if "+desul" in spec: - cfg.write(cmake_cache_string("BLT_CXX_STD","c++14")) + entries.append(cmake_cache_string("BLT_CXX_STD","c++14")) if "+cuda" in spec: - cfg.write(cmake_cache_string("CMAKE_CUDA_STANDARD", "14")) - - cfg.write(cmake_cache_option("ENABLE_BENCHMARKS", 'tests=benchmarks' in spec)) - cfg.write(cmake_cache_option("ENABLE_TESTS", not 'tests=none' in spec or self.run_tests)) - cfg.write(cmake_cache_string("camp_DIR", spec['camp'].prefix)) + entries.append(cmake_cache_string("CMAKE_CUDA_STANDARD", "14")) + + entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) + if "camp" in self.spec: + entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) + entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) + entries.append( + cmake_cache_option("{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec) + ) + if spec.satisfies("@0.14.0:"): + entries.append( + cmake_cache_option( + "{}ENABLE_EXERCISES".format(option_prefix), "+exercises" in spec + ) + ) + else: + entries.append(cmake_cache_option("ENABLE_EXERCISES", "+exercises" in spec)) + + ### #TODO: Treat the workaround when building tests with spack wrapper + ### # For now, removing it to test CI, which builds tests outside of wrapper. + ### # Work around spack adding -march=ppc64le to SPACK_TARGET_ARGS which + ### # is used by the spack compiler wrapper. This can go away when BLT + ### # removes -Werror from GTest flags + ### if self.spec.satisfies("%clang target=ppc64le:") or ( not self.run_tests and not "+tests" in spec): + if not self.run_tests and not "+tests" in spec: + entries.append(cmake_cache_option("ENABLE_TESTS", False)) + else: + entries.append(cmake_cache_option("ENABLE_TESTS", True)) - ####################### - # Close and save - ####################### - cfg.write("\n") - cfg.close() + entries.append(cmake_cache_option("RAJA_HOST_CONFIG_LOADED", True)) - print("OUT: host-config file {0}".format(host_config_path)) + return entries def cmake_args(self): - spec = self.spec - host_config_path = self._get_host_config_path(spec) - options = [] - options.extend(['-C', host_config_path]) - return options + + @property + def build_relpath(self): + """Relative path to the cmake build subdirectory.""" + return join_path("..", self.build_dirname) + + @run_after("install") + def setup_build_tests(self): + """Copy the build test files after the package is installed to a + relative install test subdirectory for use during `spack test run`.""" + # Now copy the relative files + self.cache_extra_test_sources(self.build_relpath) + + # Ensure the path exists since relying on a relative path at the + # same level as the normal stage source path. + mkdirp(self.install_test_root) + + @property + def _extra_tests_path(self): + # TODO: The tests should be converted to re-build and run examples + # TODO: using the installed libraries. + return join_path(self.install_test_root, self.build_relpath, "bin") + + def _test_examples(self): + """Perform very basic checks on a subset of copied examples.""" + checks = [ + ( + "ex5_line-of-sight_solution", + [r"RAJA sequential", r"RAJA OpenMP", r"result -- PASS"], + ), + ( + "ex6_stencil-offset-layout_solution", + [r"RAJA Views \(permuted\)", r"result -- PASS"], + ), + ( + "ex8_tiled-matrix-transpose_solution", + [r"parallel top inner loop", r"collapsed inner loops", r"result -- PASS"], + ), + ("kernel-dynamic-tile", [r"Running index", r"(24,24)"]), + ("plugin-example", [r"Launching host kernel for the 10 time"]), + ("tut_batched-matrix-multiply", [r"result -- PASS"]), + ("wave-eqn", [r"Max Error = 2", r"Evolved solution to time"]), + ] + for exe, expected in checks: + reason = "test: checking output of {0} for {1}".format(exe, expected) + self.run_test( + exe, + [], + expected, + installed=False, + purpose=reason, + skip_missing=True, + work_dir=self._extra_tests_path, + ) + + def test(self): + """Perform smoke tests.""" + self._test_examples() diff --git a/scripts/spack_packages/umpire/cmake_version_check.patch b/scripts/spack_packages/umpire/cmake_version_check.patch new file mode 100644 index 00000000..05f80e0b --- /dev/null +++ b/scripts/spack_packages/umpire/cmake_version_check.patch @@ -0,0 +1,13 @@ +diff --git a/src/umpire/CMakeLists.txt b/src/umpire/CMakeLists.txt +index 18518f13..c2e45e03 100644 +--- a/src/umpire/CMakeLists.txt ++++ b/src/umpire/CMakeLists.txt +@@ -105,7 +105,7 @@ blt_add_library( + DEPENDS_ON ${umpire_depends} + DEFINES ${umpire_defines}) + +-if (NOT WIN32 AND CMAKE_VERSION VERSION_GREATER 3.17) ++if (NOT WIN32 AND NOT ${CMAKE_VERSION} VERSION_LESS 3.18) + target_link_options( + umpire INTERFACE + $>:-rdynamic>> diff --git a/scripts/spack_packages/umpire/missing_header_for_numeric_limits.patch b/scripts/spack_packages/umpire/missing_header_for_numeric_limits.patch new file mode 100644 index 00000000..6e89e370 --- /dev/null +++ b/scripts/spack_packages/umpire/missing_header_for_numeric_limits.patch @@ -0,0 +1,12 @@ +diff --git a/src/umpire/util/allocation_statistics.cpp b/src/umpire/util/allocation_statistics.cpp +index 597ae61f..0c3f7865 100644 +--- a/src/umpire/util/allocation_statistics.cpp ++++ b/src/umpire/util/allocation_statistics.cpp +@@ -8,6 +8,7 @@ + #include "umpire/util/allocation_statistics.hpp" + + #include ++#include + + namespace umpire { + namespace util { diff --git a/scripts/spack_packages/umpire/package.py b/scripts/spack_packages/umpire/package.py index 49fe704f..7dacbb65 100644 --- a/scripts/spack_packages/umpire/package.py +++ b/scripts/spack_packages/umpire/package.py @@ -2,15 +2,14 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import glob -from spack import * - -import socket import os +import socket -from os import environ as env -from os.path import join as pjoin +import llnl.util.tty as tty + +from spack.package import * +from spack.pkg.builtin.camp import hip_repair_cache import re @@ -19,99 +18,148 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): """An application-focused API for memory management on NUMA & GPU architectures""" - homepage = 'https://github.com/LLNL/Umpire' - git = 'https://github.com/LLNL/Umpire.git' - - version('develop', branch='develop', submodules='True') - version('main', branch='main', submodules='True') - version('2022.10.0', tag='v2022.10.0', submodules=True) - version('2022.03.0', tag='v2022.03.0', submodules=True) - version('6.0.0', tag='v6.0.0', submodules=True) - version('5.0.1', tag='v5.0.1', submodules=True) - version('5.0.0', tag='v5.0.0', submodules=True) - version('4.1.2', tag='v4.1.2', submodules=True) - version('4.1.1', tag='v4.1.1', submodules=True) - version('4.1.0', tag='v4.1.0', submodules=True) - version('3.0.0', tag='v3.0.0', submodules='True') - version('2.1.0', tag='v2.1.0', submodules='True') - version('2.0.0', tag='v2.0.0', submodules='True') - version('1.1.0', tag='v1.1.0', submodules='True') - version('1.0.1', tag='v1.0.1', submodules='True') - version('1.0.0', tag='v1.0.0', submodules='True') - version('0.3.5', tag='v0.3.5', submodules='True') - version('0.3.4', tag='v0.3.4', submodules='True') - version('0.3.3', tag='v0.3.3', submodules='True') - version('0.3.2', tag='v0.3.2', submodules='True') - version('0.3.1', tag='v0.3.1', submodules='True') - version('0.3.0', tag='v0.3.0', submodules='True') - version('0.2.4', tag='v0.2.4', submodules='True') - version('0.2.3', tag='v0.2.3', submodules='True') - version('0.2.2', tag='v0.2.2', submodules='True') - version('0.2.1', tag='v0.2.1', submodules='True') - version('0.2.0', tag='v0.2.0', submodules='True') - version('0.1.4', tag='v0.1.4', submodules='True') - version('0.1.3', tag='v0.1.3', submodules='True') - - patch('camp_target_umpire_3.0.0.patch', when='@3.0.0') - - variant('fortran', default=False, description='Build C/Fortran API') - variant('c', default=True, description='Build C API') - variant('mpi', default=False, description='Enable MPI support') - variant('ipc_shmem', default=False, description='Enable POSIX shared memory') - variant('sqlite_experimental', default=False, description='Enable sqlite integration with umpire events (Experimental)') - variant('numa', default=False, description='Enable NUMA support') - variant('shared', default=False, description='Enable Shared libs') - variant('openmp', default=False, description='Build with OpenMP support') - variant('openmp_target', default=False, description='Build with OpenMP 4.5 support') - variant('deviceconst', default=False, - description='Enables support for constant device memory') - variant('tests', default='basic', values=('none', 'basic', 'benchmarks'), - multi=False, description='Tests to run') - - variant('libcpp', default=False, description='Uses libc++ instead of libstdc++') - variant('tools', default=True, description='Enable tools') - variant('backtrace', default=False, description='Enable backtrace tools') - variant('dev_benchmarks', default=False, description='Enable Developer Benchmarks') - variant('device_alloc', default=False, description='Enable the DeviceAllocator') - variant('werror', default=True, description='Enable warnings as errors') - variant('asan', default=False, description='Enable ASAN') - variant('sanitizer_tests', default=False, description='Enable address sanitizer tests') - - depends_on('cmake@3.14:', type='build') + homepage = "https://github.com/LLNL/Umpire" + git = "https://github.com/LLNL/Umpire.git" + tags = ["radiuss", "e4s"] + + maintainers = ["davidbeckingsale"] + + version("develop", branch="develop", submodules=False) + version("main", branch="main", submodules=False) + version("2022.10.0", tag="v2022.10.0", submodules=False) + version("2022.03.1", tag="v2022.03.1", submodules=False) + version("2022.03.0", tag="v2022.03.0", submodules=False) + version("6.0.0", tag="v6.0.0", submodules=True) + version("5.0.1", tag="v5.0.1", submodules=True) + version("5.0.0", tag="v5.0.0", submodules=True) + version("4.1.2", tag="v4.1.2", submodules=True) + version("4.1.1", tag="v4.1.1", submodules=True) + version("4.1.0", tag="v4.1.0", submodules=True) + version("4.0.1", tag="v4.0.1", submodules=True) + version("4.0.0", tag="v4.0.0", submodules=True) + version("3.0.0", tag="v3.0.0", submodules=True) + version("2.1.0", tag="v2.1.0", submodules=True) + version("2.0.0", tag="v2.0.0", submodules=True) + version("1.1.0", tag="v1.1.0", submodules=True) + version("1.0.1", tag="v1.0.1", submodules=True) + version("1.0.0", tag="v1.0.0", submodules=True) + version("0.3.5", tag="v0.3.5", submodules=True) + version("0.3.4", tag="v0.3.4", submodules=True) + version("0.3.3", tag="v0.3.3", submodules=True) + version("0.3.2", tag="v0.3.2", submodules=True) + version("0.3.1", tag="v0.3.1", submodules=True) + version("0.3.0", tag="v0.3.0", submodules=True) + version("0.2.4", tag="v0.2.4", submodules=True) + version("0.2.3", tag="v0.2.3", submodules=True) + version("0.2.2", tag="v0.2.2", submodules=True) + version("0.2.1", tag="v0.2.1", submodules=True) + version("0.2.0", tag="v0.2.0", submodules=True) + version("0.1.4", tag="v0.1.4", submodules=True) + version("0.1.3", tag="v0.1.3", submodules=True) + + patch("std-filesystem-pr784.patch", when="@2022.03.1 +rocm ^blt@0.5.2:") + patch("camp_target_umpire_3.0.0.patch", when="@3.0.0") + patch("cmake_version_check.patch", when="@4.1") + patch("missing_header_for_numeric_limits.patch", when="@4.1:5.0.1") + + # export targets when building pre-6.0.0 release with BLT 0.4.0+ + patch( + "https://github.com/LLNL/Umpire/commit/5773ce9af88952c8d23f9bcdcb2e503ceda40763.patch?full_index=1", + sha256="f3b21335ce5cf9c0fecc852a94dfec90fb5703032ac97f9fee104af9408d8899", + when="@:5.0.1 ^blt@0.4:", + ) + + variant("fortran", default=False, description="Build C/Fortran API") + variant("c", default=True, description="Build C API") + variant("mpi", default=False, description="Enable MPI support") + variant("ipc_shmem", default=False, description="Enable POSIX shared memory") + variant("sqlite_experimental", default=False, description="Enable sqlite integration with umpire events (Experimental)") + variant("numa", default=False, description="Enable NUMA support") + variant("shared", default=True, description="Enable Shared libs") + variant("openmp", default=False, description="Build with OpenMP support") + variant("openmp_target", default=False, description="Build with OpenMP 4.5 support") + variant("deviceconst", default=False, description="Enables support for constant device memory") + variant("examples", default=True, description="Build Umpire Examples") + variant( + "tests", + default="none", + values=("none", "basic", "benchmarks"), + multi=False, + description="Tests to run", + ) + variant("libcpp", default=False, description="Uses libc++ instead of libstdc++") + variant("tools", default=True, description="Enable tools") + variant("backtrace", default=False, description="Enable backtrace tools") + variant("dev_benchmarks", default=False, description="Enable Developer Benchmarks") + variant("device_alloc", default=True, description="Enable DeviceAllocator") + variant("werror", default=True, description="Enable warnings as errors") + variant("asan", default=False, description="Enable ASAN") + variant("sanitizer_tests", default=False, description="Enable address sanitizer tests") + + depends_on("cmake@3.8:", type="build") + depends_on("cmake@3.9:", when="+cuda", type="build") + depends_on("cmake@:3.20", when="+rocm", type="build") + depends_on("cmake@3.14:", when="@2022.03.0:") + + depends_on("blt@0.5.2:", type="build", when="@2022.10.0:") + depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") + depends_on("blt@0.4.1", type="build", when="@6.0.0") + depends_on("blt@0.4.0:", type="build", when="@4.1.3:5.0.1") + depends_on("blt@0.3.6:", type="build", when="@:4.1.2") + + depends_on("camp", when="@5.0.0:") + depends_on("camp@0.2.2:0.2.3", when="@6.0.0") + depends_on("camp@0.1.0", when="@5.0.0:5.0.1") + depends_on("camp@2022.03.2:", when="@2022.03.0:") + depends_on("camp@2022.10.0:", when="@2022.10.0:") + depends_on("camp@main", when="@main") + depends_on("camp@main", when="@develop") + depends_on("camp+openmp", when="+openmp") + depends_on('sqlite', when='+sqlite_experimental') depends_on('mpi', when='+mpi') - depends_on('blt@0.5.0', type='build', when='@main') - depends_on('blt@0.5.0:', type='build') + with when("@5.0.0:"): + with when("+cuda"): + depends_on("camp+cuda") + for sm_ in CudaPackage.cuda_arch_values: + depends_on("camp+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - # variants +rocm and amdgpu_targets are not automatically passed to - # dependencies, so do it manually. - depends_on('camp+rocm', when='+rocm') - for val in ROCmPackage.amdgpu_targets: - depends_on('camp amdgpu_target=%s' % val, when='amdgpu_target=%s' % val) + with when("+rocm"): + depends_on("camp+rocm") + for arch_ in ROCmPackage.amdgpu_targets: + depends_on( + "camp+rocm amdgpu_target={0}".format(arch_), + when="amdgpu_target={0}".format(arch_), + ) - depends_on('camp+cuda', when='+cuda') - for sm_ in CudaPackage.cuda_arch_values: - depends_on('camp cuda_arch={0}'.format(sm_), - when='cuda_arch={0}'.format(sm_)) + conflicts("+numa", when="@:0.3.2") + conflicts("~c", when="+fortran", msg="Fortran API requires C API") - depends_on('camp@main') + conflicts("+device_alloc", when="@:2022.03.0") + conflicts('+deviceconst', when='~rocm~cuda') + conflicts('+device_alloc', when='~rocm~cuda') - conflicts('+numa', when='@:0.3.2') - conflicts('~c', when='+fortran', msg='Fortran API requires C API') conflicts('~openmp', when='+openmp_target', msg='OpenMP target requires OpenMP') conflicts('+cuda', when='+rocm') conflicts('+rocm', when='+openmp_target', msg='Cant support both rocm and openmp device backends at once') - conflicts('+deviceconst', when='~rocm~cuda') - conflicts('+device_alloc', when='~rocm~cuda') conflicts('~mpi', when='+ipc_shmem', msg='Shared Memory Allocator requires MPI') conflicts('+ipc_shmem', when='@:5.0.1') + conflicts('+sqlite_experimental', when='@:6.0.0') conflicts('+sanitizer_tests', when='~asan') + # device allocator exports device code, which requires static libs + # currently only available for cuda. + conflicts("+shared", when="+cuda") + + # https://github.com/LLNL/Umpire/issues/653 + # This range looks weird, but it ensures the concretizer looks at it as a + # range, not as a concrete version, so that it also matches 10.3.* versions. + conflicts("%gcc@10.3.0:10.3", when="+cuda") + def _get_sys_type(self, spec): - sys_type = str(spec.architecture) - # if on llnl systems, we can use the SYS_TYPE + sys_type = spec.architecture if "SYS_TYPE" in env: sys_type = env["SYS_TYPE"] return sys_type @@ -120,42 +168,48 @@ def _get_sys_type(self, spec): def cache_name(self): hostname = socket.gethostname() if "SYS_TYPE" in env: - hostname = hostname.rstrip('1234567890') + hostname = hostname.rstrip("1234567890") return "{0}-{1}-{2}@{3}.cmake".format( hostname, self._get_sys_type(self.spec), self.spec.compiler.name, - self.spec.compiler.version + self.spec.compiler.version, ) def spec_uses_toolchain(self, spec): gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") using_toolchain = list(filter(gcc_toolchain_regex.match, spec.compiler_flags['cxxflags'])) - return using_toolchain def spec_uses_gccname(self, spec): gcc_name_regex = re.compile(".*gcc-name.*") using_gcc_name = list(filter(gcc_name_regex.match, spec.compiler_flags['cxxflags'])) - return using_gcc_name - - def initconfig_compiler_entries(self): spec = self.spec entries = super(Umpire, self).initconfig_compiler_entries() - entries.append(cmake_cache_option("ENABLE_FORTRAN", - ('+fortran' in spec) and (self.compiler.fc is not None))) - entries.append(cmake_cache_option("UMPIRE_ENABLE_C", '+c' in spec)) - + ### TODO: This was only in Spack ustream, only needed for older versions ? + #if "+rocm" in spec: + # entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) + + option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" + + if "+fortran" in spec and self.compiler.fc is not None: + entries.append(cmake_cache_option("ENABLE_FORTRAN", True)) + else: + entries.append(cmake_cache_option("ENABLE_FORTRAN", False)) + + entries.append(cmake_cache_option("{}ENABLE_C".format(option_prefix), "+c" in spec)) + + ### From local package: fortran_compilers = ["gfortran", "xlf"] if any(compiler in self.compiler.fc for compiler in fortran_compilers) and ("clang" in self.compiler.cxx): entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) - libdir = pjoin(os.path.dirname( + libdir = os.path.join(os.path.dirname( os.path.dirname(self.compiler.fc)), "lib") flags = "" for _libpath in [libdir, libdir + "64"]: @@ -173,56 +227,74 @@ def initconfig_compiler_entries(self): "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) entries = [x for x in entries if not 'COMPILER_ID' in x] - return entries + return entries def initconfig_hardware_entries(self): spec = self.spec entries = super(Umpire, self).initconfig_hardware_entries() - entries.append(cmake_cache_option("ENABLE_CUDA", "+cuda" in spec)) + option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" + if "+cuda" in spec: + entries.append(cmake_cache_option("ENABLE_CUDA", True)) + cuda_flags = [] - if not spec.satisfies('cuda_arch=none'): - cuda_arch = spec.variants['cuda_arch'].value - cuda_flags.append('-arch sm_{0}'.format(cuda_arch[0])) + if not spec.satisfies("cuda_arch=none"): + cuda_arch = spec.variants["cuda_arch"].value + entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) + entries.append( + cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) + ) + cuda_flags.append("-arch sm_{0}".format(cuda_arch[0])) if self.spec_uses_toolchain(self.spec): cuda_flags.append("-Xcompiler {}".format(self.spec_uses_toolchain(self.spec)[0])) - if (spec.satisfies('%gcc@8.1: target=ppc64le')): - cuda_flags.append('-Xcompiler -mno-float128') + if (spec.satisfies("%gcc@8.1: target=ppc64le")): + cuda_flags.append("-Xcompiler -mno-float128") + + entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", " ".join(cuda_flags))) - entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", ' '.join(cuda_flags))) + entries.append( + cmake_cache_option( + "{}ENABLE_DEVICE_CONST".format(option_prefix), spec.satisfies("+deviceconst") + ) + ) + else: + entries.append(cmake_cache_option("ENABLE_CUDA", False)) - entries.append(cmake_cache_option("ENABLE_HIP", "+rocm" in spec)) if "+rocm" in spec: - hip_root = spec['hip'].prefix + entries.append(cmake_cache_option("ENABLE_HIP", True)) + + hip_root = spec["hip"].prefix rocm_root = hip_root + "/.." - hip_arch = spec.variants['amdgpu_target'].value - entries.append(cmake_cache_path("HIP_ROOT_DIR", - hip_root)) - entries.append(cmake_cache_path("ROCM_ROOT_DIR", - rocm_root)) - entries.append(cmake_cache_string("CMAKE_HIP_ARCHITECTURES", - hip_arch[0])) + hip_arch = spec.variants["amdgpu_target"].value + entries.append(cmake_cache_path("HIP_ROOT_DIR", hip_root)) + entries.append(cmake_cache_path("ROCM_ROOT_DIR", rocm_root)) + entries.append(cmake_cache_string("CMAKE_HIP_ARCHITECTURES", hip_arch[0])) entries.append(cmake_cache_option("UMPIRE_ENABLE_TOOLS", False)) - # there is only one dir like this, but the version component is unknown - entries.append( - cmake_cache_path("HIP_CLANG_INCLUDE_PATH", glob.glob( - "{}/lib/clang/*/include".format(spec['llvm-amdgpu'].prefix) - )[0]) - ) + hip_repair_cache(entries, spec) + hip_link_flags = "" - if '%gcc' in spec: + if "%gcc" in spec: gcc_bin = os.path.dirname(self.compiler.cxx) - gcc_prefix = join_path(gcc_bin, '..') - entries.append(cmake_cache_string("HIP_CLANG_FLAGS", "--gcc-toolchain={0}".format(gcc_prefix))) + gcc_prefix = join_path(gcc_bin, "..") + entries.append(cmake_cache_string("HIP_CLANG_FLAGS", "--gcc-toolchain={0}".format(gcc_prefix))) entries.append(cmake_cache_string("CMAKE_EXE_LINKER_FLAGS", hip_link_flags + " -Wl,-rpath {}/lib64".format(gcc_prefix))) else: entries.append(cmake_cache_string("CMAKE_EXE_LINKER_FLAGS", "-Wl,-rpath={0}/llvm/lib/".format(rocm_root))) + archs = self.spec.variants["amdgpu_target"].value + if archs != "none": + arch_str = ",".join(archs) + entries.append( + cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) + ) + else: + entries.append(cmake_cache_option("ENABLE_HIP", False)) + entries.append(cmake_cache_option("UMPIRE_ENABLE_DEVICE_CONST", "+deviceconst" in spec)) entries.append(cmake_cache_option("UMPIRE_ENABLE_OPENMP_TARGET", "+openmp_target" in spec)) @@ -232,7 +304,6 @@ def initconfig_hardware_entries(self): return entries - def initconfig_mpi_entries(self): spec = self.spec @@ -241,35 +312,97 @@ def initconfig_mpi_entries(self): return entries - def initconfig_package_entries(self): spec = self.spec entries = [] - entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec['blt'].prefix)) - entries.append(cmake_cache_path("camp_DIR" ,spec['camp'].prefix)) - entries.append(cmake_cache_string("CMAKE_BUILD_TYPE", spec.variants['build_type'].value)) - entries.append(cmake_cache_option("ENABLE_BENCHMARKS", 'tests=benchmarks' in spec or '+dev_benchmarks' in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_DEVELOPER_BENCHMARKS", '+dev_benchmarks' in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_DEVICE_ALLOCATOR", '+device_alloc' in spec)) - entries.append(cmake_cache_option("ENABLE_TESTS", not 'tests=none' in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_TOOLS", '+tools' in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_BACKTRACE", '+backtrace' in spec)) - entries.append(cmake_cache_option("ENABLE_WARNINGS_AS_ERRORS", '+werror' in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_ASAN", '+asan' in spec)) - entries.append(cmake_cache_option("BUILD_SHARED_LIBS", '+shared' in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_SANITIZER_TESTS", '+sanitizer_tests' in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_NUMA", '+numa' in spec)) - entries.append(cmake_cache_option("ENABLE_OPENMP", '+openmp' in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_IPC_SHARED_MEMORY", '+ipc_shmem' in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_SQLITE_EXPERIMENTAL", '+sqlite_experimental' in spec)) + option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" + + # TPL locations + entries.append("#------------------{0}".format("-" * 60)) + entries.append("# TPLs") + entries.append("#------------------{0}\n".format("-" * 60)) + + entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) + if spec.satisfies("@5.0.0:"): + entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) + + entries.append(cmake_cache_option( + "{}ENABLE_NUMA".format(option_prefix), "+numa" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_OPENMP".format(option_prefix), "+openmp" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_BENCHMARKS".format(option_prefix), "tests=benchmarks" in spec or "+dev_benchmarks" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_DOCS".format(option_prefix), False)) + entries.append(cmake_cache_option( + "{}ENABLE_DEVICE_ALLOCATOR".format(option_prefix), "+device_alloc" in spec)) + entries.append(cmake_cache_option( + "BUILD_SHARED_LIBS", "+shared" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_TESTS".format(option_prefix), "tests=none" not in spec)) + + entries.append(cmake_cache_string( + "CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) + entries.append(cmake_cache_option( + "{}ENABLE_DEVELOPER_BENCHMARKS".format(option_prefix), "+dev_benchmarks" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_TOOLS".format(option_prefix), "+tools" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_BACKTRACE".format(option_prefix), "+backtrace" in spec)) + entries.append(cmake_cache_option( + "ENABLE_WARNINGS_AS_ERRORS", "+werror" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_ASAN".format(option_prefix), "+asan" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_SANITIZER_TESTS".format(option_prefix), "+sanitizer_tests" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_IPC_SHARED_MEMORY".format(option_prefix), "+ipc_shmem" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_SQLITE_EXPERIMENTAL".format(option_prefix), "+sqlite_experimental" in spec)) if "+sqlite_experimental" in spec: - entries.append(cmake_cache_path("SQLite3_ROOT" ,spec['sqlite'].prefix)) - - return entries + entries.append(cmake_cache_path( + "SQLite3_ROOT" ,spec['sqlite'].prefix)) + return entries def cmake_args(self): - spec = self.spec options = [] return options + + def test(self): + """Perform stand-alone checks on the installed package.""" + if self.spec.satisfies("@:1") or not os.path.isdir(self.prefix.bin): + tty.info("Skipping: checks not installed in bin for v{0}".format(self.version)) + return + + # Run a subset of examples PROVIDED installed + # tutorials with readily checkable outputs. + checks = { + "malloc": ["99 should be 99"], + "recipe_dynamic_pool_heuristic": ["in the pool", "releas"], + "recipe_no_introspection": ["has allocated", "used"], + "strategy_example": ["Available allocators", "HOST"], + "tut_copy": ["Copied source data"], + "tut_introspection": ["Allocator used is HOST", "size of the allocation"], + "tut_memset": ["Set data from HOST"], + "tut_move": ["Moved source data", "HOST"], + "tut_reallocate": ["Reallocated data"], + "vector_allocator": [""], + } + + for exe in checks: + expected = checks[exe] + reason = "test: checking output from {0}".format(exe) + self.run_test( + exe, + [], + expected, + 0, + installed=False, + purpose=reason, + skip_missing=True, + work_dir=self.prefix.bin, + ) diff --git a/scripts/spack_packages/umpire/std-filesystem-pr784.patch b/scripts/spack_packages/umpire/std-filesystem-pr784.patch new file mode 100644 index 00000000..67714421 --- /dev/null +++ b/scripts/spack_packages/umpire/std-filesystem-pr784.patch @@ -0,0 +1,33 @@ +diff -ruN spack-src/cmake/SetupCompilerFlags.cmake spack-src-patched/cmake/SetupCompilerFlags.cmake +--- spack-src/cmake/SetupCompilerFlags.cmake 2022-10-12 08:05:03.538390165 -0700 ++++ spack-src-patched/cmake/SetupCompilerFlags.cmake 2022-10-12 09:47:56.317645003 -0700 +@@ -11,20 +11,20 @@ + + message(STATUS "Checking for std::filesystem") + +-include(CheckCXXSourceCompiles) +-check_cxx_source_compiles( +- "#include +- #include +- +- int main(int, char**) +- { ++blt_check_code_compiles(CODE_COMPILES UMPIRE_ENABLE_FILESYSTEM ++ SOURCE_STRING ++[=[ ++#include ++#include + ++int main(int, char**) ++{ + auto path = std::filesystem::path(\".\"); + (void)(path); + + return 0; +- }" +- UMPIRE_ENABLE_FILESYSTEM) ++} ++]=]) + + if (UMPIRE_ENABLE_FILESYSTEM) + message(STATUS "std::filesystem found") From a699dc0bcac618567828517139d665f5ea30e424 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 10 Nov 2022 15:30:36 +0100 Subject: [PATCH 04/63] WIP revamp local CHAI package --- .gitlab/custom-jobs-and-variables.yml | 6 +- scripts/spack_packages/chai/package.py | 459 ++++++++++++------------- 2 files changed, 218 insertions(+), 247 deletions(-) diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml index e5eda30a..2a053413 100644 --- a/.gitlab/custom-jobs-and-variables.yml +++ b/.gitlab/custom-jobs-and-variables.yml @@ -19,7 +19,7 @@ variables: # Arguments for job level allocation RUBY_BUILD_AND_TEST_JOB_ALLOC: "--overlap --time=20 --nodes=1" # Project specific variants for ruby - PROJECT_RUBY_VARIANTS: "" + PROJECT_RUBY_VARIANTS: "~shared +raja tests=basic " # Project specific deps for ruby PROJECT_RUBY_DEPS: "" @@ -29,7 +29,7 @@ variables: # Arguments for job level allocation CORONA_BUILD_AND_TEST_JOB_ALLOC: "--time-limit=30m --nodes=1" # Project specific variants for corona - PROJECT_CORONA_VARIANTS: "" + PROJECT_CORONA_VARIANTS: "~shared +raja tests=basic " # Project specific deps for corona PROJECT_CORONA_DEPS: "" @@ -38,7 +38,7 @@ variables: # Arguments for job level allocation LASSEN_BUILD_AND_TEST_JOB_ALLOC: "1 -W 120" # Project specific variants for lassen - PROJECT_LASSEN_VARIANTS: "" + PROJECT_LASSEN_VARIANTS: "~shared +raja tests=basic " # Project specific deps for lassen PROJECT_LASSEN_DEPS: "" diff --git a/scripts/spack_packages/chai/package.py b/scripts/spack_packages/chai/package.py index cd6d7b8a..2262a782 100644 --- a/scripts/spack_packages/chai/package.py +++ b/scripts/spack_packages/chai/package.py @@ -1,288 +1,259 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - -import socket import os +import socket -from os import environ as env -from os.path import join as pjoin +from spack.package import * +from spack.pkg.builtin.camp import hip_repair_cache import re -def cmake_cache_entry(name, value, comment=""): - """Generate a string for a cmake cache variable""" - - return 'set(%s "%s" CACHE PATH "%s")\n\n' % (name,value,comment) - - -def cmake_cache_string(name, string, comment=""): - """Generate a string for a cmake cache variable""" - - return 'set(%s "%s" CACHE STRING "%s")\n\n' % (name,string,comment) - - -def cmake_cache_option(name, boolean_value, comment=""): - """Generate a string for a cmake configuration option""" - - value = "ON" if boolean_value else "OFF" - return 'set(%s %s CACHE BOOL "%s")\n\n' % (name,value,comment) - - -def get_spec_path(spec, package_name, path_replacements = {}, use_bin = False) : - """Extracts the prefix path for the given spack package - path_replacements is a dictionary with string replacements for the path. - """ - - if not use_bin: - path = spec[package_name].prefix - else: - path = spec[package_name].prefix.bin - - path = os.path.realpath(path) - - for key in path_replacements: - path = path.replace(key, path_replacements[key]) - return path - - -class Chai(CMakePackage, CudaPackage, ROCmPackage): +class Chai(CachedCMakePackage, CudaPackage, ROCmPackage): """ Copy-hiding array interface for data migration between memory spaces """ homepage = "https://github.com/LLNL/CHAI" - git = "https://github.com/LLNL/CHAI.git" - - version('develop', branch='develop', submodules='True') - version('master', branch='main', submodules='True') - version('2.1.1', tag='v2.1.1', submodules='True') - version('2.1.0', tag='v2.1.0', submodules='True') - version('2.0.0', tag='v2.0.0', submodules='True') - version('1.2.0', tag='v1.2.0', submodules='True') - version('1.1.0', tag='v1.1.0', submodules='True') - version('1.0', tag='v1.0', submodules='True') - - variant('shared', default=False, description='Build Shared Libs') - variant('raja', default=True, description='Build plugin for RAJA') - variant('tests', default='basic', values=('none', 'basic', 'benchmarks'), - multi=False, description='Tests to run') - - depends_on('umpire') - depends_on('raja', when="+raja") - - depends_on('umpire@main', when='@main') - depends_on('raja@main', when="@main+raja") - - depends_on('cmake@3.14:', type='build') - depends_on('umpire+cuda', when="+cuda") - depends_on('raja+cuda', when="+raja+cuda") - - for val in ROCmPackage.amdgpu_targets: - depends_on('raja amdgpu_target=%s' % val, when='amdgpu_target=%s' % val) - depends_on('umpire amdgpu_target=%s' % val, when='amdgpu_target=%s' % val) - - for sm_ in CudaPackage.cuda_arch_values: - depends_on('raja cuda_arch={0}'.format(sm_), - when='cuda_arch={0}'.format(sm_)) - depends_on('umpire cuda_arch={0}'.format(sm_), - when='cuda_arch={0}'.format(sm_)) - - phases = ['hostconfig', 'cmake', 'build', 'install'] + git = "https://github.com/LLNL/CHAI.git" + tags = ["ecp", "e4s", "radiuss"] + + maintainers = ["davidbeckingsale"] + + version("develop", branch="develop", submodules=False) + version("main", branch="main", submodules=False) + version("2022.10.0", tag="v2022.10.0", submodules=False) + version("2022.03.0", tag="v2022.03.0", submodules=False) + version("2.4.0", tag="v2.4.0", submodules=True) + version("2.3.0", tag="v2.3.0", submodules=True) + version("2.2.2", tag="v2.2.2", submodules=True) + version("2.2.1", tag="v2.2.1", submodules=True) + version("2.2.0", tag="v2.2.0", submodules=True) + version("2.1.1", tag="v2.1.1", submodules=True) + version("2.1.0", tag="v2.1.0", submodules=True) + version("2.0.0", tag="v2.0.0", submodules=True) + version("1.2.0", tag="v1.2.0", submodules=True) + version("1.1.0", tag="v1.1.0", submodules=True) + version("1.0", tag="v1.0", submodules=True) + + variant("enable_pick", default=False, description="Enable pick method") + variant("shared", default=True, description="Build Shared Libs") + variant("raja", default=False, description="Build plugin for RAJA") + variant("benchmarks", default=False, description="Build benchmarks.") + variant("examples", default=True, description="Build examples.") + variant("openmp", default=False, description="Build using OpenMP") + # TODO: figure out gtest dependency and then set this default True + # and remove the +tests conflict below. + variant("tests", default="none", values=("none", "basic", "benchmarks"), + multi=False, description="Tests to run") + + depends_on("cmake@3.8:", type="build") + depends_on("cmake@3.9:", type="build", when="+cuda") + depends_on("cmake@3.14:", when="@2022.03.0:") + + depends_on("blt@0.5.2:", type="build", when="@2022.10.0:") + depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") + depends_on("blt@0.4.1:", type="build", when="@2.4.0:") + depends_on("blt@0.4.0:", type="build", when="@2.3.0") + depends_on("blt@0.3.6:", type="build", when="@:2.2.2") + + depends_on("umpire") + depends_on("umpire@2022.10.0:", when="@2022.10.0:") + depends_on("umpire@2022.03.0:", when="@2022.03.0:") + depends_on("umpire@6.0.0", when="@2.4.0") + depends_on("umpire@4.1.2", when="@2.2.0:2.3.0") + depends_on("umpire@main", when="@main") + + with when("+cuda"): + depends_on("umpire+cuda") + for sm_ in CudaPackage.cuda_arch_values: + depends_on("umpire+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) + + with when("+rocm"): + depends_on("umpire+rocm") + for arch in ROCmPackage.amdgpu_targets: + depends_on( + "umpire+rocm amdgpu_target={0}".format(arch), when="amdgpu_target={0}".format(arch) + ) + + with when("+raja"): + depends_on("raja~openmp", when="~openmp") + depends_on("raja+openmp", when="+openmp") + depends_on("raja@0.14.0", when="@2.4.0") + depends_on("raja@0.13.0", when="@2.3.0") + depends_on("raja@0.12.0", when="@2.2.0:2.2.2") + depends_on("raja@2022.03.0:", when="@2022.03.0:") + depends_on("raja@2022.10.0:", when="@2022.10.0:") + depends_on("raja@main", when="@main") + + with when("+cuda"): + depends_on("raja+cuda") + for sm_ in CudaPackage.cuda_arch_values: + depends_on("raja+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) + with when("+rocm"): + depends_on("raja+rocm") + for arch in ROCmPackage.amdgpu_targets: + depends_on( + "raja+rocm amdgpu_target={0}".format(arch), + when="amdgpu_target={0}".format(arch), + ) + + conflicts("+benchmarks", when="~tests") def _get_sys_type(self, spec): - sys_type = str(spec.architecture) - # if on llnl systems, we can use the SYS_TYPE + sys_type = spec.architecture if "SYS_TYPE" in env: sys_type = env["SYS_TYPE"] return sys_type - def _get_host_config_path(self, spec): - var='' - if '+cuda' in spec: - var= '-'.join([var,'cuda']) - - host_config_path = "hc-%s-%s-%s%s-%s.cmake" % (socket.gethostname().rstrip('1234567890'), - self._get_sys_type(spec), - spec.compiler, - var, - spec.dag_hash()) - dest_dir = self.stage.source_path - host_config_path = os.path.abspath(pjoin(dest_dir, host_config_path)) - return host_config_path - - def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): - """ - This method creates a 'host-config' file that specifies - all of the options used to configure and build CHAI. - - For more details about 'host-config' files see: - http://software.llnl.gov/conduit/building.html - - Note: - The `py_site_pkgs_dir` arg exists to allow a package that - subclasses this package provide a specific site packages - dir when calling this function. `py_site_pkgs_dir` should - be an absolute path or `None`. - - This is necessary because the spack `site_packages_dir` - var will not exist in the base class. For more details - on this issue see: https://github.com/spack/spack/issues/6261 - """ - - ####################### - # Compiler Info - ####################### - c_compiler = env["SPACK_CC"] - cpp_compiler = env["SPACK_CXX"] - - # Even though we don't have fortran code in our project we sometimes - # use the Fortran compiler to determine which libstdc++ to use - f_compiler = "" - if "SPACK_FC" in env.keys(): - # even if this is set, it may not exist - # do one more sanity check - if os.path.isfile(env["SPACK_FC"]): - f_compiler = env["SPACK_FC"] - - ####################################################################### - # By directly fetching the names of the actual compilers we appear - # to doing something evil here, but this is necessary to create a - # 'host config' file that works outside of the spack install env. - ####################################################################### - - sys_type = self._get_sys_type(spec) - - ############################################## - # Find and record what CMake is used - ############################################## - - cmake_exe = spec['cmake'].command.path - cmake_exe = os.path.realpath(cmake_exe) - - host_config_path = self._get_host_config_path(spec) - cfg = open(host_config_path, "w") - cfg.write("###################\n".format("#" * 60)) - cfg.write("# Generated host-config - Edit at own risk!\n") - cfg.write("###################\n".format("#" * 60)) - cfg.write("# Copyright (c) 2020, Lawrence Livermore National Security, LLC and\n") - cfg.write("# other CHAI Project Developers. See the top-level LICENSE file for\n") - cfg.write("# details.\n") - cfg.write("#\n") - cfg.write("# SPDX-License-Identifier: (BSD-3-Clause) \n") - cfg.write("###################\n\n".format("#" * 60)) - - cfg.write("#------------------\n".format("-" * 60)) - cfg.write("# SYS_TYPE: {0}\n".format(sys_type)) - cfg.write("# Compiler Spec: {0}\n".format(spec.compiler)) - cfg.write("# CMake executable path: %s\n" % cmake_exe) - cfg.write("#------------------\n\n".format("-" * 60)) - - ####################### - # Compiler Settings - ####################### - - cfg.write("#------------------\n".format("-" * 60)) - cfg.write("# Compilers\n") - cfg.write("#------------------\n\n".format("-" * 60)) - cfg.write(cmake_cache_entry("CMAKE_C_COMPILER", c_compiler)) - cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler)) - - # use global spack compiler flags - cflags = ' '.join(spec.compiler_flags['cflags']) - if cflags: - cfg.write(cmake_cache_entry("CMAKE_C_FLAGS", cflags)) - - cxxflags = ' '.join(spec.compiler_flags['cxxflags']) - if cxxflags: - cfg.write(cmake_cache_entry("CMAKE_CXX_FLAGS", cxxflags)) - - if ("gfortran" in f_compiler) and ("clang" in cpp_compiler): - libdir = pjoin(os.path.dirname( - os.path.dirname(f_compiler)), "lib") + @property + def cache_name(self): + hostname = socket.gethostname() + if "SYS_TYPE" in env: + hostname = hostname.rstrip("1234567890") + return "{0}-{1}-{2}@{3}-{4}.cmake".format( + hostname, + self._get_sys_type(self.spec), + self.spec.compiler.name, + self.spec.compiler.version, + self.spec.dag_hash(8) + ) + + ### From local package, improved with umpire package implementation + def spec_uses_toolchain(self, spec): + gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") + using_toolchain = list(filter(gcc_toolchain_regex.match, spec.compiler_flags['cxxflags'])) + return using_toolchain + + ### From local package, improved with umpire package implementation + def spec_uses_gccname(self, spec): + gcc_name_regex = re.compile(".*gcc-name.*") + using_gcc_name = list(filter(gcc_name_regex.match, spec.compiler_flags['cxxflags'])) + return using_gcc_name + + def initconfig_compiler_entries(self): + spec = self.spec + entries = super(Chai, self).initconfig_compiler_entries() + + # adrienbernede-22-11: + # This was only done in upstream Spack raja package. + # I could not find the equivalent logic in Spack source, so sharing it. + if "+rocm" in spec: + entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) + return entries + + ### From local package: + fortran_compilers = ["gfortran", "xlf"] + if any(compiler in self.compiler.fc for compiler in fortran_compilers) and ("clang" in self.compiler.cxx): + # Pass fortran compiler lib as rpath to find missing libstdc++ + libdir = os.path.join(os.path.dirname( + os.path.dirname(self.compiler.fc)), "lib") flags = "" for _libpath in [libdir, libdir + "64"]: if os.path.exists(_libpath): flags += " -Wl,-rpath,{0}".format(_libpath) description = ("Adds a missing libstdc++ rpath") if flags: - cfg.write(cmake_cache_entry("BLT_EXE_LINKER_FLAGS", flags, - description)) + entries.append(cmake_cache_string("BLT_EXE_LINKER_FLAGS", flags, description)) - gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") - gcc_name_regex = re.compile(".*gcc-name.*") + # Ignore conflicting default gcc toolchain + entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", + "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) - using_toolchain = list(filter(gcc_toolchain_regex.match, spec.compiler_flags['cxxflags'])) - using_gcc_name = list(filter(gcc_name_regex.match, spec.compiler_flags['cxxflags'])) compilers_using_toolchain = ["pgi", "xl", "icpc"] - if any(compiler in cpp_compiler for compiler in compilers_using_toolchain): - if using_toolchain or using_gcc_name: - cfg.write(cmake_cache_entry("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) + if any(compiler in self.compiler.cxx for compiler in compilers_using_toolchain): + if self.spec_uses_toolchain(self.spec) or self.spec_uses_gccname(self.spec): - if "+cuda" in spec: - cfg.write("#------------------{0}\n".format("-" * 60)) - cfg.write("# Cuda\n") - cfg.write("#------------------{0}\n\n".format("-" * 60)) - - cfg.write(cmake_cache_option("ENABLE_CUDA", True)) - - cudatoolkitdir = spec['cuda'].prefix - cfg.write(cmake_cache_entry("CUDA_TOOLKIT_ROOT_DIR", - cudatoolkitdir)) - cudacompiler = "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" - cfg.write(cmake_cache_entry("CMAKE_CUDA_COMPILER", - cudacompiler)) - - if not spec.satisfies('cuda_arch=none'): - cuda_arch = spec.variants['cuda_arch'].value - cuda_arch = "sm_{0}".format(cuda_arch[0]) - flag = '-arch {0}'.format(cuda_arch) - cfg.write(cmake_cache_string("CUDA_ARCH",cuda_arch)) - cfg.write(cmake_cache_string("CMAKE_CUDA_FLAGS", flag)) + # Ignore conflicting default gcc toolchain + entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", + "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) - else: - cfg.write(cmake_cache_option("ENABLE_CUDA", False)) + def initconfig_hardware_entries(self): + spec = self.spec + entries = super(Chai, self).initconfig_hardware_entries() - if "+raja" in spec: - cfg.write("#------------------{0}\n".format("-" * 60)) - cfg.write("# RAJA\n") - cfg.write("#------------------{0}\n\n".format("-" * 60)) + entries.append(cmake_cache_option("ENABLE_OPENMP", "+openmp" in spec)) - cfg.write(cmake_cache_option("CHAI_ENABLE_RAJA_PLUGIN", True)) - raja_dir = spec['raja'].prefix - cfg.write(cmake_cache_entry("RAJA_DIR", raja_dir)) + if "+cuda" in spec: + entries.append(cmake_cache_option("ENABLE_CUDA", True)) + entries.append(cmake_cache_option("CMAKE_CUDA_SEPARABLE_COMPILATION", True)) + entries.append(cmake_cache_option("CUDA_SEPARABLE_COMPILATION", True)) + + cuda_flags = [] + if not spec.satisfies("cuda_arch=none"): + cuda_arch = spec.variants["cuda_arch"].value + cuda_flags.append("-arch sm_{0}".format(cuda_arch[0])) + entries.append( + cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) + entries.append( + cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0]))) + entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", " ".join(cuda_flags))) else: - cfg.write(cmake_cache_option("CHAI_ENABLE_RAJA_PLUGIN", False)) + entries.append(cmake_cache_option("ENABLE_CUDA", False)) + + if "+rocm" in spec: + entries.append(cmake_cache_option("ENABLE_HIP", True)) + entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) + hip_repair_cache(entries, spec) + archs = self.spec.variants["amdgpu_target"].value + if archs != "none": + arch_str = ",".join(archs) + entries.append( + cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) + ) + entries.append( + cmake_cache_string("CMAKE_HIP_ARCHITECTURES", arch_str) + ) + else: + entries.append(cmake_cache_option("ENABLE_HIP", False)) - # shared vs static libs - cfg.write(cmake_cache_option("BUILD_SHARED_LIBS","+shared" in spec)) + return entries - cfg.write(cmake_cache_entry("umpire_DIR",spec['umpire'].prefix)) - camp_conf_path = spec['camp'].prefix + "/lib/cmake/camp" - cfg.write(cmake_cache_entry("camp_DIR",camp_conf_path)) + def initconfig_package_entries(self): + spec = self.spec + entries = [] - cfg.write(cmake_cache_option("ENABLE_BENCHMARKS", 'tests=benchmarks' in spec)) - cfg.write(cmake_cache_option("ENABLE_TESTS", not 'tests=none' in spec)) + option_prefix = "CHAI_" if spec.satisfies("@2022.03.0:") else "" - ####################### - # Close and save - ####################### - cfg.write("\n") - cfg.close() + # TPL locations + entries.append("#------------------{0}".format("-" * 60)) + entries.append("# TPLs") + entries.append("#------------------{0}\n".format("-" * 60)) - print("OUT: host-config file {0}".format(host_config_path)) + entries.append(cmake_cache_path( + "BLT_SOURCE_DIR", spec["blt"].prefix)) + if "+raja" in spec: + entries.append(cmake_cache_option( + "{}ENABLE_RAJA_PLUGIN".format(option_prefix), True)) + entries.append(cmake_cache_path( + "RAJA_DIR", spec["raja"].prefix)) + entries.append(cmake_cache_path( + "umpire_DIR", spec["umpire"].prefix.share.umpire.cmake)) + + # Build options + entries.append("#------------------{0}".format("-" * 60)) + entries.append("# Build Options") + entries.append("#------------------{0}\n".format("-" * 60)) + + entries.append(cmake_cache_string( + "CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) + entries.append(cmake_cache_option( + "BUILD_SHARED_LIBS", "+shared" in spec)) + + entries.append(cmake_cache_option( + "{}ENABLE_PICK".format(option_prefix), "+enable_pick" in spec)) + entries.append(cmake_cache_option( + "ENABLE_TESTS", "+tests" in spec)) + entries.append(cmake_cache_option( + "ENABLE_BENCHMARKS", "+benchmarks" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec)) + + return entries def cmake_args(self): - spec = self.spec - host_config_path = self._get_host_config_path(spec) - options = [] - options.extend(['-C', host_config_path]) - return options From fa7b1959462ae64f0f612c49f73f623c69e08f94 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 10 Nov 2022 15:33:36 +0100 Subject: [PATCH 05/63] =?UTF-8?q?Update=20with=20latest=20RAJA=E2=80=AFand?= =?UTF-8?q?=20Umpire=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/spack_packages/raja/package.py | 72 ++++++++++---- scripts/spack_packages/umpire/package.py | 116 +++++++++++++++-------- 2 files changed, 130 insertions(+), 58 deletions(-) diff --git a/scripts/spack_packages/raja/package.py b/scripts/spack_packages/raja/package.py index 16e1996a..875e6310 100644 --- a/scripts/spack_packages/raja/package.py +++ b/scripts/spack_packages/raja/package.py @@ -108,13 +108,50 @@ def cache_name(self): hostname = socket.gethostname() if "SYS_TYPE" in env: hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}.cmake".format( + return "{0}-{1}-{2}@{3}-{4}.cmake".format( hostname, self._get_sys_type(self.spec), self.spec.compiler.name, self.spec.compiler.version, + self.spec.dag_hash(8) ) + def initconfig_compiler_entries(self): + spec = self.spec + # Default entries are already defined in CachedCMakePackage, inherit them: + entries = super(Raja, self).initconfig_compiler_entries() + + # Switch to hip as a CPP compiler. + # adrienbernede-22-11: + # This was only done in upstream Spack raja package. + # I could not find the equivalent logic in Spack source, so keeping it. + if "+rocm" in spec: + entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) + + # Override CachedCMakePackage CMAKE_C_FLAGS and CMAKE_CXX_FLAGS add + # +libcpp specific flags + flags = spec.compiler_flags + + # use global spack compiler flags + cppflags = " ".join(flags["cppflags"]) + if cppflags: + # avoid always ending up with " " with no flags defined + cppflags += " " + + cflags = cppflags + " ".join(flags["cflags"]) + if "+libcpp" in spec: + cflags += " ".join([cflags,"-DGTEST_HAS_CXXABI_H_=0"]) + if cflags: + entries.append(cmake_cache_string("CMAKE_C_FLAGS", cflags)) + + cxxflags = cppflags + " ".join(flags["cxxflags"]) + if "+libcpp" in spec: + cxxflags += " ".join([cxxflags,"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0"]) + if cxxflags: + entries.append(cmake_cache_string("CMAKE_CXX_FLAGS", cxxflags)) + + return entries + def initconfig_hardware_entries(self): spec = self.spec entries = super(Raja, self).initconfig_hardware_entries() @@ -157,30 +194,31 @@ def initconfig_package_entries(self): option_prefix = "RAJA_" if spec.satisfies("@0.14.0:") else "" - entries.append(cmake_cache_option("RAJA_ENABLE_DESUL_ATOMICS", "+desul" in spec)) + # TPL locations + entries.append("#------------------{0}".format("-" * 60)) + entries.append("# TPLs") + entries.append("#------------------{0}\n".format("-" * 60)) - # use global spack compiler flags - cflags = " ".join(spec.compiler_flags["cflags"]) - if "+libcpp" in spec: - cflags += " ".join([cflags,"-DGTEST_HAS_CXXABI_H_=0"]) - if cflags: - entries.append(cmake_cache_string("CMAKE_C_FLAGS", cflags)) + entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) + if "camp" in self.spec: + entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) - cxxflags = " ".join(spec.compiler_flags["cxxflags"]) - if "+libcpp" in spec: - cxxflags += " ".join([cxxflags,"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0"]) - if cxxflags: - entries.append(cmake_cache_string("CMAKE_CXX_FLAGS", cxxflags)) + # Build options + entries.append("#------------------{0}".format("-" * 60)) + entries.append("# Build Options") + entries.append("#------------------{0}\n".format("-" * 60)) + + entries.append(cmake_cache_string( + "CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) + entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) + + entries.append(cmake_cache_option("RAJA_ENABLE_DESUL_ATOMICS", "+desul" in spec)) if "+desul" in spec: entries.append(cmake_cache_string("BLT_CXX_STD","c++14")) if "+cuda" in spec: entries.append(cmake_cache_string("CMAKE_CUDA_STANDARD", "14")) - entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) - if "camp" in self.spec: - entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) - entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) entries.append( cmake_cache_option("{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec) ) diff --git a/scripts/spack_packages/umpire/package.py b/scripts/spack_packages/umpire/package.py index 7dacbb65..61d383f5 100644 --- a/scripts/spack_packages/umpire/package.py +++ b/scripts/spack_packages/umpire/package.py @@ -88,7 +88,7 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): description="Tests to run", ) variant("libcpp", default=False, description="Uses libc++ instead of libstdc++") - variant("tools", default=True, description="Enable tools") + variant("tools", default=False, description="Enable tools") variant("backtrace", default=False, description="Enable backtrace tools") variant("dev_benchmarks", default=False, description="Enable Developer Benchmarks") variant("device_alloc", default=True, description="Enable DeviceAllocator") @@ -142,6 +142,7 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): conflicts('~openmp', when='+openmp_target', msg='OpenMP target requires OpenMP') conflicts('+cuda', when='+rocm') + conflicts('+tools', when='+rocm') conflicts('+rocm', when='+openmp_target', msg='Cant support both rocm and openmp device backends at once') conflicts('~mpi', when='+ipc_shmem', msg='Shared Memory Allocator requires MPI') conflicts('+ipc_shmem', when='@:5.0.1') @@ -169,11 +170,12 @@ def cache_name(self): hostname = socket.gethostname() if "SYS_TYPE" in env: hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}.cmake".format( + return "{0}-{1}-{2}@{3}-{4}.cmake".format( hostname, self._get_sys_type(self.spec), self.spec.compiler.name, self.spec.compiler.version, + self.spec.dag_hash(8) ) def spec_uses_toolchain(self, spec): @@ -188,9 +190,14 @@ def spec_uses_gccname(self, spec): def initconfig_compiler_entries(self): spec = self.spec + # Default entries are already defined in CachedCMakePackage, inherit them: entries = super(Umpire, self).initconfig_compiler_entries() - ### TODO: This was only in Spack ustream, only needed for older versions ? + # adrienbernede-22-11: + # This was in upstream Spack raja package, but it’s causing the follwing failure: + # CMake Error in src/umpire/CMakeLists.txt: + # No known features for CXX compiler + # #if "+rocm" in spec: # entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) @@ -206,9 +213,7 @@ def initconfig_compiler_entries(self): ### From local package: fortran_compilers = ["gfortran", "xlf"] if any(compiler in self.compiler.fc for compiler in fortran_compilers) and ("clang" in self.compiler.cxx): - entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) - + # Pass fortran compiler lib as rpath to find missing libstdc++ libdir = os.path.join(os.path.dirname( os.path.dirname(self.compiler.fc)), "lib") flags = "" @@ -219,13 +224,20 @@ def initconfig_compiler_entries(self): if flags: entries.append(cmake_cache_string("BLT_EXE_LINKER_FLAGS", flags, description)) + # Ignore conflicting default gcc toolchain + entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", + "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) compilers_using_toolchain = ["pgi", "xl", "icpc"] if any(compiler in self.compiler.cxx for compiler in compilers_using_toolchain): if self.spec_uses_toolchain(self.spec) or self.spec_uses_gccname(self.spec): + + # Ignore conflicting default gcc toolchain entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) + #adrienbernede-22-11: + # Specific to Umpire local package, worth sharing? entries = [x for x in entries if not 'COMPILER_ID' in x] return entries @@ -242,18 +254,15 @@ def initconfig_hardware_entries(self): cuda_flags = [] if not spec.satisfies("cuda_arch=none"): cuda_arch = spec.variants["cuda_arch"].value - entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) - entries.append( - cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) - ) cuda_flags.append("-arch sm_{0}".format(cuda_arch[0])) - + entries.append( + cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) + entries.append( + cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0]))) if self.spec_uses_toolchain(self.spec): cuda_flags.append("-Xcompiler {}".format(self.spec_uses_toolchain(self.spec)[0])) - if (spec.satisfies("%gcc@8.1: target=ppc64le")): cuda_flags.append("-Xcompiler -mno-float128") - entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", " ".join(cuda_flags))) entries.append( @@ -269,14 +278,22 @@ def initconfig_hardware_entries(self): hip_root = spec["hip"].prefix rocm_root = hip_root + "/.." - hip_arch = spec.variants["amdgpu_target"].value entries.append(cmake_cache_path("HIP_ROOT_DIR", hip_root)) entries.append(cmake_cache_path("ROCM_ROOT_DIR", rocm_root)) - entries.append(cmake_cache_string("CMAKE_HIP_ARCHITECTURES", hip_arch[0])) - entries.append(cmake_cache_option("UMPIRE_ENABLE_TOOLS", False)) hip_repair_cache(entries, spec) + archs = self.spec.variants["amdgpu_target"].value + if archs != "none": + arch_str = ",".join(archs) + entries.append( + cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) + ) + entries.append( + cmake_cache_string("CMAKE_HIP_ARCHITECTURES", arch_str) + ) + # adrienbernede-22-11: + # Specific to Umpire, should we port to RAJA and CHAI? hip_link_flags = "" if "%gcc" in spec: gcc_bin = os.path.dirname(self.compiler.cxx) @@ -286,18 +303,14 @@ def initconfig_hardware_entries(self): else: entries.append(cmake_cache_string("CMAKE_EXE_LINKER_FLAGS", "-Wl,-rpath={0}/llvm/lib/".format(rocm_root))) - archs = self.spec.variants["amdgpu_target"].value - if archs != "none": - arch_str = ",".join(archs) - entries.append( - cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) - ) else: entries.append(cmake_cache_option("ENABLE_HIP", False)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_DEVICE_CONST", "+deviceconst" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_DEVICE_CONST".format(option_prefix), "+deviceconst" in spec)) - entries.append(cmake_cache_option("UMPIRE_ENABLE_OPENMP_TARGET", "+openmp_target" in spec)) + entries.append(cmake_cache_option( + "{}ENABLE_OPENMP_TARGET".format(option_prefix), "+openmp_target" in spec)) if "+openmp_target" in spec: if ('%xl' in spec): entries.append(cmake_cache_string("OpenMP_CXX_FLAGS", "-qsmp;-qoffload")) @@ -327,45 +340,66 @@ def initconfig_package_entries(self): if spec.satisfies("@5.0.0:"): entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) + # Build options + entries.append("#------------------{0}".format("-" * 60)) + entries.append("# Build Options") + entries.append("#------------------{0}\n".format("-" * 60)) + + entries.append(cmake_cache_string( + "CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) entries.append(cmake_cache_option( - "{}ENABLE_NUMA".format(option_prefix), "+numa" in spec)) - entries.append(cmake_cache_option( - "{}ENABLE_OPENMP".format(option_prefix), "+openmp" in spec)) - entries.append(cmake_cache_option( - "{}ENABLE_BENCHMARKS".format(option_prefix), "tests=benchmarks" in spec or "+dev_benchmarks" in spec)) - entries.append(cmake_cache_option( - "{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec)) + "BUILD_SHARED_LIBS", "+shared" in spec)) entries.append(cmake_cache_option( - "{}ENABLE_DOCS".format(option_prefix), False)) + "ENABLE_WARNINGS_AS_ERRORS", "+werror" in spec)) + + # Generic options that have a prefixed equivalent in Umpire CMake entries.append(cmake_cache_option( - "{}ENABLE_DEVICE_ALLOCATOR".format(option_prefix), "+device_alloc" in spec)) + "ENABLE_OPENMP", "+openmp" in spec)) entries.append(cmake_cache_option( - "BUILD_SHARED_LIBS", "+shared" in spec)) + "ENABLE_EXAMPLES", "+examples" in spec)) entries.append(cmake_cache_option( - "{}ENABLE_TESTS".format(option_prefix), "tests=none" not in spec)) + "ENABLE_DOCS", False)) + if "tests=benchmarks" in spec or "+dev_benchmarks" in spec: + # BLT requires ENABLE_TESTS=True to enable benchmarks + entries.append(cmake_cache_option( + "ENABLE_BENCHMARKS", True)) + entries.append(cmake_cache_option( + "ENABLE_TESTS", True)) + else: + entries.append(cmake_cache_option( + "ENABLE_TESTS", "tests=none" not in spec)) - entries.append(cmake_cache_string( - "CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) + # Prefixed options that used to be name without one + entries.append(cmake_cache_option( + "{}ENABLE_NUMA".format(option_prefix), "+numa" in spec)) entries.append(cmake_cache_option( "{}ENABLE_DEVELOPER_BENCHMARKS".format(option_prefix), "+dev_benchmarks" in spec)) entries.append(cmake_cache_option( "{}ENABLE_TOOLS".format(option_prefix), "+tools" in spec)) entries.append(cmake_cache_option( "{}ENABLE_BACKTRACE".format(option_prefix), "+backtrace" in spec)) - entries.append(cmake_cache_option( - "ENABLE_WARNINGS_AS_ERRORS", "+werror" in spec)) entries.append(cmake_cache_option( "{}ENABLE_ASAN".format(option_prefix), "+asan" in spec)) entries.append(cmake_cache_option( "{}ENABLE_SANITIZER_TESTS".format(option_prefix), "+sanitizer_tests" in spec)) + + # Recent options, were never name without prefix entries.append(cmake_cache_option( - "{}ENABLE_IPC_SHARED_MEMORY".format(option_prefix), "+ipc_shmem" in spec)) + "UMPIRE_ENABLE_DEVICE_ALLOCATOR", "+device_alloc" in spec)) entries.append(cmake_cache_option( - "{}ENABLE_SQLITE_EXPERIMENTAL".format(option_prefix), "+sqlite_experimental" in spec)) + "UMPIRE_ENABLE_SQLITE_EXPERIMENTAL", "+sqlite_experimental" in spec)) if "+sqlite_experimental" in spec: entries.append(cmake_cache_path( "SQLite3_ROOT" ,spec['sqlite'].prefix)) + # This option was renamed later than the others + if spec.satisfies("@2022.10.0:"): + entries.append(cmake_cache_option( + "UMPIRE_ENABLE_IPC_SHARED_MEMORY", "+ipc_shmem" in spec)) + else: + entries.append(cmake_cache_option( + "ENABLE_IPC_SHARED_MEMORY", "+ipc_shmem" in spec)) + return entries def cmake_args(self): From 8561afbb16d9853b919ea73fba4191d77c49482c Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 14 Nov 2022 15:38:18 +0100 Subject: [PATCH 06/63] Update extra specs with new default variants --- .gitlab/lassen-build-and-test-extra.yml | 8 ++++---- .gitlab/ruby-build-and-test-extra.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 606e6c0b..23958b37 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -37,23 +37,23 @@ ibm_clang_9_0_0_gcc_8_3_1_cuda_10_1_168: # In RAJA, this spec has an updated cuda (11.0.2), with cuda_arch=70 set. ibm_clang_9_0_0_cuda_10_1_168: variables: - SPEC: "+cuda %clang@ibm.9.0.0 ^cuda@10.1.168" + SPEC: "~shared +raja tests=basic +cuda %clang@ibm.9.0.0 ^cuda@10.1.168" extends: .build_and_test_on_lassen clang_9_0_0_libcpp (build and test on lassen): variables: - SPEC: "%clang@9.0.0 cxxflags=\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\" cflags=\"-DGTEST_HAS_CXXABI_H_=0\"" + SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\" cflags=\"-DGTEST_HAS_CXXABI_H_=0\"" extends: .build_and_test_on_lassen clang_9_0_0_memleak (build and test on lassen): variables: - SPEC: "%clang@9.0.0 cxxflags=-fsanitize=address" + SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=-fsanitize=address" ASAN_OPTIONS: "detect_leaks=1" extends: .build_and_test_on_lassen clang_9_0_0_datarace (build and test on lassen): variables: - SPEC: "%clang@9.0.0 cxxflags=-fsanitize=thread" + SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=-fsanitize=thread" allow_failure: true extends: .build_and_test_on_lassen diff --git a/.gitlab/ruby-build-and-test-extra.yml b/.gitlab/ruby-build-and-test-extra.yml index 366916ef..b9651811 100644 --- a/.gitlab/ruby-build-and-test-extra.yml +++ b/.gitlab/ruby-build-and-test-extra.yml @@ -29,7 +29,7 @@ pgi_20_1_gcc_local_8_3_1: gcc_4_9_3: variables: - SPEC: "%gcc@4.9.3" + SPEC: "~shared +raja tests=basic %gcc@4.9.3" extends: .build_and_test_on_ruby #clang_10_develop_tpls: From 368e21f3447b96162295a308fb32192ab0679b47 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 14 Nov 2022 16:40:31 +0100 Subject: [PATCH 07/63] Fix tests variant, sort CMake options --- scripts/spack_packages/chai/package.py | 35 ++++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/scripts/spack_packages/chai/package.py b/scripts/spack_packages/chai/package.py index 2262a782..79f75366 100644 --- a/scripts/spack_packages/chai/package.py +++ b/scripts/spack_packages/chai/package.py @@ -42,13 +42,17 @@ class Chai(CachedCMakePackage, CudaPackage, ROCmPackage): variant("enable_pick", default=False, description="Enable pick method") variant("shared", default=True, description="Build Shared Libs") variant("raja", default=False, description="Build plugin for RAJA") - variant("benchmarks", default=False, description="Build benchmarks.") variant("examples", default=True, description="Build examples.") variant("openmp", default=False, description="Build using OpenMP") # TODO: figure out gtest dependency and then set this default True # and remove the +tests conflict below. - variant("tests", default="none", values=("none", "basic", "benchmarks"), - multi=False, description="Tests to run") + variant( + "tests", + default="none", + values=("none", "basic", "benchmarks"), + multi=False, + description="Tests to run", + ) depends_on("cmake@3.8:", type="build") depends_on("cmake@3.9:", type="build", when="+cuda") @@ -101,8 +105,6 @@ class Chai(CachedCMakePackage, CudaPackage, ROCmPackage): when="amdgpu_target={0}".format(arch), ) - conflicts("+benchmarks", when="~tests") - def _get_sys_type(self, spec): sys_type = spec.architecture if "SYS_TYPE" in env: @@ -175,8 +177,6 @@ def initconfig_hardware_entries(self): spec = self.spec entries = super(Chai, self).initconfig_hardware_entries() - entries.append(cmake_cache_option("ENABLE_OPENMP", "+openmp" in spec)) - if "+cuda" in spec: entries.append(cmake_cache_option("ENABLE_CUDA", True)) entries.append(cmake_cache_option("CMAKE_CUDA_SEPARABLE_COMPILATION", True)) @@ -238,19 +238,32 @@ def initconfig_package_entries(self): entries.append("# Build Options") entries.append("#------------------{0}\n".format("-" * 60)) + # Build options entries.append(cmake_cache_string( "CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) entries.append(cmake_cache_option( "BUILD_SHARED_LIBS", "+shared" in spec)) + # Generic options that have a prefixed equivalent in CHAI CMake entries.append(cmake_cache_option( - "{}ENABLE_PICK".format(option_prefix), "+enable_pick" in spec)) + "ENABLE_OPENMP", "+openmp" in spec)) entries.append(cmake_cache_option( - "ENABLE_TESTS", "+tests" in spec)) + "ENABLE_EXAMPLES", "+examples" in spec)) entries.append(cmake_cache_option( - "ENABLE_BENCHMARKS", "+benchmarks" in spec)) + "ENABLE_DOCS", False)) + if "tests=benchmarks" in spec: + # BLT requires ENABLE_TESTS=True to enable benchmarks + entries.append(cmake_cache_option( + "ENABLE_BENCHMARKS", True)) + entries.append(cmake_cache_option( + "ENABLE_TESTS", True)) + else: + entries.append(cmake_cache_option( + "ENABLE_TESTS", "tests=none" not in spec)) + + # Prefixed options that used to be name without one entries.append(cmake_cache_option( - "{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec)) + "{}ENABLE_PICK".format(option_prefix), "+enable_pick" in spec)) return entries From e6db20989cb5dc0fcc0c727f24a5a988e6e92515 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 14 Nov 2022 16:58:30 +0100 Subject: [PATCH 08/63] Fix CMake requirements (used to prevent the use of cmake@3.20+) --- scripts/spack_packages/chai/package.py | 2 +- scripts/spack_packages/umpire/package.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/spack_packages/chai/package.py b/scripts/spack_packages/chai/package.py index 79f75366..8fa5bff6 100644 --- a/scripts/spack_packages/chai/package.py +++ b/scripts/spack_packages/chai/package.py @@ -56,7 +56,7 @@ class Chai(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("cmake@3.8:", type="build") depends_on("cmake@3.9:", type="build", when="+cuda") - depends_on("cmake@3.14:", when="@2022.03.0:") + depends_on("cmake@3.14:", type="build", when="@2022.03.0:") depends_on("blt@0.5.2:", type="build", when="@2022.10.0:") depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") diff --git a/scripts/spack_packages/umpire/package.py b/scripts/spack_packages/umpire/package.py index 61d383f5..32704969 100644 --- a/scripts/spack_packages/umpire/package.py +++ b/scripts/spack_packages/umpire/package.py @@ -98,8 +98,10 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("cmake@3.8:", type="build") depends_on("cmake@3.9:", when="+cuda", type="build") - depends_on("cmake@:3.20", when="+rocm", type="build") - depends_on("cmake@3.14:", when="@2022.03.0:") + depends_on("cmake@3.20:", when="@2022.10.0:", type="build") + depends_on("cmake@3.23:", when="@2022.10.0: +rocm", type="build") + depends_on("cmake@3.14:", when="@2022.03.0:", type="build") + depends_on("cmake@:3.20", when="@2022.03.0:2022.03 +rocm", type="build") depends_on("blt@0.5.2:", type="build", when="@2022.10.0:") depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") From 71413e892d712b93301a88867ba35ef8c95b437e Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 14 Nov 2022 17:12:00 +0100 Subject: [PATCH 09/63] Update radiuss-spack-configs (new CMake versions) --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 1ce0f442..8d955b4a 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 1ce0f4421cfe6be4200ae9aa8abd113e09ee4c2d +Subproject commit 8d955b4a49406a12dc44f1a9baab7ab7fa9c68df From 35b0d94ab32c6562e488504566ff8fab836c36b5 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 14 Nov 2022 23:14:52 +0100 Subject: [PATCH 10/63] Fix package config phase name --- .uberenv_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.uberenv_config.json b/.uberenv_config.json index 93854a5f..87a898b9 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -1,7 +1,7 @@ { "package_name" : "chai", "package_version" : "develop", -"package_final_phase" : "hostconfig", +"package_final_phase" : "initconfig", "package_source_dir" : "../..", "spack_url": "https://github.com/spack/spack.git", "spack_branch": "v0.18.1", From 79051ad90372f6653308e6f532df817bce933292 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 14 Nov 2022 23:27:15 +0100 Subject: [PATCH 11/63] Attempt to fix umpire not found --- scripts/spack_packages/chai/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/spack_packages/chai/package.py b/scripts/spack_packages/chai/package.py index 8fa5bff6..57754cac 100644 --- a/scripts/spack_packages/chai/package.py +++ b/scripts/spack_packages/chai/package.py @@ -231,7 +231,7 @@ def initconfig_package_entries(self): entries.append(cmake_cache_path( "RAJA_DIR", spec["raja"].prefix)) entries.append(cmake_cache_path( - "umpire_DIR", spec["umpire"].prefix.share.umpire.cmake)) + "umpire_DIR", spec["umpire"].prefix)) # Build options entries.append("#------------------{0}".format("-" * 60)) From 713c8b79f7d971b6ca691939b50ee02d975a79e8 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 17 Nov 2022 11:57:13 +0100 Subject: [PATCH 12/63] Attempt to fix amdgpu flags defined more than once --- scripts/spack_packages/chai/package.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/spack_packages/chai/package.py b/scripts/spack_packages/chai/package.py index 57754cac..2dbf4641 100644 --- a/scripts/spack_packages/chai/package.py +++ b/scripts/spack_packages/chai/package.py @@ -141,11 +141,19 @@ def initconfig_compiler_entries(self): entries = super(Chai, self).initconfig_compiler_entries() # adrienbernede-22-11: - # This was only done in upstream Spack raja package. - # I could not find the equivalent logic in Spack source, so sharing it. - if "+rocm" in spec: - entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - return entries + # This was in upstream Spack raja package, but it’s causing the follwing failure Umpire: + # CMake Error in src/umpire/CMakeLists.txt: + # No known features for CXX compiler + # + # In CHAI, we see another error: + # [ 15%] Linking C executable ../../../tests/blt_hip_runtime_c_smoke + # clang (LLVM option parsing): for the --amdgpu-early-inline-all option: may only occur zero or one times! + # clang (LLVM option parsing): for the --amdgpu-function-calls option: may only occur zero or one times! + # We suspect this error comes from the use of hip compiler here, so we comment it: + # + #if "+rocm" in spec: + # entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) + #return entries ### From local package: fortran_compilers = ["gfortran", "xlf"] From b5b01139c0d03e6c33035201765b3a8ee57f74d2 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 17 Nov 2022 12:00:39 +0100 Subject: [PATCH 13/63] Overriding job to define test variant only once (same fix as in umpire) --- .gitlab/lassen-build-and-test-extra.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 23958b37..0d1e8178 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -26,6 +26,13 @@ ibm_clang_9_0_0_gcc_8_3_1_cuda_10_1_168: SPEC: " ${PROJECT_LASSEN_VARIANTS} +cuda %clang@ibm.9.0.0 cxxflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@10.1.168 ${PROJECT_LASSEN_DEPS}" allow_failure: true +# Spec has test disabled in shared CI, conflicting with default test setting in Umpire +# TODO: This is likely an issue in RADIUSS Shared CI: why disable tests ?. +xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: + variables: + SPEC: "~shared +fortran ~device_alloc +cuda tests=none %xl@16.1.1.12 cxxflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@11.0.2" + extends: .build_and_test_on_lassen + ############ # Extra jobs From 1300137718cddb4598ac0b8076a9530dff5d39a9 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 17 Nov 2022 18:50:45 +0100 Subject: [PATCH 14/63] Add missing variant --- .gitlab/lassen-build-and-test-extra.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 0d1e8178..dc9922cd 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -30,7 +30,7 @@ ibm_clang_9_0_0_gcc_8_3_1_cuda_10_1_168: # TODO: This is likely an issue in RADIUSS Shared CI: why disable tests ?. xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: variables: - SPEC: "~shared +fortran ~device_alloc +cuda tests=none %xl@16.1.1.12 cxxflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@11.0.2" + SPEC: "~shared +raja +cuda tests=none %xl@16.1.1.12 cxxflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@11.0.2 ${PROJECT_LASSEN_DEPS}" extends: .build_and_test_on_lassen From eafc85921491a4f499aece6dfb9bbe2e4a52cb6c Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 17 Nov 2022 20:13:08 +0100 Subject: [PATCH 15/63] Fix 713c8b7 --- scripts/spack_packages/chai/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/spack_packages/chai/package.py b/scripts/spack_packages/chai/package.py index 2dbf4641..f1dcad61 100644 --- a/scripts/spack_packages/chai/package.py +++ b/scripts/spack_packages/chai/package.py @@ -153,7 +153,8 @@ def initconfig_compiler_entries(self): # #if "+rocm" in spec: # entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - #return entries + + return entries ### From local package: fortran_compilers = ["gfortran", "xlf"] From 07c028b3a60059b8f4ad531141593ee4b50e612c Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 21 Nov 2022 12:04:30 +0100 Subject: [PATCH 16/63] Update Umpire package --- scripts/spack_packages/umpire/package.py | 43 +++++++++++------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/scripts/spack_packages/umpire/package.py b/scripts/spack_packages/umpire/package.py index 32704969..fb54fbfc 100644 --- a/scripts/spack_packages/umpire/package.py +++ b/scripts/spack_packages/umpire/package.py @@ -98,10 +98,8 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("cmake@3.8:", type="build") depends_on("cmake@3.9:", when="+cuda", type="build") - depends_on("cmake@3.20:", when="@2022.10.0:", type="build") - depends_on("cmake@3.23:", when="@2022.10.0: +rocm", type="build") - depends_on("cmake@3.14:", when="@2022.03.0:", type="build") - depends_on("cmake@:3.20", when="@2022.03.0:2022.03 +rocm", type="build") + depends_on("cmake@:3.20", when="+rocm", type="build") + depends_on("cmake@3.14:", when="@2022.03.0:") depends_on("blt@0.5.2:", type="build", when="@2022.10.0:") depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") @@ -118,8 +116,8 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("camp@main", when="@develop") depends_on("camp+openmp", when="+openmp") - depends_on('sqlite', when='+sqlite_experimental') - depends_on('mpi', when='+mpi') + depends_on("sqlite", when="+sqlite_experimental") + depends_on("mpi", when="+mpi") with when("@5.0.0:"): with when("+cuda"): @@ -139,18 +137,18 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): conflicts("~c", when="+fortran", msg="Fortran API requires C API") conflicts("+device_alloc", when="@:2022.03.0") - conflicts('+deviceconst', when='~rocm~cuda') - conflicts('+device_alloc', when='~rocm~cuda') + conflicts("+deviceconst", when="~rocm~cuda") + conflicts("+device_alloc", when="~rocm~cuda") - conflicts('~openmp', when='+openmp_target', msg='OpenMP target requires OpenMP') - conflicts('+cuda', when='+rocm') - conflicts('+tools', when='+rocm') - conflicts('+rocm', when='+openmp_target', msg='Cant support both rocm and openmp device backends at once') - conflicts('~mpi', when='+ipc_shmem', msg='Shared Memory Allocator requires MPI') - conflicts('+ipc_shmem', when='@:5.0.1') + conflicts("~openmp", when="+openmp_target", msg="OpenMP target requires OpenMP") + conflicts("+cuda", when="+rocm") + conflicts("+tools", when="+rocm") + conflicts("+rocm", when="+openmp_target", msg="Cant support both rocm and openmp device backends at once") + conflicts("~mpi", when="+ipc_shmem", msg="Shared Memory Allocator requires MPI") + conflicts("+ipc_shmem", when="@:5.0.1") - conflicts('+sqlite_experimental', when='@:6.0.0') - conflicts('+sanitizer_tests', when='~asan') + conflicts("+sqlite_experimental", when="@:6.0.0") + conflicts("+sanitizer_tests", when="~asan") # device allocator exports device code, which requires static libs # currently only available for cuda. @@ -182,12 +180,12 @@ def cache_name(self): def spec_uses_toolchain(self, spec): gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") - using_toolchain = list(filter(gcc_toolchain_regex.match, spec.compiler_flags['cxxflags'])) + using_toolchain = list(filter(gcc_toolchain_regex.match, spec.compiler_flags["cxxflags"])) return using_toolchain def spec_uses_gccname(self, spec): gcc_name_regex = re.compile(".*gcc-name.*") - using_gcc_name = list(filter(gcc_name_regex.match, spec.compiler_flags['cxxflags'])) + using_gcc_name = list(filter(gcc_name_regex.match, spec.compiler_flags["cxxflags"])) return using_gcc_name def initconfig_compiler_entries(self): @@ -240,7 +238,7 @@ def initconfig_compiler_entries(self): #adrienbernede-22-11: # Specific to Umpire local package, worth sharing? - entries = [x for x in entries if not 'COMPILER_ID' in x] + entries = [x for x in entries if not "COMPILER_ID" in x] return entries @@ -313,8 +311,7 @@ def initconfig_hardware_entries(self): entries.append(cmake_cache_option( "{}ENABLE_OPENMP_TARGET".format(option_prefix), "+openmp_target" in spec)) - if "+openmp_target" in spec: - if ('%xl' in spec): + if "+openmp_target" in spec and "%xl" in spec: entries.append(cmake_cache_string("OpenMP_CXX_FLAGS", "-qsmp;-qoffload")) return entries @@ -323,7 +320,7 @@ def initconfig_mpi_entries(self): spec = self.spec entries = super(Umpire, self).initconfig_mpi_entries() - entries.append(cmake_cache_option("ENABLE_MPI", '+mpi' in spec)) + entries.append(cmake_cache_option("ENABLE_MPI", "+mpi" in spec)) return entries @@ -392,7 +389,7 @@ def initconfig_package_entries(self): "UMPIRE_ENABLE_SQLITE_EXPERIMENTAL", "+sqlite_experimental" in spec)) if "+sqlite_experimental" in spec: entries.append(cmake_cache_path( - "SQLite3_ROOT" ,spec['sqlite'].prefix)) + "SQLite3_ROOT" ,spec["sqlite"].prefix)) # This option was renamed later than the others if spec.satisfies("@2022.10.0:"): From 1ccd68b3dacc072d566361286ea4a3d000d6b209 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 1 Dec 2022 09:17:46 +0100 Subject: [PATCH 17/63] Fix flag syntax --- .gitlab/lassen-build-and-test-extra.yml | 4 ++-- .gitlab/ruby-build-and-test-extra.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index dc9922cd..b9ab70c5 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -54,13 +54,13 @@ clang_9_0_0_libcpp (build and test on lassen): clang_9_0_0_memleak (build and test on lassen): variables: - SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=-fsanitize=address" + SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=\"-fsanitize=address\"" ASAN_OPTIONS: "detect_leaks=1" extends: .build_and_test_on_lassen clang_9_0_0_datarace (build and test on lassen): variables: - SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=-fsanitize=thread" + SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=\"-fsanitize=thread\"" allow_failure: true extends: .build_and_test_on_lassen diff --git a/.gitlab/ruby-build-and-test-extra.yml b/.gitlab/ruby-build-and-test-extra.yml index b9651811..2f55713c 100644 --- a/.gitlab/ruby-build-and-test-extra.yml +++ b/.gitlab/ruby-build-and-test-extra.yml @@ -15,7 +15,7 @@ # Overriding shared spec: Allow failures pgi_20_1_gcc_local_8_3_1: variables: - SPEC: "${PROJECT_RUBY_VARIANTS} %pgi@20.1 cxxflags\"=-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" cflags\"=-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" fflags=\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" ${PROJECT_RUBY_DEPS}" + SPEC: "${PROJECT_RUBY_VARIANTS} %pgi@20.1 cxxflags=\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" cflags=\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" fflags=\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" ${PROJECT_RUBY_DEPS}" extends: .build_and_test_on_ruby allow_failure: true From 282c5da18b5af26011ec1291eb2ca82870ab18e2 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 1 Dec 2022 09:20:53 +0100 Subject: [PATCH 18/63] Update spack (without shared CI update) --- .gitlab/lassen-build-and-test-extra.yml | 12 ++++++------ .gitlab/ruby-build-and-test-extra.yml | 2 +- .uberenv_config.json | 2 +- scripts/radiuss-spack-configs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index b9ab70c5..6deb3c47 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -16,21 +16,21 @@ pgi_20_4_gcc_8_3_1: extends: .build_and_test_on_lassen variables: - SPEC: "${PROJECT_LASSEN_VARIANTS} %pgi@20.4 cxxflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ${PROJECT_LASSEN_DEPS}" + SPEC: "${PROJECT_LASSEN_VARIANTS} %pgi@20.4 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ${PROJECT_LASSEN_DEPS}" allow_failure: true # Overriding shared spec: Allow failures : known to fail at raja install ibm_clang_9_0_0_gcc_8_3_1_cuda_10_1_168: extends: .build_and_test_on_lassen variables: - SPEC: " ${PROJECT_LASSEN_VARIANTS} +cuda %clang@ibm.9.0.0 cxxflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@10.1.168 ${PROJECT_LASSEN_DEPS}" + SPEC: " ${PROJECT_LASSEN_VARIANTS} +cuda %clang@ibm.9.0.0 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@10.1.168 ${PROJECT_LASSEN_DEPS}" allow_failure: true # Spec has test disabled in shared CI, conflicting with default test setting in Umpire # TODO: This is likely an issue in RADIUSS Shared CI: why disable tests ?. xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: variables: - SPEC: "~shared +raja +cuda tests=none %xl@16.1.1.12 cxxflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags=\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@11.0.2 ${PROJECT_LASSEN_DEPS}" + SPEC: "~shared +raja +cuda tests=none %xl@16.1.1.12 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@11.0.2 ${PROJECT_LASSEN_DEPS}" extends: .build_and_test_on_lassen @@ -49,18 +49,18 @@ ibm_clang_9_0_0_cuda_10_1_168: clang_9_0_0_libcpp (build and test on lassen): variables: - SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\" cflags=\"-DGTEST_HAS_CXXABI_H_=0\"" + SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags==\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\" cflags==\"-DGTEST_HAS_CXXABI_H_=0\"" extends: .build_and_test_on_lassen clang_9_0_0_memleak (build and test on lassen): variables: - SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=\"-fsanitize=address\"" + SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags==\"-fsanitize=address\"" ASAN_OPTIONS: "detect_leaks=1" extends: .build_and_test_on_lassen clang_9_0_0_datarace (build and test on lassen): variables: - SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags=\"-fsanitize=thread\"" + SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags==\"-fsanitize=thread\"" allow_failure: true extends: .build_and_test_on_lassen diff --git a/.gitlab/ruby-build-and-test-extra.yml b/.gitlab/ruby-build-and-test-extra.yml index 2f55713c..8ff8be18 100644 --- a/.gitlab/ruby-build-and-test-extra.yml +++ b/.gitlab/ruby-build-and-test-extra.yml @@ -15,7 +15,7 @@ # Overriding shared spec: Allow failures pgi_20_1_gcc_local_8_3_1: variables: - SPEC: "${PROJECT_RUBY_VARIANTS} %pgi@20.1 cxxflags=\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" cflags=\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" fflags=\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" ${PROJECT_RUBY_DEPS}" + SPEC: "${PROJECT_RUBY_VARIANTS} %pgi@20.1 cxxflags==\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" cflags==\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" fflags==\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" ${PROJECT_RUBY_DEPS}" extends: .build_and_test_on_ruby allow_failure: true diff --git a/.uberenv_config.json b/.uberenv_config.json index 87a898b9..3768800d 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -4,7 +4,7 @@ "package_final_phase" : "initconfig", "package_source_dir" : "../..", "spack_url": "https://github.com/spack/spack.git", -"spack_branch": "v0.18.1", +"spack_branch": "v0.19.0", "spack_activate" : {}, "spack_configs_path": "scripts/radiuss-spack-configs", "spack_packages_path": "scripts/spack_packages", diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 8d955b4a..bf8f0bc9 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 8d955b4a49406a12dc44f1a9baab7ab7fa9c68df +Subproject commit bf8f0bc9217a81b580f3ce1e9d85243f0762adc8 From a67f97a49f693ea118d5e19814b5c5ad1f7406ad Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 1 Dec 2022 09:24:46 +0100 Subject: [PATCH 19/63] Update shared CI --- .gitlab-ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca5fce7d..94c29e02 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,9 @@ # We define the following GitLab pipeline variables: variables: +# Required information about GitHub repository + GITHUB_PROJECT_NAME: "CHAI" + GITHUB_PROJECT_ORG: "LLNL" # Use the umdev LLNL service user to run CI. This prevents from running # pipelines as an actual user. LLNL_SERVICE_USER: umdev @@ -49,13 +52,17 @@ stages: include: - local: '.gitlab/custom-jobs-and-variables.yml' - project: 'radiuss/radiuss-shared-ci' - ref: v2022.09.0 + ref: woptim/v2022.12.0rc file: '${CI_MACHINE}-build-and-test.yml' - local: '.gitlab/${CI_MACHINE}-build-and-test-extra.yml' strategy: depend forward: pipeline_variables: true -# pipelines subscribed by the project include: + # [Optional] checks preliminary to running the actual CI test + #- project: 'radiuss/radiuss-shared-ci' + # ref: woptim/2022.12.0rc + # file: 'preliminary-ignore-draft-pr.yml' + # pipelines subscribed by the project - local: .gitlab/subscribed-pipelines.yml From 45e6ed3a1151e57d28895e9c4398b45d302794a1 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 1 Dec 2022 09:37:02 +0100 Subject: [PATCH 20/63] Fix typo --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94c29e02..829a5bd3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,7 +52,7 @@ stages: include: - local: '.gitlab/custom-jobs-and-variables.yml' - project: 'radiuss/radiuss-shared-ci' - ref: woptim/v2022.12.0rc + ref: woptim/2022.12.0rc file: '${CI_MACHINE}-build-and-test.yml' - local: '.gitlab/${CI_MACHINE}-build-and-test-extra.yml' strategy: depend From d75ea13e02824ac75dddc63fa0cb60354d8a48a2 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Wed, 7 Dec 2022 21:55:28 +0100 Subject: [PATCH 21/63] Move local packages to radiuss-spack-configs --- .uberenv_config.json | 2 +- scripts/radiuss-spack-configs | 2 +- scripts/spack_packages/blt/package.py | 40 -- scripts/spack_packages/camp/package.py | 98 ---- scripts/spack_packages/chai/package.py | 281 ----------- scripts/spack_packages/raja/package.py | 309 ------------ .../umpire/camp_target_umpire_3.0.0.patch | 18 - .../umpire/cmake_version_check.patch | 13 - .../missing_header_for_numeric_limits.patch | 12 - scripts/spack_packages/umpire/package.py | 441 ------------------ .../umpire/std-filesystem-pr784.patch | 33 -- 11 files changed, 2 insertions(+), 1247 deletions(-) delete mode 100644 scripts/spack_packages/blt/package.py delete mode 100644 scripts/spack_packages/camp/package.py delete mode 100644 scripts/spack_packages/chai/package.py delete mode 100644 scripts/spack_packages/raja/package.py delete mode 100644 scripts/spack_packages/umpire/camp_target_umpire_3.0.0.patch delete mode 100644 scripts/spack_packages/umpire/cmake_version_check.patch delete mode 100644 scripts/spack_packages/umpire/missing_header_for_numeric_limits.patch delete mode 100644 scripts/spack_packages/umpire/package.py delete mode 100644 scripts/spack_packages/umpire/std-filesystem-pr784.patch diff --git a/.uberenv_config.json b/.uberenv_config.json index 3768800d..e3ff682b 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -7,7 +7,7 @@ "spack_branch": "v0.19.0", "spack_activate" : {}, "spack_configs_path": "scripts/radiuss-spack-configs", -"spack_packages_path": "scripts/spack_packages", +"spack_packages_path": "scripts/radiuss-spack-configs/packages", "spack_concretizer": "clingo", "spack_setup_clingo": false } diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index bf8f0bc9..c6317d35 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit bf8f0bc9217a81b580f3ce1e9d85243f0762adc8 +Subproject commit c6317d351c7b8f5b8816b79bd2f266e7f011f961 diff --git a/scripts/spack_packages/blt/package.py b/scripts/spack_packages/blt/package.py deleted file mode 100644 index 87fb122d..00000000 --- a/scripts/spack_packages/blt/package.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - - -class Blt(Package): - """BLT is a streamlined CMake-based foundation for Building, Linking and - Testing large-scale high performance computing (HPC) applications.""" - - homepage = "https://github.com/LLNL/blt" - url = "https://github.com/LLNL/blt/archive/v0.4.0.tar.gz" - git = "https://github.com/LLNL/blt.git" - tags = ["radiuss"] - - maintainers = ["white238", "davidbeckingsale"] - - version("develop", branch="develop") - version("main", branch="main") - # Note: 0.4.0+ contains a breaking change to BLT created targets - # if you export targets this could cause problems in downstream - # projects if not handled properly. More info here: - # https://llnl-blt.readthedocs.io/en/develop/tutorial/exporting_targets.html - version("0.5.2", sha256="95b924cfbb2bddd9b1a92e96603b2fd485a19721d59ddf8ff50baefc1714d7ea") - version("0.5.1", sha256="ff7e87eefc48704a0721b66174612b945955adaa0a56aa69dd0473074fa4badf") - version("0.5.0", sha256="5f680ef922d0e0a7ff1b1a5fc8aa107cd4f543ad888cbc9b12639bea72a6ab1f") - version("0.4.1", sha256="16cc3e067ddcf48b99358107e5035a17549f52dcc701a35cd18a9d9f536826c1") - version("0.4.0", sha256="f3bc45d28b9b2eb6df43b75d4f6f89a1557d73d012da7b75bac1be0574767193") - version("0.3.6", sha256="6276317c29e7ff8524fbea47d9288ddb40ac06e9f9da5e878bf9011e2c99bf71") - version("0.3.5", sha256="68a1c224bb9203461ae6f5ab0ff3c50b4a58dcce6c2d2799489a1811f425fb84") - version("0.3.0", sha256="bb917a67cb7335d6721c997ba9c5dca70506006d7bba5e0e50033dd0836481a5") - version("0.2.5", sha256="3a000f60194e47b3e5623cc528cbcaf88f7fea4d9620b3c7446ff6658dc582a5") - version("0.2.0", sha256="c0cadf1269c2feb189e398a356e3c49170bc832df95e5564e32bdbb1eb0fa1b3") - - depends_on("cmake", type="run") - - def install(self, spec, prefix): - install_tree(".", prefix) diff --git a/scripts/spack_packages/camp/package.py b/scripts/spack_packages/camp/package.py deleted file mode 100644 index 4e25af80..00000000 --- a/scripts/spack_packages/camp/package.py +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import glob - -from spack.package import * - - -def hip_repair_options(options, spec): - # there is only one dir like this, but the version component is unknown - options.append( - "-DHIP_CLANG_INCLUDE_PATH=" - + glob.glob("{}/lib/clang/*/include".format(spec["llvm-amdgpu"].prefix))[0] - ) - - -def hip_repair_cache(options, spec): - # there is only one dir like this, but the version component is unknown - options.append( - cmake_cache_path( - "HIP_CLANG_INCLUDE_PATH", - glob.glob("{}/lib/clang/*/include".format(spec["llvm-amdgpu"].prefix))[0], - ) - ) - - -class Camp(CMakePackage, CudaPackage, ROCmPackage): - """ - Compiler agnostic metaprogramming library providing concepts, - type operations and tuples for C++ and cuda - """ - - homepage = "https://github.com/LLNL/camp" - git = "https://github.com/LLNL/camp.git" - url = "https://github.com/LLNL/camp/archive/v0.1.0.tar.gz" - - maintainers = ["trws"] - - version("main", branch="main", submodules="True") - version("2022.10.0", sha256="3561c3ef00bbcb61fe3183c53d49b110e54910f47e7fc689ad9ccce57e55d6b8") - version("2022.03.2", sha256="bc4aaeacfe8f2912e28f7a36fc731ab9e481bee15f2c6daf0cb208eed3f201eb") - version("2022.03.0", sha256="e9090d5ee191ea3a8e36b47a8fe78f3ac95d51804f1d986d931e85b8f8dad721") - version("0.3.0", sha256="129431a049ca5825443038ad5a37a86ba6d09b2618d5fe65d35f83136575afdb") - version("0.2.3", sha256="58a0f3bd5eadb588d7dc83f3d050aff8c8db639fc89e8d6553f9ce34fc2421a7") - version("0.2.2", sha256="194d38b57e50e3494482a7f94940b27f37a2bee8291f2574d64db342b981d819") - version("0.1.0", sha256="fd4f0f2a60b82a12a1d9f943f8893dc6fe770db493f8fae5ef6f7d0c439bebcc") - - # 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") - - depends_on("cub", when="+cuda") - - depends_on("blt") - - def cmake_args(self): - spec = self.spec - - options = [] - - options.append("-DBLT_SOURCE_DIR={0}".format(spec["blt"].prefix)) - - if "+cuda" in spec: - options.extend([ - "-DENABLE_CUDA=ON", - "-DCUDA_TOOLKIT_ROOT_DIR=%s" % (spec["cuda"].prefix) - ]) - - if not spec.satisfies("cuda_arch=none"): - cuda_arch = spec.variants["cuda_arch"].value - options.append("-DCMAKE_CUDA_ARCHITECTURES={0}".format(cuda_arch[0])) - options.append("-DCUDA_ARCH=sm_{0}".format(cuda_arch[0])) - flag = "-arch sm_{0}".format(cuda_arch[0]) - options.append("-DCMAKE_CUDA_FLAGS:STRING={0}".format(flag)) - else: - options.append("-DENABLE_CUDA=OFF") - - if "+rocm" in spec: - options.extend([ - "-DENABLE_HIP=ON", - "-DHIP_ROOT_DIR={0}".format(spec["hip"].prefix) - ]) - - hip_repair_options(options, spec) - - archs = self.spec.variants["amdgpu_target"].value - if archs != "none": - arch_str = ",".join(archs) - options.append("-DHIP_HIPCC_FLAGS=--amdgpu-target={0}".format(arch_str)) - else: - options.append("-DENABLE_HIP=OFF") - - options.append(self.define_from_variant("ENABLE_OPENMP", "openmp")) - options.append(self.define_from_variant("ENABLE_TESTS", "tests")) - - return options diff --git a/scripts/spack_packages/chai/package.py b/scripts/spack_packages/chai/package.py deleted file mode 100644 index f1dcad61..00000000 --- a/scripts/spack_packages/chai/package.py +++ /dev/null @@ -1,281 +0,0 @@ -# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import os -import socket - -from spack.package import * -from spack.pkg.builtin.camp import hip_repair_cache - -import re - - -class Chai(CachedCMakePackage, CudaPackage, ROCmPackage): - """ - Copy-hiding array interface for data migration between memory spaces - """ - - homepage = "https://github.com/LLNL/CHAI" - git = "https://github.com/LLNL/CHAI.git" - tags = ["ecp", "e4s", "radiuss"] - - maintainers = ["davidbeckingsale"] - - version("develop", branch="develop", submodules=False) - version("main", branch="main", submodules=False) - version("2022.10.0", tag="v2022.10.0", submodules=False) - version("2022.03.0", tag="v2022.03.0", submodules=False) - version("2.4.0", tag="v2.4.0", submodules=True) - version("2.3.0", tag="v2.3.0", submodules=True) - version("2.2.2", tag="v2.2.2", submodules=True) - version("2.2.1", tag="v2.2.1", submodules=True) - version("2.2.0", tag="v2.2.0", submodules=True) - version("2.1.1", tag="v2.1.1", submodules=True) - version("2.1.0", tag="v2.1.0", submodules=True) - version("2.0.0", tag="v2.0.0", submodules=True) - version("1.2.0", tag="v1.2.0", submodules=True) - version("1.1.0", tag="v1.1.0", submodules=True) - version("1.0", tag="v1.0", submodules=True) - - variant("enable_pick", default=False, description="Enable pick method") - variant("shared", default=True, description="Build Shared Libs") - variant("raja", default=False, description="Build plugin for RAJA") - variant("examples", default=True, description="Build examples.") - variant("openmp", default=False, description="Build using OpenMP") - # TODO: figure out gtest dependency and then set this default True - # and remove the +tests conflict below. - variant( - "tests", - default="none", - values=("none", "basic", "benchmarks"), - multi=False, - description="Tests to run", - ) - - depends_on("cmake@3.8:", type="build") - depends_on("cmake@3.9:", type="build", when="+cuda") - depends_on("cmake@3.14:", type="build", when="@2022.03.0:") - - depends_on("blt@0.5.2:", type="build", when="@2022.10.0:") - depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") - depends_on("blt@0.4.1:", type="build", when="@2.4.0:") - depends_on("blt@0.4.0:", type="build", when="@2.3.0") - depends_on("blt@0.3.6:", type="build", when="@:2.2.2") - - depends_on("umpire") - depends_on("umpire@2022.10.0:", when="@2022.10.0:") - depends_on("umpire@2022.03.0:", when="@2022.03.0:") - depends_on("umpire@6.0.0", when="@2.4.0") - depends_on("umpire@4.1.2", when="@2.2.0:2.3.0") - depends_on("umpire@main", when="@main") - - with when("+cuda"): - depends_on("umpire+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("umpire+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - - with when("+rocm"): - depends_on("umpire+rocm") - for arch in ROCmPackage.amdgpu_targets: - depends_on( - "umpire+rocm amdgpu_target={0}".format(arch), when="amdgpu_target={0}".format(arch) - ) - - with when("+raja"): - depends_on("raja~openmp", when="~openmp") - depends_on("raja+openmp", when="+openmp") - depends_on("raja@0.14.0", when="@2.4.0") - depends_on("raja@0.13.0", when="@2.3.0") - depends_on("raja@0.12.0", when="@2.2.0:2.2.2") - depends_on("raja@2022.03.0:", when="@2022.03.0:") - depends_on("raja@2022.10.0:", when="@2022.10.0:") - depends_on("raja@main", when="@main") - - with when("+cuda"): - depends_on("raja+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("raja+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - with when("+rocm"): - depends_on("raja+rocm") - for arch in ROCmPackage.amdgpu_targets: - depends_on( - "raja+rocm amdgpu_target={0}".format(arch), - when="amdgpu_target={0}".format(arch), - ) - - def _get_sys_type(self, spec): - sys_type = spec.architecture - if "SYS_TYPE" in env: - sys_type = env["SYS_TYPE"] - return sys_type - - @property - def cache_name(self): - hostname = socket.gethostname() - if "SYS_TYPE" in env: - hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}-{4}.cmake".format( - hostname, - self._get_sys_type(self.spec), - self.spec.compiler.name, - self.spec.compiler.version, - self.spec.dag_hash(8) - ) - - ### From local package, improved with umpire package implementation - def spec_uses_toolchain(self, spec): - gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") - using_toolchain = list(filter(gcc_toolchain_regex.match, spec.compiler_flags['cxxflags'])) - return using_toolchain - - ### From local package, improved with umpire package implementation - def spec_uses_gccname(self, spec): - gcc_name_regex = re.compile(".*gcc-name.*") - using_gcc_name = list(filter(gcc_name_regex.match, spec.compiler_flags['cxxflags'])) - return using_gcc_name - - def initconfig_compiler_entries(self): - spec = self.spec - entries = super(Chai, self).initconfig_compiler_entries() - - # adrienbernede-22-11: - # This was in upstream Spack raja package, but it’s causing the follwing failure Umpire: - # CMake Error in src/umpire/CMakeLists.txt: - # No known features for CXX compiler - # - # In CHAI, we see another error: - # [ 15%] Linking C executable ../../../tests/blt_hip_runtime_c_smoke - # clang (LLVM option parsing): for the --amdgpu-early-inline-all option: may only occur zero or one times! - # clang (LLVM option parsing): for the --amdgpu-function-calls option: may only occur zero or one times! - # We suspect this error comes from the use of hip compiler here, so we comment it: - # - #if "+rocm" in spec: - # entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - - return entries - - ### From local package: - fortran_compilers = ["gfortran", "xlf"] - if any(compiler in self.compiler.fc for compiler in fortran_compilers) and ("clang" in self.compiler.cxx): - # Pass fortran compiler lib as rpath to find missing libstdc++ - libdir = os.path.join(os.path.dirname( - os.path.dirname(self.compiler.fc)), "lib") - flags = "" - for _libpath in [libdir, libdir + "64"]: - if os.path.exists(_libpath): - flags += " -Wl,-rpath,{0}".format(_libpath) - description = ("Adds a missing libstdc++ rpath") - if flags: - entries.append(cmake_cache_string("BLT_EXE_LINKER_FLAGS", flags, description)) - - # Ignore conflicting default gcc toolchain - entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) - - compilers_using_toolchain = ["pgi", "xl", "icpc"] - if any(compiler in self.compiler.cxx for compiler in compilers_using_toolchain): - if self.spec_uses_toolchain(self.spec) or self.spec_uses_gccname(self.spec): - - # Ignore conflicting default gcc toolchain - entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) - - def initconfig_hardware_entries(self): - spec = self.spec - entries = super(Chai, self).initconfig_hardware_entries() - - if "+cuda" in spec: - entries.append(cmake_cache_option("ENABLE_CUDA", True)) - entries.append(cmake_cache_option("CMAKE_CUDA_SEPARABLE_COMPILATION", True)) - entries.append(cmake_cache_option("CUDA_SEPARABLE_COMPILATION", True)) - - cuda_flags = [] - if not spec.satisfies("cuda_arch=none"): - cuda_arch = spec.variants["cuda_arch"].value - cuda_flags.append("-arch sm_{0}".format(cuda_arch[0])) - entries.append( - cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) - entries.append( - cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0]))) - entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", " ".join(cuda_flags))) - else: - entries.append(cmake_cache_option("ENABLE_CUDA", False)) - - if "+rocm" in spec: - entries.append(cmake_cache_option("ENABLE_HIP", True)) - entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) - hip_repair_cache(entries, spec) - archs = self.spec.variants["amdgpu_target"].value - if archs != "none": - arch_str = ",".join(archs) - entries.append( - cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) - ) - entries.append( - cmake_cache_string("CMAKE_HIP_ARCHITECTURES", arch_str) - ) - else: - entries.append(cmake_cache_option("ENABLE_HIP", False)) - - return entries - - def initconfig_package_entries(self): - spec = self.spec - entries = [] - - option_prefix = "CHAI_" if spec.satisfies("@2022.03.0:") else "" - - # TPL locations - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# TPLs") - entries.append("#------------------{0}\n".format("-" * 60)) - - entries.append(cmake_cache_path( - "BLT_SOURCE_DIR", spec["blt"].prefix)) - if "+raja" in spec: - entries.append(cmake_cache_option( - "{}ENABLE_RAJA_PLUGIN".format(option_prefix), True)) - entries.append(cmake_cache_path( - "RAJA_DIR", spec["raja"].prefix)) - entries.append(cmake_cache_path( - "umpire_DIR", spec["umpire"].prefix)) - - # Build options - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# Build Options") - entries.append("#------------------{0}\n".format("-" * 60)) - - # Build options - entries.append(cmake_cache_string( - "CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) - entries.append(cmake_cache_option( - "BUILD_SHARED_LIBS", "+shared" in spec)) - - # Generic options that have a prefixed equivalent in CHAI CMake - entries.append(cmake_cache_option( - "ENABLE_OPENMP", "+openmp" in spec)) - entries.append(cmake_cache_option( - "ENABLE_EXAMPLES", "+examples" in spec)) - entries.append(cmake_cache_option( - "ENABLE_DOCS", False)) - if "tests=benchmarks" in spec: - # BLT requires ENABLE_TESTS=True to enable benchmarks - entries.append(cmake_cache_option( - "ENABLE_BENCHMARKS", True)) - entries.append(cmake_cache_option( - "ENABLE_TESTS", True)) - else: - entries.append(cmake_cache_option( - "ENABLE_TESTS", "tests=none" not in spec)) - - # Prefixed options that used to be name without one - entries.append(cmake_cache_option( - "{}ENABLE_PICK".format(option_prefix), "+enable_pick" in spec)) - - return entries - - def cmake_args(self): - options = [] - return options diff --git a/scripts/spack_packages/raja/package.py b/scripts/spack_packages/raja/package.py deleted file mode 100644 index 875e6310..00000000 --- a/scripts/spack_packages/raja/package.py +++ /dev/null @@ -1,309 +0,0 @@ -# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import socket -import glob - -from spack.package import * -from spack.pkg.builtin.camp import hip_repair_cache - - -class Raja(CachedCMakePackage, CudaPackage, ROCmPackage): - """RAJA Parallel Framework.""" - - homepage = "https://software.llnl.gov/RAJA/" - git = "https://github.com/LLNL/RAJA.git" - tags = ["radiuss", "e4s"] - - maintainers = ["davidbeckingsale"] - - version("develop", branch="develop", submodules=False) - version("main", branch="main", submodules=False) - version("2022.10.1", tag="v2022.10.1", submodules=False) - version("2022.10.0", tag="v2022.10.0", submodules=False) - version("2022.03.1", tag="v2022.03.1", submodules=False) - version("2022.03.0", tag="v2022.03.0", submodules=False) - version("0.14.0", tag="v0.14.0", submodules="True") - version("0.13.0", tag="v0.13.0", submodules="True") - version("0.12.1", tag="v0.12.1", submodules="True") - version("0.12.0", tag="v0.12.0", submodules="True") - version("0.11.0", tag="v0.11.0", submodules="True") - version("0.10.1", tag="v0.10.1", submodules="True") - version("0.10.0", tag="v0.10.0", submodules="True") - version("0.9.0", tag="v0.9.0", submodules="True") - version("0.8.0", tag="v0.8.0", submodules="True") - version("0.7.0", tag="v0.7.0", submodules="True") - version("0.6.0", tag="v0.6.0", submodules="True") - version("0.5.3", tag="v0.5.3", submodules="True") - version("0.5.2", tag="v0.5.2", submodules="True") - version("0.5.1", tag="v0.5.1", submodules="True") - version("0.5.0", tag="v0.5.0", submodules="True") - version("0.4.1", tag="v0.4.1", submodules="True") - version("0.4.0", tag="v0.4.0", submodules="True") - - # export targets when building pre-2.4.0 release with BLT 0.4.0+ - patch( - "https://github.com/LLNL/RAJA/commit/eca1124ee4af380d6613adc6012c307d1fd4176b.patch?full_index=1", - sha256="12bb78c00b6683ad3e7fd4e3f87f9776bae074b722431b79696bc862816735ef", - when="@:0.13.0 ^blt@0.4:", - ) - - variant("openmp", default=True, description="Build OpenMP backend") - variant("shared", default=True, description="Build Shared Libs") - variant("examples", default=True, description="Build examples.") - variant("exercises", default=True, description="Build exercises.") - # TODO: figure out gtest dependency and then set this default True - # and remove the +tests conflict below. - variant("tests", default=False, description="Build tests") - variant("libcpp", default=False, description="Uses libc++ instead of libstdc++") - variant("desul", default=False, description="Build Desul Atomics backend") - - depends_on("blt") - depends_on("blt@0.5.2:", type="build", when="@2022.10.0:") - depends_on("blt@0.5.0:", type="build", when="@0.14.1:") - depends_on("blt@0.4.1", type="build", when="@0.14.0") - depends_on("blt@0.4.0:", type="build", when="@0.13.0") - depends_on("blt@0.3.6:", type="build", when="@:0.12.0") - - depends_on("camp@0.2.2:0.2.3", when="@0.14.0") - depends_on("camp@0.1.0", when="@0.10.0:0.13.0") - depends_on("camp@2022.10.0:", when="@2022.10.0:") - depends_on("camp@2022.03.2:", when="@2022.03.0:") - depends_on("camp@main", when="@main") - depends_on("camp@main", when="@develop") - depends_on("camp+openmp", when="+openmp") - - depends_on("cmake@3.20:", when="@2022.10.0:", type="build") - depends_on("cmake@3.23:", when="@2022.10.0: +rocm", type="build") - depends_on("cmake@3.14:", when="@2022.03.0:", type="build") - depends_on("cmake@:3.20", when="@2022.03.0:2022.03 +rocm", type="build") - - depends_on("llvm-openmp", when="+openmp %apple-clang") - - depends_on("rocprim", when="+rocm") - with when("+rocm @0.12.0:"): - depends_on("camp+rocm") - for arch in ROCmPackage.amdgpu_targets: - depends_on( - "camp+rocm amdgpu_target={0}".format(arch), when="amdgpu_target={0}".format(arch) - ) - conflicts("+openmp") - - with when("+cuda @0.12.0:"): - depends_on("camp+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("camp +cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - - def _get_sys_type(self, spec): - sys_type = spec.architecture - if "SYS_TYPE" in env: - sys_type = env["SYS_TYPE"] - return sys_type - - @property - # TODO: name cache file conditionally to cuda and libcpp variants - def cache_name(self): - hostname = socket.gethostname() - if "SYS_TYPE" in env: - hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}-{4}.cmake".format( - hostname, - self._get_sys_type(self.spec), - self.spec.compiler.name, - self.spec.compiler.version, - self.spec.dag_hash(8) - ) - - def initconfig_compiler_entries(self): - spec = self.spec - # Default entries are already defined in CachedCMakePackage, inherit them: - entries = super(Raja, self).initconfig_compiler_entries() - - # Switch to hip as a CPP compiler. - # adrienbernede-22-11: - # This was only done in upstream Spack raja package. - # I could not find the equivalent logic in Spack source, so keeping it. - if "+rocm" in spec: - entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - - # Override CachedCMakePackage CMAKE_C_FLAGS and CMAKE_CXX_FLAGS add - # +libcpp specific flags - flags = spec.compiler_flags - - # use global spack compiler flags - cppflags = " ".join(flags["cppflags"]) - if cppflags: - # avoid always ending up with " " with no flags defined - cppflags += " " - - cflags = cppflags + " ".join(flags["cflags"]) - if "+libcpp" in spec: - cflags += " ".join([cflags,"-DGTEST_HAS_CXXABI_H_=0"]) - if cflags: - entries.append(cmake_cache_string("CMAKE_C_FLAGS", cflags)) - - cxxflags = cppflags + " ".join(flags["cxxflags"]) - if "+libcpp" in spec: - cxxflags += " ".join([cxxflags,"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0"]) - if cxxflags: - entries.append(cmake_cache_string("CMAKE_CXX_FLAGS", cxxflags)) - - return entries - - def initconfig_hardware_entries(self): - spec = self.spec - entries = super(Raja, self).initconfig_hardware_entries() - - entries.append(cmake_cache_option("ENABLE_OPENMP", "+openmp" in spec)) - - if "+cuda" in spec: - entries.append(cmake_cache_option("ENABLE_CUDA", True)) - - if not spec.satisfies("cuda_arch=none"): - cuda_arch = spec.variants["cuda_arch"].value - entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) - entries.append( - cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) - ) - else: - entries.append(cmake_cache_option("ENABLE_CUDA", False)) - - if "+rocm" in spec: - entries.append(cmake_cache_option("ENABLE_HIP", True)) - entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) - hip_repair_cache(entries, spec) - archs = self.spec.variants["amdgpu_target"].value - if archs != "none": - arch_str = ",".join(archs) - entries.append( - cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) - ) - entries.append( - cmake_cache_string("CMAKE_HIP_ARCHITECTURES", arch_str) - ) - else: - entries.append(cmake_cache_option("ENABLE_HIP", False)) - - return entries - - def initconfig_package_entries(self): - spec = self.spec - entries = [] - - option_prefix = "RAJA_" if spec.satisfies("@0.14.0:") else "" - - # TPL locations - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# TPLs") - entries.append("#------------------{0}\n".format("-" * 60)) - - entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) - if "camp" in self.spec: - entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) - - # Build options - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# Build Options") - entries.append("#------------------{0}\n".format("-" * 60)) - - entries.append(cmake_cache_string( - "CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) - entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) - - entries.append(cmake_cache_option("RAJA_ENABLE_DESUL_ATOMICS", "+desul" in spec)) - - if "+desul" in spec: - entries.append(cmake_cache_string("BLT_CXX_STD","c++14")) - if "+cuda" in spec: - entries.append(cmake_cache_string("CMAKE_CUDA_STANDARD", "14")) - - entries.append( - cmake_cache_option("{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec) - ) - if spec.satisfies("@0.14.0:"): - entries.append( - cmake_cache_option( - "{}ENABLE_EXERCISES".format(option_prefix), "+exercises" in spec - ) - ) - else: - entries.append(cmake_cache_option("ENABLE_EXERCISES", "+exercises" in spec)) - - ### #TODO: Treat the workaround when building tests with spack wrapper - ### # For now, removing it to test CI, which builds tests outside of wrapper. - ### # Work around spack adding -march=ppc64le to SPACK_TARGET_ARGS which - ### # is used by the spack compiler wrapper. This can go away when BLT - ### # removes -Werror from GTest flags - ### if self.spec.satisfies("%clang target=ppc64le:") or ( not self.run_tests and not "+tests" in spec): - if not self.run_tests and not "+tests" in spec: - entries.append(cmake_cache_option("ENABLE_TESTS", False)) - else: - entries.append(cmake_cache_option("ENABLE_TESTS", True)) - - entries.append(cmake_cache_option("RAJA_HOST_CONFIG_LOADED", True)) - - return entries - - def cmake_args(self): - options = [] - return options - - @property - def build_relpath(self): - """Relative path to the cmake build subdirectory.""" - return join_path("..", self.build_dirname) - - @run_after("install") - def setup_build_tests(self): - """Copy the build test files after the package is installed to a - relative install test subdirectory for use during `spack test run`.""" - # Now copy the relative files - self.cache_extra_test_sources(self.build_relpath) - - # Ensure the path exists since relying on a relative path at the - # same level as the normal stage source path. - mkdirp(self.install_test_root) - - @property - def _extra_tests_path(self): - # TODO: The tests should be converted to re-build and run examples - # TODO: using the installed libraries. - return join_path(self.install_test_root, self.build_relpath, "bin") - - def _test_examples(self): - """Perform very basic checks on a subset of copied examples.""" - checks = [ - ( - "ex5_line-of-sight_solution", - [r"RAJA sequential", r"RAJA OpenMP", r"result -- PASS"], - ), - ( - "ex6_stencil-offset-layout_solution", - [r"RAJA Views \(permuted\)", r"result -- PASS"], - ), - ( - "ex8_tiled-matrix-transpose_solution", - [r"parallel top inner loop", r"collapsed inner loops", r"result -- PASS"], - ), - ("kernel-dynamic-tile", [r"Running index", r"(24,24)"]), - ("plugin-example", [r"Launching host kernel for the 10 time"]), - ("tut_batched-matrix-multiply", [r"result -- PASS"]), - ("wave-eqn", [r"Max Error = 2", r"Evolved solution to time"]), - ] - for exe, expected in checks: - reason = "test: checking output of {0} for {1}".format(exe, expected) - self.run_test( - exe, - [], - expected, - installed=False, - purpose=reason, - skip_missing=True, - work_dir=self._extra_tests_path, - ) - - def test(self): - """Perform smoke tests.""" - self._test_examples() diff --git a/scripts/spack_packages/umpire/camp_target_umpire_3.0.0.patch b/scripts/spack_packages/umpire/camp_target_umpire_3.0.0.patch deleted file mode 100644 index 2deb565c..00000000 --- a/scripts/spack_packages/umpire/camp_target_umpire_3.0.0.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/umpire-config.cmake.in b/umpire-config.cmake.in -index a98ad5fe..4e54e173 100644 ---- a/umpire-config.cmake.in -+++ b/umpire-config.cmake.in -@@ -7,6 +7,13 @@ - get_filename_component(UMPIRE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) - set(UMPIRE_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") - -+if (NOT TARGET camp) -+ if (NOT DEFINED camp_DIR) -+ set(camp_DIR @CMAKE_INSTALL_PREFIX@/lib/cmake/camp) -+ endif () -+ find_package(camp REQUIRED) -+endif () -+ - set(Umpire_VERSION_MAJOR @Umpire_VERSION_MAJOR@) - set(Umpire_VERSION_MINOR @Umpire_VERSION_MINOR@) - set(Umpire_VERSION_PATCH @Umpire_VERSION_PATCH@) diff --git a/scripts/spack_packages/umpire/cmake_version_check.patch b/scripts/spack_packages/umpire/cmake_version_check.patch deleted file mode 100644 index 05f80e0b..00000000 --- a/scripts/spack_packages/umpire/cmake_version_check.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/umpire/CMakeLists.txt b/src/umpire/CMakeLists.txt -index 18518f13..c2e45e03 100644 ---- a/src/umpire/CMakeLists.txt -+++ b/src/umpire/CMakeLists.txt -@@ -105,7 +105,7 @@ blt_add_library( - DEPENDS_ON ${umpire_depends} - DEFINES ${umpire_defines}) - --if (NOT WIN32 AND CMAKE_VERSION VERSION_GREATER 3.17) -+if (NOT WIN32 AND NOT ${CMAKE_VERSION} VERSION_LESS 3.18) - target_link_options( - umpire INTERFACE - $>:-rdynamic>> diff --git a/scripts/spack_packages/umpire/missing_header_for_numeric_limits.patch b/scripts/spack_packages/umpire/missing_header_for_numeric_limits.patch deleted file mode 100644 index 6e89e370..00000000 --- a/scripts/spack_packages/umpire/missing_header_for_numeric_limits.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/umpire/util/allocation_statistics.cpp b/src/umpire/util/allocation_statistics.cpp -index 597ae61f..0c3f7865 100644 ---- a/src/umpire/util/allocation_statistics.cpp -+++ b/src/umpire/util/allocation_statistics.cpp -@@ -8,6 +8,7 @@ - #include "umpire/util/allocation_statistics.hpp" - - #include -+#include - - namespace umpire { - namespace util { diff --git a/scripts/spack_packages/umpire/package.py b/scripts/spack_packages/umpire/package.py deleted file mode 100644 index fb54fbfc..00000000 --- a/scripts/spack_packages/umpire/package.py +++ /dev/null @@ -1,441 +0,0 @@ -# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import os -import socket - -import llnl.util.tty as tty - -from spack.package import * -from spack.pkg.builtin.camp import hip_repair_cache - -import re - - -class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): - """An application-focused API for memory management on NUMA & GPU - architectures""" - - homepage = "https://github.com/LLNL/Umpire" - git = "https://github.com/LLNL/Umpire.git" - tags = ["radiuss", "e4s"] - - maintainers = ["davidbeckingsale"] - - version("develop", branch="develop", submodules=False) - version("main", branch="main", submodules=False) - version("2022.10.0", tag="v2022.10.0", submodules=False) - version("2022.03.1", tag="v2022.03.1", submodules=False) - version("2022.03.0", tag="v2022.03.0", submodules=False) - version("6.0.0", tag="v6.0.0", submodules=True) - version("5.0.1", tag="v5.0.1", submodules=True) - version("5.0.0", tag="v5.0.0", submodules=True) - version("4.1.2", tag="v4.1.2", submodules=True) - version("4.1.1", tag="v4.1.1", submodules=True) - version("4.1.0", tag="v4.1.0", submodules=True) - version("4.0.1", tag="v4.0.1", submodules=True) - version("4.0.0", tag="v4.0.0", submodules=True) - version("3.0.0", tag="v3.0.0", submodules=True) - version("2.1.0", tag="v2.1.0", submodules=True) - version("2.0.0", tag="v2.0.0", submodules=True) - version("1.1.0", tag="v1.1.0", submodules=True) - version("1.0.1", tag="v1.0.1", submodules=True) - version("1.0.0", tag="v1.0.0", submodules=True) - version("0.3.5", tag="v0.3.5", submodules=True) - version("0.3.4", tag="v0.3.4", submodules=True) - version("0.3.3", tag="v0.3.3", submodules=True) - version("0.3.2", tag="v0.3.2", submodules=True) - version("0.3.1", tag="v0.3.1", submodules=True) - version("0.3.0", tag="v0.3.0", submodules=True) - version("0.2.4", tag="v0.2.4", submodules=True) - version("0.2.3", tag="v0.2.3", submodules=True) - version("0.2.2", tag="v0.2.2", submodules=True) - version("0.2.1", tag="v0.2.1", submodules=True) - version("0.2.0", tag="v0.2.0", submodules=True) - version("0.1.4", tag="v0.1.4", submodules=True) - version("0.1.3", tag="v0.1.3", submodules=True) - - patch("std-filesystem-pr784.patch", when="@2022.03.1 +rocm ^blt@0.5.2:") - patch("camp_target_umpire_3.0.0.patch", when="@3.0.0") - patch("cmake_version_check.patch", when="@4.1") - patch("missing_header_for_numeric_limits.patch", when="@4.1:5.0.1") - - # export targets when building pre-6.0.0 release with BLT 0.4.0+ - patch( - "https://github.com/LLNL/Umpire/commit/5773ce9af88952c8d23f9bcdcb2e503ceda40763.patch?full_index=1", - sha256="f3b21335ce5cf9c0fecc852a94dfec90fb5703032ac97f9fee104af9408d8899", - when="@:5.0.1 ^blt@0.4:", - ) - - variant("fortran", default=False, description="Build C/Fortran API") - variant("c", default=True, description="Build C API") - variant("mpi", default=False, description="Enable MPI support") - variant("ipc_shmem", default=False, description="Enable POSIX shared memory") - variant("sqlite_experimental", default=False, description="Enable sqlite integration with umpire events (Experimental)") - variant("numa", default=False, description="Enable NUMA support") - variant("shared", default=True, description="Enable Shared libs") - variant("openmp", default=False, description="Build with OpenMP support") - variant("openmp_target", default=False, description="Build with OpenMP 4.5 support") - variant("deviceconst", default=False, description="Enables support for constant device memory") - variant("examples", default=True, description="Build Umpire Examples") - variant( - "tests", - default="none", - values=("none", "basic", "benchmarks"), - multi=False, - description="Tests to run", - ) - variant("libcpp", default=False, description="Uses libc++ instead of libstdc++") - variant("tools", default=False, description="Enable tools") - variant("backtrace", default=False, description="Enable backtrace tools") - variant("dev_benchmarks", default=False, description="Enable Developer Benchmarks") - variant("device_alloc", default=True, description="Enable DeviceAllocator") - variant("werror", default=True, description="Enable warnings as errors") - variant("asan", default=False, description="Enable ASAN") - variant("sanitizer_tests", default=False, description="Enable address sanitizer tests") - - depends_on("cmake@3.8:", type="build") - depends_on("cmake@3.9:", when="+cuda", type="build") - depends_on("cmake@:3.20", when="+rocm", type="build") - depends_on("cmake@3.14:", when="@2022.03.0:") - - depends_on("blt@0.5.2:", type="build", when="@2022.10.0:") - depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") - depends_on("blt@0.4.1", type="build", when="@6.0.0") - depends_on("blt@0.4.0:", type="build", when="@4.1.3:5.0.1") - depends_on("blt@0.3.6:", type="build", when="@:4.1.2") - - depends_on("camp", when="@5.0.0:") - depends_on("camp@0.2.2:0.2.3", when="@6.0.0") - depends_on("camp@0.1.0", when="@5.0.0:5.0.1") - depends_on("camp@2022.03.2:", when="@2022.03.0:") - depends_on("camp@2022.10.0:", when="@2022.10.0:") - depends_on("camp@main", when="@main") - depends_on("camp@main", when="@develop") - depends_on("camp+openmp", when="+openmp") - - depends_on("sqlite", when="+sqlite_experimental") - depends_on("mpi", when="+mpi") - - with when("@5.0.0:"): - with when("+cuda"): - depends_on("camp+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("camp+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - - with when("+rocm"): - depends_on("camp+rocm") - for arch_ in ROCmPackage.amdgpu_targets: - depends_on( - "camp+rocm amdgpu_target={0}".format(arch_), - when="amdgpu_target={0}".format(arch_), - ) - - conflicts("+numa", when="@:0.3.2") - conflicts("~c", when="+fortran", msg="Fortran API requires C API") - - conflicts("+device_alloc", when="@:2022.03.0") - conflicts("+deviceconst", when="~rocm~cuda") - conflicts("+device_alloc", when="~rocm~cuda") - - conflicts("~openmp", when="+openmp_target", msg="OpenMP target requires OpenMP") - conflicts("+cuda", when="+rocm") - conflicts("+tools", when="+rocm") - conflicts("+rocm", when="+openmp_target", msg="Cant support both rocm and openmp device backends at once") - conflicts("~mpi", when="+ipc_shmem", msg="Shared Memory Allocator requires MPI") - conflicts("+ipc_shmem", when="@:5.0.1") - - conflicts("+sqlite_experimental", when="@:6.0.0") - conflicts("+sanitizer_tests", when="~asan") - - # device allocator exports device code, which requires static libs - # currently only available for cuda. - conflicts("+shared", when="+cuda") - - # https://github.com/LLNL/Umpire/issues/653 - # This range looks weird, but it ensures the concretizer looks at it as a - # range, not as a concrete version, so that it also matches 10.3.* versions. - conflicts("%gcc@10.3.0:10.3", when="+cuda") - - def _get_sys_type(self, spec): - sys_type = spec.architecture - if "SYS_TYPE" in env: - sys_type = env["SYS_TYPE"] - return sys_type - - @property - def cache_name(self): - hostname = socket.gethostname() - if "SYS_TYPE" in env: - hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}-{4}.cmake".format( - hostname, - self._get_sys_type(self.spec), - self.spec.compiler.name, - self.spec.compiler.version, - self.spec.dag_hash(8) - ) - - def spec_uses_toolchain(self, spec): - gcc_toolchain_regex = re.compile(".*gcc-toolchain.*") - using_toolchain = list(filter(gcc_toolchain_regex.match, spec.compiler_flags["cxxflags"])) - return using_toolchain - - def spec_uses_gccname(self, spec): - gcc_name_regex = re.compile(".*gcc-name.*") - using_gcc_name = list(filter(gcc_name_regex.match, spec.compiler_flags["cxxflags"])) - return using_gcc_name - - def initconfig_compiler_entries(self): - spec = self.spec - # Default entries are already defined in CachedCMakePackage, inherit them: - entries = super(Umpire, self).initconfig_compiler_entries() - - # adrienbernede-22-11: - # This was in upstream Spack raja package, but it’s causing the follwing failure: - # CMake Error in src/umpire/CMakeLists.txt: - # No known features for CXX compiler - # - #if "+rocm" in spec: - # entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - - option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" - - if "+fortran" in spec and self.compiler.fc is not None: - entries.append(cmake_cache_option("ENABLE_FORTRAN", True)) - else: - entries.append(cmake_cache_option("ENABLE_FORTRAN", False)) - - entries.append(cmake_cache_option("{}ENABLE_C".format(option_prefix), "+c" in spec)) - - ### From local package: - fortran_compilers = ["gfortran", "xlf"] - if any(compiler in self.compiler.fc for compiler in fortran_compilers) and ("clang" in self.compiler.cxx): - # Pass fortran compiler lib as rpath to find missing libstdc++ - libdir = os.path.join(os.path.dirname( - os.path.dirname(self.compiler.fc)), "lib") - flags = "" - for _libpath in [libdir, libdir + "64"]: - if os.path.exists(_libpath): - flags += " -Wl,-rpath,{0}".format(_libpath) - description = ("Adds a missing libstdc++ rpath") - if flags: - entries.append(cmake_cache_string("BLT_EXE_LINKER_FLAGS", flags, description)) - - # Ignore conflicting default gcc toolchain - entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) - - compilers_using_toolchain = ["pgi", "xl", "icpc"] - if any(compiler in self.compiler.cxx for compiler in compilers_using_toolchain): - if self.spec_uses_toolchain(self.spec) or self.spec_uses_gccname(self.spec): - - # Ignore conflicting default gcc toolchain - entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3")) - - #adrienbernede-22-11: - # Specific to Umpire local package, worth sharing? - entries = [x for x in entries if not "COMPILER_ID" in x] - - return entries - - def initconfig_hardware_entries(self): - spec = self.spec - entries = super(Umpire, self).initconfig_hardware_entries() - - option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" - - if "+cuda" in spec: - entries.append(cmake_cache_option("ENABLE_CUDA", True)) - - cuda_flags = [] - if not spec.satisfies("cuda_arch=none"): - cuda_arch = spec.variants["cuda_arch"].value - cuda_flags.append("-arch sm_{0}".format(cuda_arch[0])) - entries.append( - cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) - entries.append( - cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0]))) - if self.spec_uses_toolchain(self.spec): - cuda_flags.append("-Xcompiler {}".format(self.spec_uses_toolchain(self.spec)[0])) - if (spec.satisfies("%gcc@8.1: target=ppc64le")): - cuda_flags.append("-Xcompiler -mno-float128") - entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", " ".join(cuda_flags))) - - entries.append( - cmake_cache_option( - "{}ENABLE_DEVICE_CONST".format(option_prefix), spec.satisfies("+deviceconst") - ) - ) - else: - entries.append(cmake_cache_option("ENABLE_CUDA", False)) - - if "+rocm" in spec: - entries.append(cmake_cache_option("ENABLE_HIP", True)) - - hip_root = spec["hip"].prefix - rocm_root = hip_root + "/.." - entries.append(cmake_cache_path("HIP_ROOT_DIR", hip_root)) - entries.append(cmake_cache_path("ROCM_ROOT_DIR", rocm_root)) - - hip_repair_cache(entries, spec) - archs = self.spec.variants["amdgpu_target"].value - if archs != "none": - arch_str = ",".join(archs) - entries.append( - cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) - ) - entries.append( - cmake_cache_string("CMAKE_HIP_ARCHITECTURES", arch_str) - ) - - # adrienbernede-22-11: - # Specific to Umpire, should we port to RAJA and CHAI? - hip_link_flags = "" - if "%gcc" in spec: - gcc_bin = os.path.dirname(self.compiler.cxx) - gcc_prefix = join_path(gcc_bin, "..") - entries.append(cmake_cache_string("HIP_CLANG_FLAGS", "--gcc-toolchain={0}".format(gcc_prefix))) - entries.append(cmake_cache_string("CMAKE_EXE_LINKER_FLAGS", hip_link_flags + " -Wl,-rpath {}/lib64".format(gcc_prefix))) - else: - entries.append(cmake_cache_string("CMAKE_EXE_LINKER_FLAGS", "-Wl,-rpath={0}/llvm/lib/".format(rocm_root))) - - else: - entries.append(cmake_cache_option("ENABLE_HIP", False)) - - entries.append(cmake_cache_option( - "{}ENABLE_DEVICE_CONST".format(option_prefix), "+deviceconst" in spec)) - - entries.append(cmake_cache_option( - "{}ENABLE_OPENMP_TARGET".format(option_prefix), "+openmp_target" in spec)) - if "+openmp_target" in spec and "%xl" in spec: - entries.append(cmake_cache_string("OpenMP_CXX_FLAGS", "-qsmp;-qoffload")) - - return entries - - def initconfig_mpi_entries(self): - spec = self.spec - - entries = super(Umpire, self).initconfig_mpi_entries() - entries.append(cmake_cache_option("ENABLE_MPI", "+mpi" in spec)) - - return entries - - def initconfig_package_entries(self): - spec = self.spec - entries = [] - - option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" - - # TPL locations - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# TPLs") - entries.append("#------------------{0}\n".format("-" * 60)) - - entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) - if spec.satisfies("@5.0.0:"): - entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) - - # Build options - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# Build Options") - entries.append("#------------------{0}\n".format("-" * 60)) - - entries.append(cmake_cache_string( - "CMAKE_BUILD_TYPE", spec.variants["build_type"].value)) - entries.append(cmake_cache_option( - "BUILD_SHARED_LIBS", "+shared" in spec)) - entries.append(cmake_cache_option( - "ENABLE_WARNINGS_AS_ERRORS", "+werror" in spec)) - - # Generic options that have a prefixed equivalent in Umpire CMake - entries.append(cmake_cache_option( - "ENABLE_OPENMP", "+openmp" in spec)) - entries.append(cmake_cache_option( - "ENABLE_EXAMPLES", "+examples" in spec)) - entries.append(cmake_cache_option( - "ENABLE_DOCS", False)) - if "tests=benchmarks" in spec or "+dev_benchmarks" in spec: - # BLT requires ENABLE_TESTS=True to enable benchmarks - entries.append(cmake_cache_option( - "ENABLE_BENCHMARKS", True)) - entries.append(cmake_cache_option( - "ENABLE_TESTS", True)) - else: - entries.append(cmake_cache_option( - "ENABLE_TESTS", "tests=none" not in spec)) - - # Prefixed options that used to be name without one - entries.append(cmake_cache_option( - "{}ENABLE_NUMA".format(option_prefix), "+numa" in spec)) - entries.append(cmake_cache_option( - "{}ENABLE_DEVELOPER_BENCHMARKS".format(option_prefix), "+dev_benchmarks" in spec)) - entries.append(cmake_cache_option( - "{}ENABLE_TOOLS".format(option_prefix), "+tools" in spec)) - entries.append(cmake_cache_option( - "{}ENABLE_BACKTRACE".format(option_prefix), "+backtrace" in spec)) - entries.append(cmake_cache_option( - "{}ENABLE_ASAN".format(option_prefix), "+asan" in spec)) - entries.append(cmake_cache_option( - "{}ENABLE_SANITIZER_TESTS".format(option_prefix), "+sanitizer_tests" in spec)) - - # Recent options, were never name without prefix - entries.append(cmake_cache_option( - "UMPIRE_ENABLE_DEVICE_ALLOCATOR", "+device_alloc" in spec)) - entries.append(cmake_cache_option( - "UMPIRE_ENABLE_SQLITE_EXPERIMENTAL", "+sqlite_experimental" in spec)) - if "+sqlite_experimental" in spec: - entries.append(cmake_cache_path( - "SQLite3_ROOT" ,spec["sqlite"].prefix)) - - # This option was renamed later than the others - if spec.satisfies("@2022.10.0:"): - entries.append(cmake_cache_option( - "UMPIRE_ENABLE_IPC_SHARED_MEMORY", "+ipc_shmem" in spec)) - else: - entries.append(cmake_cache_option( - "ENABLE_IPC_SHARED_MEMORY", "+ipc_shmem" in spec)) - - return entries - - def cmake_args(self): - options = [] - return options - - def test(self): - """Perform stand-alone checks on the installed package.""" - if self.spec.satisfies("@:1") or not os.path.isdir(self.prefix.bin): - tty.info("Skipping: checks not installed in bin for v{0}".format(self.version)) - return - - # Run a subset of examples PROVIDED installed - # tutorials with readily checkable outputs. - checks = { - "malloc": ["99 should be 99"], - "recipe_dynamic_pool_heuristic": ["in the pool", "releas"], - "recipe_no_introspection": ["has allocated", "used"], - "strategy_example": ["Available allocators", "HOST"], - "tut_copy": ["Copied source data"], - "tut_introspection": ["Allocator used is HOST", "size of the allocation"], - "tut_memset": ["Set data from HOST"], - "tut_move": ["Moved source data", "HOST"], - "tut_reallocate": ["Reallocated data"], - "vector_allocator": [""], - } - - for exe in checks: - expected = checks[exe] - reason = "test: checking output from {0}".format(exe) - self.run_test( - exe, - [], - expected, - 0, - installed=False, - purpose=reason, - skip_missing=True, - work_dir=self.prefix.bin, - ) diff --git a/scripts/spack_packages/umpire/std-filesystem-pr784.patch b/scripts/spack_packages/umpire/std-filesystem-pr784.patch deleted file mode 100644 index 67714421..00000000 --- a/scripts/spack_packages/umpire/std-filesystem-pr784.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -ruN spack-src/cmake/SetupCompilerFlags.cmake spack-src-patched/cmake/SetupCompilerFlags.cmake ---- spack-src/cmake/SetupCompilerFlags.cmake 2022-10-12 08:05:03.538390165 -0700 -+++ spack-src-patched/cmake/SetupCompilerFlags.cmake 2022-10-12 09:47:56.317645003 -0700 -@@ -11,20 +11,20 @@ - - message(STATUS "Checking for std::filesystem") - --include(CheckCXXSourceCompiles) --check_cxx_source_compiles( -- "#include -- #include -- -- int main(int, char**) -- { -+blt_check_code_compiles(CODE_COMPILES UMPIRE_ENABLE_FILESYSTEM -+ SOURCE_STRING -+[=[ -+#include -+#include - -+int main(int, char**) -+{ - auto path = std::filesystem::path(\".\"); - (void)(path); - - return 0; -- }" -- UMPIRE_ENABLE_FILESYSTEM) -+} -+]=]) - - if (UMPIRE_ENABLE_FILESYSTEM) - message(STATUS "std::filesystem found") From 809e5953805f95d1f6c25cb30b32d9ece0c6b661 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Wed, 7 Dec 2022 22:22:53 +0100 Subject: [PATCH 22/63] Update with improved CHAI package --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index c6317d35..e869d627 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit c6317d351c7b8f5b8816b79bd2f266e7f011f961 +Subproject commit e869d6276af1e00163acd31f8ada1d65ba15b984 From 8485f339bd2b592627a39fd1cd46d1b928f3f0ff Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 15 Dec 2022 11:33:45 +0100 Subject: [PATCH 23/63] Update radiuss-spack-configs to main ref, update radiuss-shared-ci to latest release, add tioga --- .gitlab-ci.yml | 4 ++-- .gitlab/custom-jobs-and-variables.yml | 10 ++++++++++ .gitlab/subscribed-pipelines.yml | 5 +++++ .gitlab/tioga-build-and-test-extra.yml | 9 +++++++++ scripts/radiuss-spack-configs | 2 +- 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .gitlab/tioga-build-and-test-extra.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 829a5bd3..f1c19bd3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,7 +52,7 @@ stages: include: - local: '.gitlab/custom-jobs-and-variables.yml' - project: 'radiuss/radiuss-shared-ci' - ref: woptim/2022.12.0rc + ref: v2022.12.0 file: '${CI_MACHINE}-build-and-test.yml' - local: '.gitlab/${CI_MACHINE}-build-and-test-extra.yml' strategy: depend @@ -62,7 +62,7 @@ stages: include: # [Optional] checks preliminary to running the actual CI test #- project: 'radiuss/radiuss-shared-ci' - # ref: woptim/2022.12.0rc + # ref: v2022.12.0 # file: 'preliminary-ignore-draft-pr.yml' # pipelines subscribed by the project - local: .gitlab/subscribed-pipelines.yml diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml index 2a053413..68d0f1c9 100644 --- a/.gitlab/custom-jobs-and-variables.yml +++ b/.gitlab/custom-jobs-and-variables.yml @@ -33,6 +33,16 @@ variables: # Project specific deps for corona PROJECT_CORONA_DEPS: "" +# Tioga +# Arguments for top level allocation + TIOGA_BUILD_AND_TEST_SHARED_ALLOC: "--time-limit=30m --nodes=1" +# Arguments for job level allocation + TIOGA_BUILD_AND_TEST_JOB_ALLOC: "--time-limit=30m --nodes=1" +# Project specific variants for tioga + PROJECT_TIOGA_VARIANTS: "~shared +raja tests=basic " +# Project specific deps for tioga + PROJECT_TIOGA_DEPS: "" + # Lassen and Butte use a different job scheduler (spectrum lsf) that does not # allow pre-allocation the same way slurm does. # Arguments for job level allocation diff --git a/.gitlab/subscribed-pipelines.yml b/.gitlab/subscribed-pipelines.yml index 24a02b0d..89fa2793 100644 --- a/.gitlab/subscribed-pipelines.yml +++ b/.gitlab/subscribed-pipelines.yml @@ -16,6 +16,11 @@ corona-build-and-test: CI_MACHINE: "corona" extends: [.build-and-test] +tioga-build-and-test: + variables: + CI_MACHINE: "tioga" + extends: [.build-and-test] + lassen-build-and-test: variables: CI_MACHINE: "lassen" diff --git a/.gitlab/tioga-build-and-test-extra.yml b/.gitlab/tioga-build-and-test-extra.yml new file mode 100644 index 00000000..c96489c5 --- /dev/null +++ b/.gitlab/tioga-build-and-test-extra.yml @@ -0,0 +1,9 @@ +############################################################################## +# Copyright (c) 2022, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the COPYRIGHT file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################## + +variables: + INCLUDED_FILE_CANNOT_BE_EMPTY: "True" diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index e869d627..33b86c80 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit e869d6276af1e00163acd31f8ada1d65ba15b984 +Subproject commit 33b86c80bd5d4b556a5c95d62f4efdd4f309f5c5 From def14a6bd5347e99f9639ddaade17563529237a5 Mon Sep 17 00:00:00 2001 From: Arturo Vargas Date: Thu, 15 Dec 2022 15:44:26 -0800 Subject: [PATCH 24/63] Add CHAI + RAJA launch integration test. (#219) --- src/tpl/raja | 2 +- tests/integration/CMakeLists.txt | 23 +- tests/integration/raja-chai-launch.cpp | 409 +++++++++++++++++++++++++ 3 files changed, 430 insertions(+), 4 deletions(-) create mode 100644 tests/integration/raja-chai-launch.cpp diff --git a/src/tpl/raja b/src/tpl/raja index 4351fe6a..c2a6b174 160000 --- a/src/tpl/raja +++ b/src/tpl/raja @@ -1 +1 @@ -Subproject commit 4351fe6a50bd579511a625b017c9e054885e7fd2 +Subproject commit c2a6b1740759ae3ae7c85b35e20dbffbe235355d diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt index b29a5046..e551cf21 100644 --- a/tests/integration/CMakeLists.txt +++ b/tests/integration/CMakeLists.txt @@ -39,14 +39,14 @@ if (CHAI_ENABLE_MANAGED_PTR) NAME managed_ptr_test COMMAND managed_ptr_tests) endif () - + if (CHAI_ENABLE_RAJA_PLUGIN) set(raja_test_depends ${chai_integration_test_depends} RAJA) blt_add_executable( - NAME raja-chai-tests + NAME raja-chai-tests SOURCES raja-chai-tests.cpp DEPENDS_ON ${raja_test_depends}) @@ -59,8 +59,9 @@ if (CHAI_ENABLE_RAJA_PLUGIN) PUBLIC ${PROJECT_BINARY_DIR}/include) if (CHAI_ENABLE_RAJA_NESTED_TEST) +#raja kernel tests blt_add_executable( - NAME raja-chai-nested-tests + NAME raja-chai-nested-tests SOURCES raja-chai-nested.cpp DEPENDS_ON ${raja_test_depends}) @@ -71,5 +72,21 @@ if (CHAI_ENABLE_RAJA_PLUGIN) target_include_directories( raja-chai-nested-tests PUBLIC ${PROJECT_BINARY_DIR}/include) + +#raja launch tests + blt_add_executable( + NAME raja-chai-launch-tests + SOURCES raja-chai-launch.cpp + DEPENDS_ON ${raja_test_depends}) + + blt_add_test( + NAME raja-chai-launch-tests + COMMAND raja-chai-launch-tests) + + target_include_directories( + raja-chai-launch-tests + PUBLIC ${PROJECT_BINARY_DIR}/include) + endif () + endif () diff --git a/tests/integration/raja-chai-launch.cpp b/tests/integration/raja-chai-launch.cpp new file mode 100644 index 00000000..13dfcf77 --- /dev/null +++ b/tests/integration/raja-chai-launch.cpp @@ -0,0 +1,409 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2016-20, Lawrence Livermore National Security, LLC and CHAI +// project contributors. See the COPYRIGHT file for details. +// +// SPDX-License-Identifier: BSD-3-Clause +////////////////////////////////////////////////////////////////////////////// +/// +/// Source file containing tests for CHAI in RAJA nested loops. +/// +/// +#include +#include +#include + +#include +#include +#include + +#include "RAJA/RAJA.hpp" + +using namespace RAJA; +using namespace std; + +#include "chai/ArrayManager.hpp" +#include "chai/ManagedArrayView.hpp" +#include "chai/ManagedArray.hpp" + +#include "gtest/gtest.h" + +// TODO: add hip policy for these tests. +#if defined(RAJA_ENABLE_CUDA) +#define PARALLEL_RAJA_DEVICE __device__ +#elif defined(RAJA_ENABLE_OPENMP) +#define PARALLEL_RAJA_DEVICE +#else +#define PARALLEL_RAJA_DEVICE +#endif + +#define CUDA_TEST(X, Y) \ + static void cuda_test_##X##_##Y(); \ + TEST(X, Y) { cuda_test_##X##_##Y(); } \ + static void cuda_test_##X##_##Y() + +/* + * Simple tests using nested::forall and View + */ +CUDA_TEST(Chai, LaunchSimple) +{ + + using LAUNCH_POLICY = RAJA::LaunchPolicy; + using LOOP_POLICY_0 = RAJA::LoopPolicy; + using LOOP_POLICY_1 = RAJA::LoopPolicy; + +#if defined(RAJA_ENABLE_CUDA) + + const bool async = false; + using PARALLEL_LAUNCH_POLICY = RAJA::LaunchPolicy>; + using PARALLEL_LOOP_POLICY_0 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_1 = RAJA::LoopPolicy; + +#elif defined(RAJA_ENABLE_OPENMP) + + using PARALLEL_LAUNCH_POLICY = RAJA::LaunchPolicy; + using PARALLEL_LOOP_POLICY_0 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_1 = RAJA::LoopPolicy; + +#else + using PARALLEL_LAUNCH_POLICY = LAUNCH_POLICY; + using PARALLEL_LOOP_POLICY_0 = LOOP_POLICY_0; + using PARALLEL_LOOP_POLICY_1 = LOOP_POLICY_1; +#endif + + const int X = 16; + const int Y = 16; + + chai::ManagedArray v1(X * Y); + chai::ManagedArray v2(X * Y); + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::RangeSegment(0, X), [&] (int i) { + RAJA::loop(ctx, RAJA::RangeSegment(0, Y), [&] (int j) { + int index = j * X + i; + v1[index] = index; + }); + }); + }); + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::RangeSegment(0, X), [&] (int i) { + RAJA::loop(ctx, RAJA::RangeSegment(0, Y), [&] (int j) { + int index = j * X + i; + v2[index] = v1[index] * 2.0f; + }); + }); + }); + + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::RangeSegment(0, X), [&] (int i) { + RAJA::loop(ctx, RAJA::RangeSegment(0, Y), [&] (int j) { + int index = j * X + i; + ASSERT_FLOAT_EQ(v1[index], index * 1.0f); + ASSERT_FLOAT_EQ(v2[index], index * 2.0f); + }); + }); + }); + + v1.free(); + v2.free(); +} + +CUDA_TEST(Chai, LaunchView) +{ + + using LAUNCH_POLICY = RAJA::LaunchPolicy; + using LOOP_POLICY_0 = RAJA::LoopPolicy; + using LOOP_POLICY_1 = RAJA::LoopPolicy; + +#if defined(RAJA_ENABLE_CUDA) + + const bool async = false; + using PARALLEL_LAUNCH_POLICY = RAJA::LaunchPolicy>; + using PARALLEL_LOOP_POLICY_0 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_1 = RAJA::LoopPolicy; + +#elif defined(RAJA_ENABLE_OPENMP) + + using PARALLEL_LAUNCH_POLICY = RAJA::LaunchPolicy; + using PARALLEL_LOOP_POLICY_0 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_1 = RAJA::LoopPolicy; + +#else + + using PARALLEL_LAUNCH_POLICY = LAUNCH_POLICY; + using PARALLEL_LOOP_POLICY_0 = LOOP_POLICY_0; + using PARALLEL_LOOP_POLICY_1 = LOOP_POLICY_1; +#endif + + const int X = 16; + const int Y = 16; + + chai::ManagedArray v1_array(X * Y); + chai::ManagedArray v2_array(X * Y); + + using view = chai::ManagedArrayView>; + + view v1(v1_array, X, Y); + view v2(v2_array, X, Y); + + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::RangeSegment(0, X), [&] (int i) { + RAJA::loop(ctx, RAJA::RangeSegment(0, Y), [&] (int j) { + v1(i, j) = (i + (j * X)) * 1.0f; + }); + }); + }); + + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::RangeSegment(0, X), [&] (int i) { + RAJA::loop(ctx, RAJA::RangeSegment(0, Y), [&] (int j) { + v2(i, j) = v1(i, j) * 2.0f; + }); + }); + }); + + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::RangeSegment(0, X), [&] (int i) { + RAJA::loop(ctx, RAJA::RangeSegment(0, Y), [&] (int j) { + ASSERT_FLOAT_EQ(v2(i, j), v1(i, j) * 2.0f); + }); + }); + }); + + v1_array.free(); + v2_array.free(); +} + +CUDA_TEST(Chai, LaunchMultiView) +{ + + using LAUNCH_POLICY = RAJA::LaunchPolicy; + using LOOP_POLICY_0 = RAJA::LoopPolicy; + using LOOP_POLICY_1 = RAJA::LoopPolicy; + +#if defined(RAJA_ENABLE_CUDA) + + const bool async = false; + using PARALLEL_LAUNCH_POLICY = RAJA::LaunchPolicy>; + using PARALLEL_LOOP_POLICY_0 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_1 = RAJA::LoopPolicy; + +#elif defined(RAJA_ENABLE_OPENMP) + + using PARALLEL_LAUNCH_POLICY = RAJA::LaunchPolicy; + using PARALLEL_LOOP_POLICY_0 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_1 = RAJA::LoopPolicy; +#else + + using PARALLEL_LAUNCH_POLICY = LAUNCH_POLICY; + using PARALLEL_LOOP_POLICY_0 = LOOP_POLICY_0; + using PARALLEL_LOOP_POLICY_1 = LOOP_POLICY_1; +#endif + + const int X = 16; + const int Y = 16; + + chai::ManagedArray v1_array(X * Y); + chai::ManagedArray v2_array(X * Y); + + chai::ManagedArray all_arrays[2]; + all_arrays[0] = v1_array; + all_arrays[1] = v2_array; + + // default MultiView + using view = chai::ManagedArrayMultiView>; + view mview(all_arrays, RAJA::Layout<2>(X, Y)); + + // MultiView with index in 1st position + using view1p = chai::ManagedArrayMultiView, 1>; + view1p mview1p(all_arrays, RAJA::Layout<2>(X, Y)); + + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::RangeSegment(0, X), [&] (int i) { + RAJA::loop(ctx, RAJA::RangeSegment(0, Y), [&] (int j) { + mview(0, i, j) = (i + (j * X)) * 1.0f; + }); + }); + }); + + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::RangeSegment(0, X), [&] (int i) { + RAJA::loop(ctx, RAJA::RangeSegment(0, Y), [&] (int j) { + // use both MultiViews + mview(1, i, j) = mview1p(i, 0, j) * 2.0f; + }); + }); + }); + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::RangeSegment(0, X), [&] (int i) { + RAJA::loop(ctx, RAJA::RangeSegment(0, Y), [&] (int j) { + ASSERT_FLOAT_EQ(mview(1, i, j), mview(0, i, j) * 2.0f); + }); + }); + }); + + + v1_array.free(); + v2_array.free(); +} + +/////////////////////////////////////////////////////////////////////////// +// +// Example LTimes kernel test routines +// +// Demonstrates a 4-nested loop, the use of complex nested policies and +// the use of strongly-typed indices +// +// This routine computes phi(m, g, z) = SUM_d { ell(m, d)*psi(d,g,z) } +// +/////////////////////////////////////////////////////////////////////////// + +RAJA_INDEX_VALUE_T(IM, int, "IM"); +RAJA_INDEX_VALUE_T(ID, int, "ID"); +RAJA_INDEX_VALUE_T(IG, int, "IG"); +RAJA_INDEX_VALUE_T(IZ, int, "IZ"); + +void runLTimesTests(Index_type num_moments, + Index_type num_directions, + Index_type num_groups, + Index_type num_zones) +{ + // allocate data + // phi is initialized to all zeros, the others are randomized + chai::ManagedArray L_data(num_moments * num_directions); + chai::ManagedArray psi_data(num_directions * num_groups * num_zones); + chai::ManagedArray phi_data(num_moments * num_groups * num_zones); + + RAJA::forall( + RAJA::RangeSegment(0, (num_moments * num_directions)), + [=](int i) { + L_data[i] = i+2; + }); + + RAJA::forall( + RAJA::RangeSegment(0, (num_directions * num_groups * num_zones)), + [=](int i) { psi_data[i] = 2*i+1; }); + + RAJA::forall( + RAJA::RangeSegment(0, (num_moments * num_groups * num_zones)), + [=](int i) { phi_data[i] = 0.0; }); + + using LView = chai::TypedManagedArrayView, IM, ID>; + + // psi(d, g, z) : 2 -> z is stride-1 dimension + using PsiView = chai::TypedManagedArrayView, ID, IG, IZ>; + + // phi(m, g, z) : 2 -> z is stride-1 dimension + using PhiView = chai::TypedManagedArrayView, IM, IG, IZ>; + + std::array L_perm {{0, 1}}; + LView L(L_data, + RAJA::make_permuted_layout({{num_moments, num_directions}}, L_perm)); + + std::array psi_perm {{0, 1, 2}}; + PsiView psi(psi_data, + RAJA::make_permuted_layout({{num_directions, num_groups, num_zones}}, psi_perm)); + + std::array phi_perm {{0, 1, 2}}; + PhiView phi(phi_data, + RAJA::make_permuted_layout({{num_moments, num_groups, num_zones}}, phi_perm)); + +#if defined(RAJA_ENABLE_CUDA) + const bool async = false; + using PARALLEL_LAUNCH_POLICY = RAJA::LaunchPolicy>; + using PARALLEL_LOOP_POLICY_0 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_1 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_2 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_3 = RAJA::LoopPolicy; + +#elif defined(RAJA_ENABLE_OPENMP) + using PARALLEL_LAUNCH_POLICY = RAJA::LaunchPolicy; + using PARALLEL_LOOP_POLICY_0 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_1 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_2 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_3 = RAJA::LoopPolicy; +#else + using PARALLEL_LAUNCH_POLICY = RAJA::LaunchPolicy; + using PARALLEL_LOOP_POLICY_0 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_1 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_2 = RAJA::LoopPolicy; + using PARALLEL_LOOP_POLICY_3 = RAJA::LoopPolicy; +#endif + + RAJA::launch + (RAJA::LaunchParams(RAJA::Teams(1), RAJA::Threads(10)), + [=] RAJA_HOST_DEVICE(RAJA::LaunchContext ctx) + { + RAJA::loop(ctx, RAJA::TypedRangeSegment(0, num_moments), [&] (IM m) { + RAJA::loop(ctx, RAJA::TypedRangeSegment(0, num_groups), [&] (IG g) { + RAJA::loop(ctx, RAJA::TypedRangeSegment(0, num_zones ), [&] (IZ z) { + RAJA::loop(ctx, RAJA::TypedRangeSegment(0, num_directions ), [&] (ID d) { + phi(m, g, z) += L(m, d) * psi(d, g, z); + }); + }); + }); + }); + + }); + + RAJA::forall( + RAJA::TypedRangeSegment(0, num_moments), [=] (IM m) { + for (IG g(0); g < num_groups; ++g) { + for (IZ z(0); z < num_zones; ++z) { + double total = 0.0; + for (ID d(0); d < num_directions; ++d) { + double val = L(m, d) * psi(d, g, z); + total += val; + } + ASSERT_FLOAT_EQ(total, phi(m, g, z)); + } + } + }); + + L_data.free(); + psi_data.free(); + phi_data.free(); +} + +TEST(Chai, LaunchLTimes) +{ + // runLTimesTests(2, 0, 7, 3); + runLTimesTests(2, 3, 7, 3); + runLTimesTests(2, 3, 32, 4); + runLTimesTests(25, 96, 8, 32); + runLTimesTests(100, 15, 7, 13); +} From aae3ecb9032fefaa16fc2beb9ebbab8ed8d3c60b Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Fri, 16 Dec 2022 09:20:02 +0100 Subject: [PATCH 25/63] Allow failure with gcc 4.9, add cuda arch to cuda specs, update cuda to match RAJA config --- .gitlab/lassen-build-and-test-extra.yml | 9 ++++----- .gitlab/ruby-build-and-test-extra.yml | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 6deb3c47..87896a57 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -23,14 +23,14 @@ pgi_20_4_gcc_8_3_1: ibm_clang_9_0_0_gcc_8_3_1_cuda_10_1_168: extends: .build_and_test_on_lassen variables: - SPEC: " ${PROJECT_LASSEN_VARIANTS} +cuda %clang@ibm.9.0.0 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@10.1.168 ${PROJECT_LASSEN_DEPS}" + SPEC: " ${PROJECT_LASSEN_VARIANTS} +cuda %clang@ibm.9.0.0 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@10.1.168 ^raja + ${PROJECT_LASSEN_DEPS}" allow_failure: true # Spec has test disabled in shared CI, conflicting with default test setting in Umpire # TODO: This is likely an issue in RADIUSS Shared CI: why disable tests ?. xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: variables: - SPEC: "~shared +raja +cuda tests=none %xl@16.1.1.12 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ^cuda@11.0.2 ${PROJECT_LASSEN_DEPS}" + SPEC: "~shared +raja +cuda tests=none %xl@16.1.1.12 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@11.0.2 ${PROJECT_LASSEN_DEPS}" extends: .build_and_test_on_lassen @@ -41,10 +41,9 @@ xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: # ${PROJECT__DEPS} in the extra jobs. There is no reason not to fully # describe the spec here. -# In RAJA, this spec has an updated cuda (11.0.2), with cuda_arch=70 set. -ibm_clang_9_0_0_cuda_10_1_168: +ibm_clang_9_0_0_gcc_8_3_1_cuda_11_0_2: variables: - SPEC: "~shared +raja tests=basic +cuda %clang@ibm.9.0.0 ^cuda@10.1.168" + SPEC: "~shared +raja tests=basic +cuda %clang@ibm.9.0.0 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@10.1.168" extends: .build_and_test_on_lassen clang_9_0_0_libcpp (build and test on lassen): diff --git a/.gitlab/ruby-build-and-test-extra.yml b/.gitlab/ruby-build-and-test-extra.yml index 8ff8be18..f860c6ed 100644 --- a/.gitlab/ruby-build-and-test-extra.yml +++ b/.gitlab/ruby-build-and-test-extra.yml @@ -31,6 +31,7 @@ gcc_4_9_3: variables: SPEC: "~shared +raja tests=basic %gcc@4.9.3" extends: .build_and_test_on_ruby + allow_failure: true #clang_10_develop_tpls: # variables: From b8c6e062a09361af8b53e1c625e52e9eb441583b Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Fri, 16 Dec 2022 09:39:32 +0100 Subject: [PATCH 26/63] Update radiuss-spack-configs to add raja@2022.10.4 and fix cmake requirements with rocm --- scripts/radiuss-spack-configs | 2 +- src/tpl/raja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 33b86c80..b20b9e80 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 33b86c80bd5d4b556a5c95d62f4efdd4f309f5c5 +Subproject commit b20b9e80887607ec60a4b1e98dd7ac516ce1bc91 diff --git a/src/tpl/raja b/src/tpl/raja index c2a6b174..4351fe6a 160000 --- a/src/tpl/raja +++ b/src/tpl/raja @@ -1 +1 @@ -Subproject commit c2a6b1740759ae3ae7c85b35e20dbffbe235355d +Subproject commit 4351fe6a50bd579511a625b017c9e054885e7fd2 From 9510efd33b06e4443b15447eebb7dad761822654 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Mon, 19 Dec 2022 10:11:46 -0800 Subject: [PATCH 27/63] Release v2022.10.0 (#217) --- CMakeLists.txt | 2 +- README.md | 2 +- blt | 2 +- docs/sphinx/conf.py | 4 ++-- docs/sphinx/conf.py.in | 4 ++-- scripts/make_release_tarball.sh | 2 +- src/tpl/umpire | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52e844b1..9f4fdfde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_policy(SET CMP0025 NEW) include(CMakeDependentOption) include(CMakePackageConfigHelpers) -project(Chai LANGUAGES C CXX VERSION 2022.03.0) +project(Chai LANGUAGES C CXX VERSION 2022.10.0) cmake_minimum_required(VERSION 3.14) include(cmake/SetupChaiOptions.cmake) diff --git a/README.md b/README.md index 145630ca..6879b1ea 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# CHAI v2022.03.0 +# CHAI v2022.10.0 [![Azure Build Status](https://dev.azure.com/davidbeckingsale/CHAI/_apis/build/status/LLNL.CHAI?branchName=develop)](https://dev.azure.com/davidbeckingsale/CHAI/_build/latest?definitionId=2&branchName=develop) [![Build Status](https://travis-ci.org/LLNL/CHAI.svg?branch=develop)](https://travis-ci.org/LLNL/CHAI) diff --git a/blt b/blt index 296bf64e..84fe0d15 160000 --- a/blt +++ b/blt @@ -1 +1 @@ -Subproject commit 296bf64e64edfcfcce6a53e3b396d6529e76b986 +Subproject commit 84fe0d15d841a79d923e97a9105b86b59147bfed diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index f6f3755b..7eca619d 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -61,9 +61,9 @@ # built documents. # # The short X.Y version. -version = u'2022.03' +version = u'2022.10' # The full version, including alpha/beta/rc tags. -release = u'2022.03.0' +release = u'2022.10.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/sphinx/conf.py.in b/docs/sphinx/conf.py.in index 84fa5a62..b2c5924e 100644 --- a/docs/sphinx/conf.py.in +++ b/docs/sphinx/conf.py.in @@ -60,9 +60,9 @@ author = u'' # built documents. # # The short X.Y version. -version = u'2022.03' +version = u'2022.10' # The full version, including alpha/beta/rc tags. -release = u'2022.03.0' +release = u'2022.10.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/scripts/make_release_tarball.sh b/scripts/make_release_tarball.sh index f755a49d..d479741e 100755 --- a/scripts/make_release_tarball.sh +++ b/scripts/make_release_tarball.sh @@ -7,7 +7,7 @@ ############################################################################## TAR_CMD=gtar -VERSION=2022.03.0 +VERSION=2022.10.0 git archive --prefix=chai-${VERSION}/ -o chai-${VERSION}.tar HEAD 2> /dev/null diff --git a/src/tpl/umpire b/src/tpl/umpire index 2db6224a..93b1441a 160000 --- a/src/tpl/umpire +++ b/src/tpl/umpire @@ -1 +1 @@ -Subproject commit 2db6224ae0c3f3e0bbd6722e95c1167b7f79be7b +Subproject commit 93b1441aaa258c1dcd211a552b75cff6461a2a8a From b6a4330d7fd41bbbee2d7b777252f37483a3f0b6 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 2 Jan 2023 12:03:19 +0100 Subject: [PATCH 28/63] Deactivate specs known to fail + add cuda specs passing in RAJA CI --- .gitlab/lassen-build-and-test-extra.yml | 48 +++++++++++++++++++------ blt | 2 +- src/tpl/umpire | 2 +- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 87896a57..debe3f3d 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -24,14 +24,25 @@ ibm_clang_9_0_0_gcc_8_3_1_cuda_10_1_168: extends: .build_and_test_on_lassen variables: SPEC: " ${PROJECT_LASSEN_VARIANTS} +cuda %clang@ibm.9.0.0 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@10.1.168 ^raja + ${PROJECT_LASSEN_DEPS}" + script: + - | + echo -e "\e[31mDeactivated spec !\e[0m" + echo -e "\e[31m${SPEC}\e[0m" + echo -e "\e[31mRAJA won’t build with Cuda < 11.1.0 due to a known issue.\e[0m" + - exit 1 allow_failure: true -# Spec has test disabled in shared CI, conflicting with default test setting in Umpire -# TODO: This is likely an issue in RADIUSS Shared CI: why disable tests ?. xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: - variables: - SPEC: "~shared +raja +cuda tests=none %xl@16.1.1.12 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@11.0.2 ${PROJECT_LASSEN_DEPS}" extends: .build_and_test_on_lassen + variables: + SPEC: "${PROJECT_LASSEN_VARIANTS} +cuda %xl@16.1.1.12 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@11.0.2 ${PROJECT_LASSEN_DEPS}" + script: + - | + echo -e "\e[31mDeactivated spec !\e[0m" + echo -e "\e[31m${SPEC}\e[0m" + echo -e "\e[31mRAJA won’t build with Cuda < 11.1.0 due to a known issue.\e[0m" + - exit 1 + allow_failure: true ############ @@ -42,24 +53,41 @@ xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: # describe the spec here. ibm_clang_9_0_0_gcc_8_3_1_cuda_11_0_2: + extends: .build_and_test_on_lassen variables: SPEC: "~shared +raja tests=basic +cuda %clang@ibm.9.0.0 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@10.1.168" - extends: .build_and_test_on_lassen + script: + - | + echo -e "\e[31mDeactivated spec !\e[0m" + echo -e "\e[31m${SPEC}\e[0m" + echo -e "\e[31mRAJA won’t build with Cuda < 11.1.0 due to a known issue.\e[0m" + - exit 1 + allow_failure: true -clang_9_0_0_libcpp (build and test on lassen): +clang_9_0_0_libcpp: + extends: .build_and_test_on_lassen variables: SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags==\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\" cflags==\"-DGTEST_HAS_CXXABI_H_=0\"" - extends: .build_and_test_on_lassen -clang_9_0_0_memleak (build and test on lassen): +clang_9_0_0_memleak: + extends: .build_and_test_on_lassen variables: SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags==\"-fsanitize=address\"" ASAN_OPTIONS: "detect_leaks=1" - extends: .build_and_test_on_lassen -clang_9_0_0_datarace (build and test on lassen): +clang_9_0_0_datarace: + extends: .build_and_test_on_lassen variables: SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags==\"-fsanitize=thread\"" allow_failure: true + +clang_12_0_1_cuda_11_5_0: + variables: + SPEC: " ~shared +raja tests=basic %clang@12.0.1 cuda_arch=70 ^cuda@11.5.0" + extends: .build_and_test_on_lassen + +gcc_8_3_1_cuda_11_1_0: + variables: + SPEC: " ~shared +raja test=basic %gcc@8.3.1 cuda_arch=70 ^cuda@11.1.0" extends: .build_and_test_on_lassen diff --git a/blt b/blt index 84fe0d15..296bf64e 160000 --- a/blt +++ b/blt @@ -1 +1 @@ -Subproject commit 84fe0d15d841a79d923e97a9105b86b59147bfed +Subproject commit 296bf64e64edfcfcce6a53e3b396d6529e76b986 diff --git a/src/tpl/umpire b/src/tpl/umpire index 93b1441a..2db6224a 160000 --- a/src/tpl/umpire +++ b/src/tpl/umpire @@ -1 +1 @@ -Subproject commit 93b1441aaa258c1dcd211a552b75cff6461a2a8a +Subproject commit 2db6224ae0c3f3e0bbd6722e95c1167b7f79be7b From 65728b4468cf2130a285f6bca67dd99666463652 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 2 Jan 2023 12:19:34 +0100 Subject: [PATCH 29/63] Deactivate another spec --- .gitlab/lassen-build-and-test-extra.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index debe3f3d..4dd093ed 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -19,7 +19,7 @@ pgi_20_4_gcc_8_3_1: SPEC: "${PROJECT_LASSEN_VARIANTS} %pgi@20.4 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ${PROJECT_LASSEN_DEPS}" allow_failure: true -# Overriding shared spec: Allow failures : known to fail at raja install +# Overriding shared spec: Cuda Arch + Deactivated spec: known to fail at RAJA install. ibm_clang_9_0_0_gcc_8_3_1_cuda_10_1_168: extends: .build_and_test_on_lassen variables: @@ -32,6 +32,20 @@ ibm_clang_9_0_0_gcc_8_3_1_cuda_10_1_168: - exit 1 allow_failure: true +# Overriding shared spec: Cuda Arch + Deactivated spec: known to fail at RAJA install. +xl_16_1_1_12_gcc_7_3_1_cuda_10_1_168: + extends: .build_and_test_on_lassen + variables: + SPEC: "${PROJECT_LASSEN_VARIANTS} +cuda %xl@16.1.1.12 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-7.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-7.3.1\" cuda_arch=70 ^cuda@10.1.168 ${PROJECT_LASSEN_DEPS}" + script: + - | + echo -e "\e[31mDeactivated spec !\e[0m" + echo -e "\e[31m${SPEC}\e[0m" + echo -e "\e[31mRAJA won’t build with Cuda < 11.1.0 due to a known issue.\e[0m" + - exit 1 + allow_failure: true + +# Overriding shared spec: Cuda Arch + Deactivated spec: known to fail at RAJA install. xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: extends: .build_and_test_on_lassen variables: @@ -52,6 +66,7 @@ xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: # ${PROJECT__DEPS} in the extra jobs. There is no reason not to fully # describe the spec here. +# Overriding shared spec: Cuda Arch + Deactivated spec: known to fail at RAJA install. ibm_clang_9_0_0_gcc_8_3_1_cuda_11_0_2: extends: .build_and_test_on_lassen variables: From 5c54d9d9522571c1e9331a8633657f26de4cff25 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Mon, 2 Jan 2023 12:33:34 +0100 Subject: [PATCH 30/63] Fix variant and missing gxx toolchain --- .gitlab/lassen-build-and-test-extra.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 4dd093ed..3a08c846 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -98,11 +98,11 @@ clang_9_0_0_datarace: clang_12_0_1_cuda_11_5_0: variables: - SPEC: " ~shared +raja tests=basic %clang@12.0.1 cuda_arch=70 ^cuda@11.5.0" + SPEC: " ~shared +raja tests=basic %clang@12.0.1 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@11.5.0" extends: .build_and_test_on_lassen gcc_8_3_1_cuda_11_1_0: variables: - SPEC: " ~shared +raja test=basic %gcc@8.3.1 cuda_arch=70 ^cuda@11.1.0" + SPEC: " ~shared +raja tests=basic %gcc@8.3.1 cuda_arch=70 ^cuda@11.1.0" extends: .build_and_test_on_lassen From f643edb03afd5071c8ba809c5a59cbd2aed259df Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 3 Jan 2023 10:28:11 +0100 Subject: [PATCH 31/63] Test with rocm@5.4.1 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1c19bd3..799f7e7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,7 +52,7 @@ stages: include: - local: '.gitlab/custom-jobs-and-variables.yml' - project: 'radiuss/radiuss-shared-ci' - ref: v2022.12.0 + ref: woptim/hip-541 file: '${CI_MACHINE}-build-and-test.yml' - local: '.gitlab/${CI_MACHINE}-build-and-test-extra.yml' strategy: depend From 9c1c4545ded10f8c962a05ae23eb77b231dce52a Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 3 Jan 2023 10:29:52 +0100 Subject: [PATCH 32/63] Test with rocm@5.4.1 --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index b20b9e80..60c3164b 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit b20b9e80887607ec60a4b1e98dd7ac516ce1bc91 +Subproject commit 60c3164ba7ff66c5d4798683deeb8515a1446297 From 34b2934a693cda448d7a051b229a23603fdc0fd5 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 3 Jan 2023 11:32:27 +0100 Subject: [PATCH 33/63] Update radiuss-spack-configs to add rocm@5.2.3 on corona --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 60c3164b..b005b360 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 60c3164ba7ff66c5d4798683deeb8515a1446297 +Subproject commit b005b3604e52712eede66bd0842059efac53782a From c839983308dd638dacb9b6add0ee9e79082e8e5b Mon Sep 17 00:00:00 2001 From: Alan Dayton <6393677+adayton1@users.noreply.github.com> Date: Mon, 3 Apr 2023 10:35:59 -0700 Subject: [PATCH 34/63] Make operator overloads bind in more cases (#222) --- src/chai/ManagedArray.hpp | 8 ++++---- src/chai/ManagedArray.inl | 8 ++++---- src/chai/ManagedArray_thin.inl | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/chai/ManagedArray.hpp b/src/chai/ManagedArray.hpp index e8c10ca3..ac6b709c 100644 --- a/src/chai/ManagedArray.hpp +++ b/src/chai/ManagedArray.hpp @@ -283,11 +283,11 @@ class ManagedArray : public CHAICopyable CHAI_HOST_DEVICE ManagedArray& operator=(std::nullptr_t); - CHAI_HOST_DEVICE bool operator==(ManagedArray& rhs) const; - CHAI_HOST_DEVICE bool operator!=(ManagedArray& from) const; + CHAI_HOST_DEVICE bool operator==(const ManagedArray& rhs) const; + CHAI_HOST_DEVICE bool operator!=(const ManagedArray& from) const; - CHAI_HOST_DEVICE bool operator==(T* from) const; - CHAI_HOST_DEVICE bool operator!=(T* from) const; + CHAI_HOST_DEVICE bool operator==(const T* from) const; + CHAI_HOST_DEVICE bool operator!=(const T* from) const; CHAI_HOST_DEVICE bool operator==(std::nullptr_t from) const; CHAI_HOST_DEVICE bool operator!=(std::nullptr_t from) const; diff --git a/src/chai/ManagedArray.inl b/src/chai/ManagedArray.inl index 99ed2f44..97d83f21 100644 --- a/src/chai/ManagedArray.inl +++ b/src/chai/ManagedArray.inl @@ -613,7 +613,7 @@ template CHAI_INLINE CHAI_HOST_DEVICE bool -ManagedArray::operator== (ManagedArray& rhs) const +ManagedArray::operator== (const ManagedArray& rhs) const { return (m_active_pointer == rhs.m_active_pointer); } @@ -622,7 +622,7 @@ template CHAI_INLINE CHAI_HOST_DEVICE bool -ManagedArray::operator!= (ManagedArray& rhs) const +ManagedArray::operator!= (const ManagedArray& rhs) const { return (m_active_pointer != rhs.m_active_pointer); } @@ -632,7 +632,7 @@ template CHAI_INLINE CHAI_HOST_DEVICE bool -ManagedArray::operator== (T * from) const { +ManagedArray::operator== (const T * from) const { return m_active_pointer == from; } @@ -640,7 +640,7 @@ template CHAI_INLINE CHAI_HOST_DEVICE bool -ManagedArray::operator!= (T * from) const { +ManagedArray::operator!= (const T * from) const { return m_active_pointer != from; } diff --git a/src/chai/ManagedArray_thin.inl b/src/chai/ManagedArray_thin.inl index e74c6256..8de7bee1 100644 --- a/src/chai/ManagedArray_thin.inl +++ b/src/chai/ManagedArray_thin.inl @@ -358,27 +358,27 @@ CHAI_INLINE CHAI_HOST_DEVICE ManagedArray& ManagedArray::operator=(std::nu template CHAI_INLINE CHAI_HOST_DEVICE bool ManagedArray::operator==( - ManagedArray& rhs) const + const ManagedArray& rhs) const { return (m_active_pointer == rhs.m_active_pointer); } template CHAI_INLINE CHAI_HOST_DEVICE bool ManagedArray::operator!=( - ManagedArray& rhs) const + const ManagedArray& rhs) const { return (m_active_pointer != rhs.m_active_pointer); } template -CHAI_INLINE CHAI_HOST_DEVICE bool ManagedArray::operator==(T* from) const +CHAI_INLINE CHAI_HOST_DEVICE bool ManagedArray::operator==(const T* from) const { return m_active_pointer == from; } template -CHAI_INLINE CHAI_HOST_DEVICE bool ManagedArray::operator!=(T* from) const +CHAI_INLINE CHAI_HOST_DEVICE bool ManagedArray::operator!=(const T* from) const { return m_active_pointer != from; } From 36297e526706a805957b3fb77425cec1de864227 Mon Sep 17 00:00:00 2001 From: robinson96 Date: Thu, 13 Apr 2023 09:10:25 -0700 Subject: [PATCH 35/63] MigrateInner on CHAI Copyable for PINNED / UM (#223) --- src/chai/ManagedArray.inl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chai/ManagedArray.inl b/src/chai/ManagedArray.inl index 97d83f21..2f5f3445 100644 --- a/src/chai/ManagedArray.inl +++ b/src/chai/ManagedArray.inl @@ -406,10 +406,14 @@ void ManagedArray::move(ExecutionSpace space, bool registerTouch) const CHAI_LOG(Debug, "Moved to " << m_active_pointer); #if defined(CHAI_ENABLE_UM) if (m_pointer_record->m_last_space == UM) { + // just because we were allocated in UM doesn't mean our CHAICopyable array values were + moveInnerImpl(); } else #endif #if defined(CHAI_ENABLE_PINNED) if (m_pointer_record->m_last_space == PINNED) { + // just because we were allocated in PINNED doesn't mean our CHAICopyable array values were + moveInnerImpl(); } else #endif if (registerTouch) { From 8d1723aba8b5b6ae1aebe678986a3becfd517869 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 25 Apr 2023 18:01:02 +0200 Subject: [PATCH 36/63] Update the CI configuration --- .gitlab-ci.yml | 10 ++- .gitlab/custom-jobs-and-variables.yml | 10 +-- .gitlab/lassen-build-and-test-extra.yml | 82 +++---------------------- .gitlab/ruby-build-and-test-extra.yml | 18 +----- .gitlab/subscribed-pipelines.yml | 53 +++++++++++++++- scripts/radiuss-spack-configs | 2 +- 6 files changed, 76 insertions(+), 99 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 799f7e7f..2490134b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,12 +37,18 @@ variables: # We build the projects in the CI clone directory. # TODO: add a clean-up mechanism BUILD_ROOT: ${CI_PROJECT_DIR} +# Set the build-and-test command. + BUILD_AND_TEST_CMD: "./scripts/gitlab/build-and-test.sh" +# Override the list of branch that will skip the "draft PR test". +# Add protected branches here. Defaults to "develop main master". +# ALWAYS_RUN_LIST: "" # We organize the build-and-test stage in sub-pipelines. Each sub-pipeline # corresponds to a test batch on a given machine. # High level stages stages: + - machine-checks - build-and-test # Template for jobs triggering a build-and-test sub-pipelines: @@ -52,7 +58,7 @@ stages: include: - local: '.gitlab/custom-jobs-and-variables.yml' - project: 'radiuss/radiuss-shared-ci' - ref: woptim/hip-541 + ref: v2023.03.0 file: '${CI_MACHINE}-build-and-test.yml' - local: '.gitlab/${CI_MACHINE}-build-and-test-extra.yml' strategy: depend @@ -62,7 +68,7 @@ stages: include: # [Optional] checks preliminary to running the actual CI test #- project: 'radiuss/radiuss-shared-ci' - # ref: v2022.12.0 + # ref: v2023.03.0 # file: 'preliminary-ignore-draft-pr.yml' # pipelines subscribed by the project - local: .gitlab/subscribed-pipelines.yml diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml index 68d0f1c9..3abc79ef 100644 --- a/.gitlab/custom-jobs-and-variables.yml +++ b/.gitlab/custom-jobs-and-variables.yml @@ -15,9 +15,9 @@ variables: # Ruby # Arguments for top level allocation - RUBY_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --partition=pdebug --time=20 --nodes=1" + RUBY_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --reservation=ci --qos=ci_ruby --time=20 --nodes=1" # Arguments for job level allocation - RUBY_BUILD_AND_TEST_JOB_ALLOC: "--overlap --time=20 --nodes=1" + RUBY_BUILD_AND_TEST_JOB_ALLOC: "--overlap --reservation=ci --time=20 --nodes=1" # Project specific variants for ruby PROJECT_RUBY_VARIANTS: "~shared +raja tests=basic " # Project specific deps for ruby @@ -25,9 +25,9 @@ variables: # Corona # Arguments for top level allocation - CORONA_BUILD_AND_TEST_SHARED_ALLOC: "--time-limit=30m --nodes=1" + CORONA_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --time-limit=30m --nodes=1" # Arguments for job level allocation - CORONA_BUILD_AND_TEST_JOB_ALLOC: "--time-limit=30m --nodes=1" + CORONA_BUILD_AND_TEST_JOB_ALLOC: "--exclusive --time-limit=30m --nodes=1" # Project specific variants for corona PROJECT_CORONA_VARIANTS: "~shared +raja tests=basic " # Project specific deps for corona @@ -35,7 +35,7 @@ variables: # Tioga # Arguments for top level allocation - TIOGA_BUILD_AND_TEST_SHARED_ALLOC: "--time-limit=30m --nodes=1" + TIOGA_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --time-limit=30m --nodes=1" # Arguments for job level allocation TIOGA_BUILD_AND_TEST_JOB_ALLOC: "--time-limit=30m --nodes=1" # Project specific variants for tioga diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 3a08c846..503f5f8e 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -12,52 +12,7 @@ # We keep ${PROJECT__VARIANTS} and ${PROJECT__DEPS} So that # the comparison with the original job is easier. -# Overriding shared spec: Longer allocation + Allow failures : known to fail at raja install -pgi_20_4_gcc_8_3_1: - extends: .build_and_test_on_lassen - variables: - SPEC: "${PROJECT_LASSEN_VARIANTS} %pgi@20.4 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" ${PROJECT_LASSEN_DEPS}" - allow_failure: true - -# Overriding shared spec: Cuda Arch + Deactivated spec: known to fail at RAJA install. -ibm_clang_9_0_0_gcc_8_3_1_cuda_10_1_168: - extends: .build_and_test_on_lassen - variables: - SPEC: " ${PROJECT_LASSEN_VARIANTS} +cuda %clang@ibm.9.0.0 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@10.1.168 ^raja + ${PROJECT_LASSEN_DEPS}" - script: - - | - echo -e "\e[31mDeactivated spec !\e[0m" - echo -e "\e[31m${SPEC}\e[0m" - echo -e "\e[31mRAJA won’t build with Cuda < 11.1.0 due to a known issue.\e[0m" - - exit 1 - allow_failure: true - -# Overriding shared spec: Cuda Arch + Deactivated spec: known to fail at RAJA install. -xl_16_1_1_12_gcc_7_3_1_cuda_10_1_168: - extends: .build_and_test_on_lassen - variables: - SPEC: "${PROJECT_LASSEN_VARIANTS} +cuda %xl@16.1.1.12 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-7.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-7.3.1\" cuda_arch=70 ^cuda@10.1.168 ${PROJECT_LASSEN_DEPS}" - script: - - | - echo -e "\e[31mDeactivated spec !\e[0m" - echo -e "\e[31m${SPEC}\e[0m" - echo -e "\e[31mRAJA won’t build with Cuda < 11.1.0 due to a known issue.\e[0m" - - exit 1 - allow_failure: true - -# Overriding shared spec: Cuda Arch + Deactivated spec: known to fail at RAJA install. -xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: - extends: .build_and_test_on_lassen - variables: - SPEC: "${PROJECT_LASSEN_VARIANTS} +cuda %xl@16.1.1.12 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@11.0.2 ${PROJECT_LASSEN_DEPS}" - script: - - | - echo -e "\e[31mDeactivated spec !\e[0m" - echo -e "\e[31m${SPEC}\e[0m" - echo -e "\e[31mRAJA won’t build with Cuda < 11.1.0 due to a known issue.\e[0m" - - exit 1 - allow_failure: true - +# No overridden jobs so far. ############ # Extra jobs @@ -66,43 +21,20 @@ xl_16_1_1_12_gcc_8_3_1_cuda_11_0_2: # ${PROJECT__DEPS} in the extra jobs. There is no reason not to fully # describe the spec here. -# Overriding shared spec: Cuda Arch + Deactivated spec: known to fail at RAJA install. -ibm_clang_9_0_0_gcc_8_3_1_cuda_11_0_2: - extends: .build_and_test_on_lassen - variables: - SPEC: "~shared +raja tests=basic +cuda %clang@ibm.9.0.0 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@10.1.168" - script: - - | - echo -e "\e[31mDeactivated spec !\e[0m" - echo -e "\e[31m${SPEC}\e[0m" - echo -e "\e[31mRAJA won’t build with Cuda < 11.1.0 due to a known issue.\e[0m" - - exit 1 - allow_failure: true - -clang_9_0_0_libcpp: +clang_12_0_1_libcpp: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags==\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\" cflags==\"-DGTEST_HAS_CXXABI_H_=0\"" + SPEC: "~shared +raja +libcpp tests=basic %clang@12.0.1" -clang_9_0_0_memleak: +clang_12_0_1_gcc_8_3_1_memleak: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags==\"-fsanitize=address\"" + SPEC: "~shared +raja tests=basic %clang@12.0.1.gcc.8.3.1 cxxflags==\"-fsanitize=address\"" ASAN_OPTIONS: "detect_leaks=1" -clang_9_0_0_datarace: +clang_12_0_1_datarace: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja tests=basic %clang@9.0.0 cxxflags==\"-fsanitize=thread\"" + SPEC: "~shared +raja tests=basic %clang@12.0.1 cxxflags==\"-fsanitize=thread\"" allow_failure: true -clang_12_0_1_cuda_11_5_0: - variables: - SPEC: " ~shared +raja tests=basic %clang@12.0.1 cxxflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cflags==\"--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1\" cuda_arch=70 ^cuda@11.5.0" - extends: .build_and_test_on_lassen - -gcc_8_3_1_cuda_11_1_0: - variables: - SPEC: " ~shared +raja tests=basic %gcc@8.3.1 cuda_arch=70 ^cuda@11.1.0" - extends: .build_and_test_on_lassen - diff --git a/.gitlab/ruby-build-and-test-extra.yml b/.gitlab/ruby-build-and-test-extra.yml index f860c6ed..5deca081 100644 --- a/.gitlab/ruby-build-and-test-extra.yml +++ b/.gitlab/ruby-build-and-test-extra.yml @@ -12,13 +12,7 @@ # We keep ${PROJECT__VARIANTS} and ${PROJECT__DEPS} So that # the comparison with the original job is easier. -# Overriding shared spec: Allow failures -pgi_20_1_gcc_local_8_3_1: - variables: - SPEC: "${PROJECT_RUBY_VARIANTS} %pgi@20.1 cxxflags==\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" cflags==\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" fflags==\"-rc=/usr/workspace/umpire/pgi/x86_64/local-gcc-8.3.1-rc\" ${PROJECT_RUBY_DEPS}" - extends: .build_and_test_on_ruby - allow_failure: true - +# No overridden jobs so far. ############ # Extra jobs @@ -27,14 +21,8 @@ pgi_20_1_gcc_local_8_3_1: # ${PROJECT__DEPS} in the extra jobs. There is no reason not to fully # describe the spec here. -gcc_4_9_3: +clang_14_0_4_develop_tpls: variables: - SPEC: "~shared +raja tests=basic %gcc@4.9.3" + SPEC: " %clang@14.0.4 ^umpire@develop ^raja@develop ^camp@main" extends: .build_and_test_on_ruby - allow_failure: true - -#clang_10_develop_tpls: -# variables: -# SPEC: " %clang@10.0.1 ^umpire@develop ^raja@develop ^camp@main" -# extends: .build_and_test_on_ruby diff --git a/.gitlab/subscribed-pipelines.yml b/.gitlab/subscribed-pipelines.yml index 89fa2793..9d292469 100644 --- a/.gitlab/subscribed-pipelines.yml +++ b/.gitlab/subscribed-pipelines.yml @@ -5,23 +5,74 @@ # SPDX-License-Identifier: (MIT) ############################################################################### -# Trigger a build-and-test pipeline for ruby, corona and lassen +# The template job to test whether a machine is up. +# Expects CI_MACHINE defined to machine name. +.machine-check: + stage: machine-checks + tags: [shell, oslic] + variables: + GIT_STRATEGY: none + script: + - | + if [[ $(jq '.[env.CI_MACHINE].total_nodes_up' /usr/global/tools/lorenz/data/loginnodeStatus) == 0 ]] + then + echo -e "\e[31mNo node available on ${CI_MACHINE}\e[0m" + curl --url "https://api.github.com/repos/${GITHUB_PROJECT_ORG}/${GITHUB_PROJECT_NAME}/statuses/${CI_COMMIT_SHA}" \ + --header 'Content-Type: application/json' \ + --header "authorization: Bearer ${GITHUB_TOKEN}" \ + --data "{ \"state\": \"failure\", \"target_url\": \"${CI_PIPELINE_URL}\", \"description\": \"GitLab ${CI_MACHINE} down\", \"context\": \"ci/gitlab/${CI_MACHINE}\" }" + exit 1 + fi + +### +# Trigger a build-and-test pipeline for a machine. +# Comment the jobs for machines you don’t need. +### + +# RUBY +ruby-up-check: + variables: + CI_MACHINE: "ruby" + extends: [.machine-check] + ruby-build-and-test: variables: CI_MACHINE: "ruby" + needs: [ruby-up-check] extends: [.build-and-test] +# CORONA +corona-up-check: + variables: + CI_MACHINE: "corona" + extends: [.machine-check] + corona-build-and-test: variables: CI_MACHINE: "corona" + needs: [corona-up-check] extends: [.build-and-test] +# TIOGA +tioga-up-check: + variables: + CI_MACHINE: "tioga" + extends: [.machine-check] + tioga-build-and-test: variables: CI_MACHINE: "tioga" + needs: [tioga-up-check] extends: [.build-and-test] +# LASSEN +lassen-up-check: + variables: + CI_MACHINE: "lassen" + extends: [.machine-check] + lassen-build-and-test: variables: CI_MACHINE: "lassen" + needs: [lassen-up-check] extends: [.build-and-test] diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index b005b360..28898017 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit b005b3604e52712eede66bd0842059efac53782a +Subproject commit 28898017934207018b965d13a5a30d8a96377019 From a997f17f3eb5d6f1b23cecf8e17193adc8da4397 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 25 Apr 2023 18:08:05 +0200 Subject: [PATCH 37/63] Fix script name --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2490134b..4b83dab9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,7 +38,7 @@ variables: # TODO: add a clean-up mechanism BUILD_ROOT: ${CI_PROJECT_DIR} # Set the build-and-test command. - BUILD_AND_TEST_CMD: "./scripts/gitlab/build-and-test.sh" + BUILD_AND_TEST_CMD: "./scripts/gitlab/build_and_test.sh" # Override the list of branch that will skip the "draft PR test". # Add protected branches here. Defaults to "develop main master". # ALWAYS_RUN_LIST: "" From d198dcac5c663639096358f7439d1a4604a38f9e Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 25 Apr 2023 18:09:13 +0200 Subject: [PATCH 38/63] Update radiuss-spack-configs --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 28898017..c0fac322 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 28898017934207018b965d13a5a30d8a96377019 +Subproject commit c0fac3225293dbf0cc77289c941eb885d327c577 From 78c4f57873221f7e5e32e5cd6070668da23c967e Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 27 Apr 2023 16:07:48 +0200 Subject: [PATCH 39/63] Update spack version used in uberenv --- .uberenv_config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.uberenv_config.json b/.uberenv_config.json index e3ff682b..5f455214 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -4,10 +4,11 @@ "package_final_phase" : "initconfig", "package_source_dir" : "../..", "spack_url": "https://github.com/spack/spack.git", -"spack_branch": "v0.19.0", +"spack_branch": "e4s-23.02", "spack_activate" : {}, "spack_configs_path": "scripts/radiuss-spack-configs", "spack_packages_path": "scripts/radiuss-spack-configs/packages", "spack_concretizer": "clingo", "spack_setup_clingo": false +"debug": true } From 3471339c4395d83a92fbf725b1d3c8c69ab0f4f2 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Fri, 28 Apr 2023 10:44:40 +0200 Subject: [PATCH 40/63] Increase top-level allocation to be greater than sub-allocation --- .gitlab/custom-jobs-and-variables.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml index 3abc79ef..c39bd3d1 100644 --- a/.gitlab/custom-jobs-and-variables.yml +++ b/.gitlab/custom-jobs-and-variables.yml @@ -25,7 +25,7 @@ variables: # Corona # Arguments for top level allocation - CORONA_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --time-limit=30m --nodes=1" + CORONA_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --time-limit=45m --nodes=1" # Arguments for job level allocation CORONA_BUILD_AND_TEST_JOB_ALLOC: "--exclusive --time-limit=30m --nodes=1" # Project specific variants for corona @@ -35,7 +35,7 @@ variables: # Tioga # Arguments for top level allocation - TIOGA_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --time-limit=30m --nodes=1" + TIOGA_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --time-limit=45m --nodes=1" # Arguments for job level allocation TIOGA_BUILD_AND_TEST_JOB_ALLOC: "--time-limit=30m --nodes=1" # Project specific variants for tioga From 4004db913d2c425f707b3dee75836ae499b96514 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Fri, 28 Apr 2023 10:47:20 +0200 Subject: [PATCH 41/63] Update Uberenv --- scripts/uberenv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/uberenv b/scripts/uberenv index 4941c237..0d00dc8e 160000 --- a/scripts/uberenv +++ b/scripts/uberenv @@ -1 +1 @@ -Subproject commit 4941c237eec514d6d68872243efb9f4af8843f4d +Subproject commit 0d00dc8e19a889ba07ae433590b87533c4b5b3da From 9b84825d715c8fe4406bdb7cc57bdd5792eb5c46 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Fri, 28 Apr 2023 11:16:38 +0200 Subject: [PATCH 42/63] Update radiuss-spack-configs --- .gitlab/custom-jobs-and-variables.yml | 2 +- blt | 2 +- scripts/radiuss-spack-configs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml index c39bd3d1..c9e30f1c 100644 --- a/.gitlab/custom-jobs-and-variables.yml +++ b/.gitlab/custom-jobs-and-variables.yml @@ -37,7 +37,7 @@ variables: # Arguments for top level allocation TIOGA_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --time-limit=45m --nodes=1" # Arguments for job level allocation - TIOGA_BUILD_AND_TEST_JOB_ALLOC: "--time-limit=30m --nodes=1" + TIOGA_BUILD_AND_TEST_JOB_ALLOC: "--exclusive --time-limit=30m --nodes=1" # Project specific variants for tioga PROJECT_TIOGA_VARIANTS: "~shared +raja tests=basic " # Project specific deps for tioga diff --git a/blt b/blt index 296bf64e..09f7a4be 160000 --- a/blt +++ b/blt @@ -1 +1 @@ -Subproject commit 296bf64e64edfcfcce6a53e3b396d6529e76b986 +Subproject commit 09f7a4be48886e1175885e10ed6af1225ae12a90 diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index c0fac322..9570e240 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit c0fac3225293dbf0cc77289c941eb885d327c577 +Subproject commit 9570e24089a902e60c360685247b00444a9e9321 From 6c090c87e28fe956ccab7b31d460f72d1a6e9e35 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Fri, 28 Apr 2023 11:19:30 +0200 Subject: [PATCH 43/63] Fix json syntax --- .uberenv_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.uberenv_config.json b/.uberenv_config.json index 5f455214..34531069 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -9,6 +9,6 @@ "spack_configs_path": "scripts/radiuss-spack-configs", "spack_packages_path": "scripts/radiuss-spack-configs/packages", "spack_concretizer": "clingo", -"spack_setup_clingo": false +"spack_setup_clingo": false, "debug": true } From 3838d5935a80369ccd40a01a3ef0e7d173ee447e Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Fri, 28 Apr 2023 11:41:54 +0200 Subject: [PATCH 44/63] Specify cuda_arch on lassen --- .gitlab/custom-jobs-and-variables.yml | 2 +- .gitlab/lassen-build-and-test-extra.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml index c9e30f1c..c96b782f 100644 --- a/.gitlab/custom-jobs-and-variables.yml +++ b/.gitlab/custom-jobs-and-variables.yml @@ -48,7 +48,7 @@ variables: # Arguments for job level allocation LASSEN_BUILD_AND_TEST_JOB_ALLOC: "1 -W 120" # Project specific variants for lassen - PROJECT_LASSEN_VARIANTS: "~shared +raja tests=basic " + PROJECT_LASSEN_VARIANTS: "~shared +raja cuda_arch=70 tests=basic" # Project specific deps for lassen PROJECT_LASSEN_DEPS: "" diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 503f5f8e..aad1b0a3 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -24,17 +24,17 @@ clang_12_0_1_libcpp: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja +libcpp tests=basic %clang@12.0.1" + SPEC: "~shared +raja +libcpp cuda_arch=70 tests=basic %clang@12.0.1" clang_12_0_1_gcc_8_3_1_memleak: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja tests=basic %clang@12.0.1.gcc.8.3.1 cxxflags==\"-fsanitize=address\"" + SPEC: "~shared +raja cuda_arch=70 tests=basic %clang@12.0.1.gcc.8.3.1 cxxflags==\"-fsanitize=address\"" ASAN_OPTIONS: "detect_leaks=1" clang_12_0_1_datarace: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja tests=basic %clang@12.0.1 cxxflags==\"-fsanitize=thread\"" + SPEC: "~shared +raja cuda_arch=70 tests=basic %clang@12.0.1 cxxflags==\"-fsanitize=thread\"" allow_failure: true From 405ff7ed80cdc4ac84e55417f10f5fd3331215e5 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 2 May 2023 18:26:59 +0200 Subject: [PATCH 45/63] Update radiuss-spack-configs to turn off device alloc in umpire --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 9570e240..a3428730 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 9570e24089a902e60c360685247b00444a9e9321 +Subproject commit a34287300a1a73efb7e8ed28f69cec51327ce084 From 025a561fafd08b61665f34b046073172343ff9b4 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 2 May 2023 19:15:13 +0200 Subject: [PATCH 46/63] Remove cuda-arch in non-cuda spec --- .gitlab/lassen-build-and-test-extra.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index aad1b0a3..2198e518 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -24,17 +24,17 @@ clang_12_0_1_libcpp: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja +libcpp cuda_arch=70 tests=basic %clang@12.0.1" + SPEC: "~shared +raja +libcpp tests=basic %clang@12.0.1" clang_12_0_1_gcc_8_3_1_memleak: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja cuda_arch=70 tests=basic %clang@12.0.1.gcc.8.3.1 cxxflags==\"-fsanitize=address\"" + SPEC: "~shared +raja tests=basic %clang@12.0.1.gcc.8.3.1 cxxflags==\"-fsanitize=address\"" ASAN_OPTIONS: "detect_leaks=1" clang_12_0_1_datarace: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja cuda_arch=70 tests=basic %clang@12.0.1 cxxflags==\"-fsanitize=thread\"" - allow_failure: true + SPEC: "~shared +raja tests=basic %clang@12.0.1 cxxflags==\"-fsanitize=thread\"" + allow_failure: tru From 537c5aa66371946a060195689d3c23550f9cccb1 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 2 May 2023 19:16:30 +0200 Subject: [PATCH 47/63] Fix typo --- .gitlab/lassen-build-and-test-extra.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 2198e518..503f5f8e 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -36,5 +36,5 @@ clang_12_0_1_datarace: extends: .build_and_test_on_lassen variables: SPEC: "~shared +raja tests=basic %clang@12.0.1 cxxflags==\"-fsanitize=thread\"" - allow_failure: tru + allow_failure: true From 822f874d67ee04ed74f7644d9579381a9d41b95c Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 2 May 2023 19:31:49 +0200 Subject: [PATCH 48/63] Update radiuss-spack-configs with latest raja version --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index a3428730..47688186 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit a34287300a1a73efb7e8ed28f69cec51327ce084 +Subproject commit 47688186ea04ef9f76bcdbc0a1c53ce091e6b9f1 From 1755a1a41ce2983ceeefe1e9c5ab45a9fa8953c3 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Tue, 2 May 2023 20:04:53 +0200 Subject: [PATCH 49/63] Use flux delay to work around file handle issues --- .gitlab/custom-jobs-and-variables.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml index c96b782f..7126322d 100644 --- a/.gitlab/custom-jobs-and-variables.yml +++ b/.gitlab/custom-jobs-and-variables.yml @@ -27,7 +27,7 @@ variables: # Arguments for top level allocation CORONA_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --time-limit=45m --nodes=1" # Arguments for job level allocation - CORONA_BUILD_AND_TEST_JOB_ALLOC: "--exclusive --time-limit=30m --nodes=1" + CORONA_BUILD_AND_TEST_JOB_ALLOC: "--time-limit=30m --nodes=1 --begin-time=+5s" # Project specific variants for corona PROJECT_CORONA_VARIANTS: "~shared +raja tests=basic " # Project specific deps for corona @@ -37,7 +37,7 @@ variables: # Arguments for top level allocation TIOGA_BUILD_AND_TEST_SHARED_ALLOC: "--exclusive --time-limit=45m --nodes=1" # Arguments for job level allocation - TIOGA_BUILD_AND_TEST_JOB_ALLOC: "--exclusive --time-limit=30m --nodes=1" + TIOGA_BUILD_AND_TEST_JOB_ALLOC: "--time-limit=30m --nodes=1 --begin-time=+5s" # Project specific variants for tioga PROJECT_TIOGA_VARIANTS: "~shared +raja tests=basic " # Project specific deps for tioga From bd67a027b2e4eb3ea5937b71089c38628e85b671 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 4 May 2023 17:38:43 +0200 Subject: [PATCH 50/63] Remove libcpp variant from chai, using flags instead --- .gitlab/lassen-build-and-test-extra.yml | 2 +- scripts/radiuss-spack-configs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 503f5f8e..563123e3 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -24,7 +24,7 @@ clang_12_0_1_libcpp: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja +libcpp tests=basic %clang@12.0.1" + SPEC: "~shared +raja +libcpp tests=basic %clang@12.0.1 cflags==\"-DGTEST_HAS_CXXABI_H_=0\" cxxflags==\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\"" clang_12_0_1_gcc_8_3_1_memleak: extends: .build_and_test_on_lassen diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 47688186..46a57354 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 47688186ea04ef9f76bcdbc0a1c53ce091e6b9f1 +Subproject commit 46a57354ed6cd67ee44f492f4d4430eb6d6d9225 From 22cdaa6db54d9fb7dc0533e0d158eb450cf4a9e4 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 4 May 2023 17:42:25 +0200 Subject: [PATCH 51/63] Allow failure for old cuda shared spec --- .gitlab/lassen-build-and-test-extra.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index 563123e3..ea97d60f 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -12,7 +12,13 @@ # We keep ${PROJECT__VARIANTS} and ${PROJECT__DEPS} So that # the comparison with the original job is easier. -# No overridden jobs so far. +# Override job with old cuda to allow it to fail. +clang_12_0_1_gcc_8_3_1_cuda_10_1_243: + variables: + SPEC: "${PROJECT_LASSEN_VARIANTS} +cuda %clang@12.0.1.gcc.8.3.1 ^cuda@10.1.243+allow-unsupported-compilers ${PROJECT_LASSEN_DEPS}" + extends: .build_and_test_on_lassen + allow_failure: true + ############ # Extra jobs From fdbe8fdca63449c6cac56946519eaa9d0ab875ac Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 4 May 2023 18:16:48 +0200 Subject: [PATCH 52/63] Fix oversight --- .gitlab/lassen-build-and-test-extra.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/lassen-build-and-test-extra.yml b/.gitlab/lassen-build-and-test-extra.yml index ea97d60f..fede40d2 100644 --- a/.gitlab/lassen-build-and-test-extra.yml +++ b/.gitlab/lassen-build-and-test-extra.yml @@ -30,7 +30,7 @@ clang_12_0_1_gcc_8_3_1_cuda_10_1_243: clang_12_0_1_libcpp: extends: .build_and_test_on_lassen variables: - SPEC: "~shared +raja +libcpp tests=basic %clang@12.0.1 cflags==\"-DGTEST_HAS_CXXABI_H_=0\" cxxflags==\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\"" + SPEC: "~shared +raja tests=basic %clang@12.0.1 cflags==\"-DGTEST_HAS_CXXABI_H_=0\" cxxflags==\"-stdlib=libc++ -DGTEST_HAS_CXXABI_H_=0\"" clang_12_0_1_gcc_8_3_1_memleak: extends: .build_and_test_on_lassen From d028ed5942ce1ff797cb63bb1fbe3768bb2a9553 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 4 May 2023 19:50:16 +0200 Subject: [PATCH 53/63] Update radiuss-spack-configs to new main branch --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 46a57354..b14418ee 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 46a57354ed6cd67ee44f492f4d4430eb6d6d9225 +Subproject commit b14418eea8dbcf8f93182f988fee18f3ae004f23 From 79d5ada5c4c6166b2171e1720791cd799dceb98a Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" Date: Thu, 4 May 2023 23:26:35 +0200 Subject: [PATCH 54/63] Update radiuss-spack-configs to new main commit --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index b14418ee..58504fbf 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit b14418eea8dbcf8f93182f988fee18f3ae004f23 +Subproject commit 58504fbf1d90b7584f2692eb91988a3ca1384bb9 From c862345c98bfec02224927f01011ef286363de13 Mon Sep 17 00:00:00 2001 From: Adrien Bernede <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 18 May 2023 16:41:22 +0200 Subject: [PATCH 55/63] Revert change in radiuss-spack-configs --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 58504fbf..5be1bdfe 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 58504fbf1d90b7584f2692eb91988a3ca1384bb9 +Subproject commit 5be1bdfe048c44d274146438ec9a172286328825 From 678184d8a8499a5578fcc131f8d359765290faf5 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Mon, 22 May 2023 17:11:09 +0200 Subject: [PATCH 56/63] update specs after update of ruby to rhel8 --- .gitlab-ci.yml | 4 ++-- .gitlab/ruby-build-and-test-extra.yml | 4 ++-- scripts/radiuss-spack-configs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b83dab9..db015edb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,7 +58,7 @@ stages: include: - local: '.gitlab/custom-jobs-and-variables.yml' - project: 'radiuss/radiuss-shared-ci' - ref: v2023.03.0 + ref: woptim/rhel-8-update file: '${CI_MACHINE}-build-and-test.yml' - local: '.gitlab/${CI_MACHINE}-build-and-test-extra.yml' strategy: depend @@ -68,7 +68,7 @@ stages: include: # [Optional] checks preliminary to running the actual CI test #- project: 'radiuss/radiuss-shared-ci' - # ref: v2023.03.0 + # ref: woptim/rhel-8-update # file: 'preliminary-ignore-draft-pr.yml' # pipelines subscribed by the project - local: .gitlab/subscribed-pipelines.yml diff --git a/.gitlab/ruby-build-and-test-extra.yml b/.gitlab/ruby-build-and-test-extra.yml index 5deca081..452928d9 100644 --- a/.gitlab/ruby-build-and-test-extra.yml +++ b/.gitlab/ruby-build-and-test-extra.yml @@ -21,8 +21,8 @@ # ${PROJECT__DEPS} in the extra jobs. There is no reason not to fully # describe the spec here. -clang_14_0_4_develop_tpls: +clang_14_0_6_develop_tpls: variables: - SPEC: " %clang@14.0.4 ^umpire@develop ^raja@develop ^camp@main" + SPEC: " %clang@14.0.6 ^umpire@develop ^raja@develop ^camp@main" extends: .build_and_test_on_ruby diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 5be1bdfe..d9e4042f 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 5be1bdfe048c44d274146438ec9a172286328825 +Subproject commit d9e4042f8caf1a6ad828fb76d8aa322b109ecffe From 6e11dda7572f19ab8577e8139a26b3e5639b68e9 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Mon, 22 May 2023 17:25:01 +0200 Subject: [PATCH 57/63] Update radiuss-spack-configs to add compiler --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index d9e4042f..285f2732 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit d9e4042f8caf1a6ad828fb76d8aa322b109ecffe +Subproject commit 285f2732d94b4c58afd9171257f2a69d01e668b6 From b28e389b98821d8ffc5a32f9f53229b87db59a40 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 25 May 2023 11:50:35 +0200 Subject: [PATCH 58/63] Update radiuss spack configs with changes from caliper --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 285f2732..2c94855c 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 285f2732d94b4c58afd9171257f2a69d01e668b6 +Subproject commit 2c94855ceb1b57ec823bb7ede49fb68558a5ab85 From 6498efe78d2ba3c123da22c47ed88f51cab5e007 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 25 May 2023 12:07:27 +0200 Subject: [PATCH 59/63] Update radiuss spack configs with fix for intel+gcc compiler --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 2c94855c..6993bfa6 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 2c94855ceb1b57ec823bb7ede49fb68558a5ab85 +Subproject commit 6993bfa66dc77ffd42061b43ee3b03c9c6c9ff7f From 945fc983e493bcb0237e2c826228d5ee24601fad Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 25 May 2023 13:24:41 +0200 Subject: [PATCH 60/63] on Ruby intel either needs its module, or gcc@8.x to be set --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 6993bfa6..4900bbce 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 6993bfa66dc77ffd42061b43ee3b03c9c6c9ff7f +Subproject commit 4900bbce51b93c4e90b7e75a15db8a7d5c869a49 From d30170f6dd5b96f1b9b8d8176d8f66f904dd4544 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 25 May 2023 15:45:15 +0200 Subject: [PATCH 61/63] Update radiuss spack configs with added gcc@8.5.0 --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 4900bbce..32cfa6fe 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 4900bbce51b93c4e90b7e75a15db8a7d5c869a49 +Subproject commit 32cfa6fe95d9f43aee3f2eee52e76645c0b4e732 From f46b06ce12ccc1cbe35b9f83701ee34f280539b6 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 25 May 2023 16:09:17 +0200 Subject: [PATCH 62/63] Fix gcc 8.5.0 path --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 32cfa6fe..86fbed0a 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 32cfa6fe95d9f43aee3f2eee52e76645c0b4e732 +Subproject commit 86fbed0aa7482c8eb921a434a930552a81ea6693 From 6c183c61ff49a64c491eeb1babfb0d42589e509e Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 25 May 2023 17:43:08 +0200 Subject: [PATCH 63/63] Merge radiuss-spack-configs and radiuss-shared-ci --- .gitlab-ci.yml | 4 ++-- scripts/radiuss-spack-configs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db015edb..0fcb90ca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,7 +58,7 @@ stages: include: - local: '.gitlab/custom-jobs-and-variables.yml' - project: 'radiuss/radiuss-shared-ci' - ref: woptim/rhel-8-update + ref: v2023.03.1 file: '${CI_MACHINE}-build-and-test.yml' - local: '.gitlab/${CI_MACHINE}-build-and-test-extra.yml' strategy: depend @@ -68,7 +68,7 @@ stages: include: # [Optional] checks preliminary to running the actual CI test #- project: 'radiuss/radiuss-shared-ci' - # ref: woptim/rhel-8-update + # ref: v2023.03.1 # file: 'preliminary-ignore-draft-pr.yml' # pipelines subscribed by the project - local: .gitlab/subscribed-pipelines.yml diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 86fbed0a..f6626f79 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 86fbed0aa7482c8eb921a434a930552a81ea6693 +Subproject commit f6626f790b07fbd399f238aa9792a11ca78dfa97