diff --git a/config.yaml b/config.yaml index 0922ead..90e74d3 100644 --- a/config.yaml +++ b/config.yaml @@ -39,6 +39,13 @@ uenvs: santis: [gh200] balfrin: [a100] develop: False + icon-dsl: + "25.8": + recipes: + gh200: '25.8/gh200' + deploy: + santis: [gh200] + develop: False mch: "v7": recipes: diff --git a/recipes/icon-dsl/25.8/gh200/compilers.yaml b/recipes/icon-dsl/25.8/gh200/compilers.yaml new file mode 100644 index 0000000..1a86a3d --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/compilers.yaml @@ -0,0 +1,5 @@ +bootstrap: + spec: gcc@11 +gcc: + specs: + - gcc@11 diff --git a/recipes/icon-dsl/25.8/gh200/config.yaml b/recipes/icon-dsl/25.8/gh200/config.yaml new file mode 100644 index 0000000..1c26eca --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/config.yaml @@ -0,0 +1,7 @@ +name: icon4pypoc +store: /user-environment +spack: + repo: https://github.com/spack/spack.git + commit: releases/v0.23 +modules: false +description: icon4py proof-of-concept diff --git a/recipes/icon-dsl/25.8/gh200/environments.yaml b/recipes/icon-dsl/25.8/gh200/environments.yaml new file mode 100644 index 0000000..f53b81f --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/environments.yaml @@ -0,0 +1,16 @@ +myenv: + compiler: + - toolchain: gcc + spec: gcc + specs: + - icon4py@icon_20250328 +distributed +cuda + - py-cupy + - py-mpi4py + - python + unify: true + variants: + - +mpi + - +cuda + - cuda_arch=90 + views: + default: diff --git a/recipes/icon-dsl/25.8/gh200/repo/packages/ghex/package.py b/recipes/icon-dsl/25.8/gh200/repo/packages/ghex/package.py new file mode 100644 index 0000000..fc03b88 --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/repo/packages/ghex/package.py @@ -0,0 +1,87 @@ +from spack.package import * + + +class Ghex(CMakePackage, CudaPackage, ROCmPackage): + """GHEX is a generic halo-exchange library.""" + + homepage = "https://github.com/ghex-org/GHEX" + url = "https://github.com/ghex-org/GHEX/archive/refs/tags/v0.3.0.tar.gz" + git = "https://github.com/ghex-org/GHEX.git" + maintainers = ["boeschf"] + + version("0.4.1", tag="v0.4.1", submodules=True) + version("0.4.0", tag="v0.4.0", submodules=True) + version("0.3.0", tag="v0.3.0", submodules=True) + version("master", branch="master", submodules=True) + + depends_on("cxx", type="build") + + generator("ninja") + + backends = ("mpi", "ucx", "libfabric") + variant( + "backend", default="mpi", description="Transport backend", values=backends, multi=False + ) + variant("xpmem", default=False, description="Use xpmem shared memory") + variant("python", default=True, description="Build Python bindings") + + depends_on("cmake@3.21:", type="build") + depends_on("mpi") + depends_on("boost") + depends_on("xpmem", when="+xpmem", type=("build", "run")) + + depends_on("oomph") + for backend in backends: + depends_on(f"oomph backend={backend}", when=f"backend={backend}") + depends_on("oomph+cuda", when="+cuda") + depends_on("oomph+rocm", when="+rocm") + depends_on("oomph@0.3:", when="@0.3:") + + conflicts("+cuda+rocm") + + with when("+python"): + extends("python") + depends_on("python@3.7:", type="build") + depends_on("py-pip", type="build") + depends_on("py-pybind11", type="build") + depends_on("py-mpi4py", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + + depends_on("py-pytest", when="+python", type=("test")) + + def cmake_args(self): + spec = self.spec + + args = [ + self.define("GHEX_USE_BUNDLED_LIBS", True), + self.define("GHEX_USE_BUNDLED_GRIDTOOLS", True), + self.define("GHEX_USE_BUNDLED_GTEST", self.run_tests), + self.define("GHEX_USE_BUNDLED_OOMPH", False), + self.define("GHEX_TRANSPORT_BACKEND", spec.variants["backend"].value.upper()), + self.define_from_variant("GHEX_USE_XPMEM", "xpmem"), + self.define_from_variant("GHEX_BUILD_PYTHON_BINDINGS", "python"), + self.define("GHEX_WITH_TESTING", self.run_tests), + ] + + if spec.satisfies("+python"): + args.append(self.define("GHEX_PYTHON_LIB_PATH", python_platlib)) + + if self.run_tests and spec.satisfies("^openmpi"): + args.append(self.define("MPIEXEC_PREFLAGS", "--oversubscribe")) + + if "+cuda" in spec and spec.variants["cuda_arch"].value != "none": + arch_str = ";".join(spec.variants["cuda_arch"].value) + args.append(self.define("CMAKE_CUDA_ARCHITECTURES", arch_str)) + args.append(self.define("GHEX_USE_GPU", True)) + args.append(self.define("GHEX_GPU_TYPE", "CUDA")) + + if "+rocm" in spec and spec.variants["amdgpu_target"].value != "none": + arch_str = ";".join(spec.variants["amdgpu_target"].value) + args.append(self.define("CMAKE_HIP_ARCHITECTURES", arch_str)) + args.append(self.define("GHEX_USE_GPU", True)) + args.append(self.define("GHEX_GPU_TYPE", "AMD")) + + if spec.satisfies("~cuda~rocm"): + args.append(self.define("GHEX_USE_GPU", False)) + + return args diff --git a/recipes/icon-dsl/25.8/gh200/repo/packages/hwmalloc/cmake_install_path.patch b/recipes/icon-dsl/25.8/gh200/repo/packages/hwmalloc/cmake_install_path.patch new file mode 100644 index 0000000..fa6fde1 --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/repo/packages/hwmalloc/cmake_install_path.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d5420e0..35dbe56 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -105,11 +105,11 @@ install(FILES ${PROJECT_BINARY_DIR}/include/hwmalloc/config.hpp + install(EXPORT HWMALLOC-targets + FILE HWMALLOC-targets.cmake + NAMESPACE HWMALLOC:: +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/hwmalloc/cmake) + + configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/HWMALLOCConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/HWMALLOCConfig.cmake +- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) ++ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/hwmalloc/cmake) + + write_basic_package_version_file(HWMALLOCConfigVersion.cmake + VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) +@@ -120,7 +120,7 @@ install( + ${CMAKE_CURRENT_BINARY_DIR}/HWMALLOCConfigVersion.cmake + ${CMAKE_CURRENT_LIST_DIR}/cmake/FindNUMA.cmake + DESTINATION +- ${CMAKE_INSTALL_LIBDIR}/cmake) ++ ${CMAKE_INSTALL_LIBDIR}/hwmalloc/cmake) + + export(EXPORT HWMALLOC-targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/HWMALLOC-targets.cmake") diff --git a/recipes/icon-dsl/25.8/gh200/repo/packages/hwmalloc/package.py b/recipes/icon-dsl/25.8/gh200/repo/packages/hwmalloc/package.py new file mode 100644 index 0000000..c656dc1 --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/repo/packages/hwmalloc/package.py @@ -0,0 +1,52 @@ +from spack.package import * + + +class Hwmalloc(CMakePackage, CudaPackage, ROCmPackage): + """HWMALLOC is a allocator which supports memory registration for e.g. remote memory access""" + + homepage = "https://github.com/ghex-org/hwmalloc" + url = "https://github.com/ghex-org/hwmalloc/archive/refs/tags/v0.3.0.tar.gz" + git = "https://github.com/ghex-org/hwmalloc.git" + maintainers = ["boeschf"] + + version("0.3.0", sha256="d4d4ac6087a806600d79fb62c02719ca3d58a412968fe1ef4a2fd58d9e7ee950") + version("0.2.0", sha256="734758a390a3258b86307e4aef50a7ca2e5d0e2e579f18aeefcd05397e114419") + version("0.1.0", sha256="06e9bfcef0ecce4d19531ccbe03592b502d1281c7a092bc0ff51ca187899b21c") + version("master", branch="master") + + depends_on("cxx", type="build") + + generator("ninja") + + depends_on("numactl", type=("build", "run")) + depends_on("boost", type=("build")) + depends_on("cmake@3.19:", type="build") + + variant( + "numa-throws", + default=False, + description="True if numa_tools may throw during initialization", + ) + variant("numa-local", default=True, description="Use numa_tools for local node allocations") + variant("logging", default=False, description="print logging info to cerr") + + patch("cmake_install_path.patch", when="@:0.3.0", level=1) + + def cmake_args(self): + args = [ + self.define_from_variant("HWMALLOC_NUMA_THROWS", "numa-throws"), + self.define_from_variant("HWMALLOC_NUMA_FOR_LOCAL", "numa-local"), + self.define_from_variant("HWMALLOC_ENABLE_LOGGING", "logging"), + self.define("HWMALLOC_WITH_TESTING", self.run_tests), + ] + + if "+cuda" in self.spec: + args.append(self.define("HWMALLOC_ENABLE_DEVICE", True)) + args.append(self.define("HWMALLOC_DEVICE_RUNTIME", "cuda")) + elif "+rocm" in self.spec: + args.append(self.define("HWMALLOC_ENABLE_DEVICE", True)) + args.append(self.define("HWMALLOC_DEVICE_RUNTIME", "hip")) + else: + args.append(self.define("HWMALLOC_ENABLE_DEVICE", False)) + + return args diff --git a/recipes/icon-dsl/25.8/gh200/repo/packages/icon4py/package.py b/recipes/icon-dsl/25.8/gh200/repo/packages/icon4py/package.py new file mode 100644 index 0000000..649a9f9 --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/repo/packages/icon4py/package.py @@ -0,0 +1,113 @@ +import json +import os +import pathlib + +import llnl +from llnl.util import tty +from spack import * + + +class Icon4py(Package): + extends("python") + depends_on("python@3.11:") + + variant("cuda", default=True, description="Enable CUDA support") + variant("distributed", default=True, description="Enable multinode support") + + depends_on("git") + depends_on("boost@1.85:", type=("build", "run")) + depends_on("py-uv@0.7:") + depends_on("bzip2", type="build") + depends_on("py-numpy") + depends_on("py-cffi") + depends_on("py-pybind11") + depends_on("py-nanobind") + depends_on("py-mpi4py", when="+distributed") + depends_on("py-cupy +cuda", when="+cuda") + depends_on("ghex +python", when="+distributed") + depends_on("ghex +python +cuda", when="+distributed +cuda") + + version( + "icon_20250328", + sha256="8573ef031d207438f549511e859f522c60163ea660aafea93ef4991b9010739a", + extension="zip", + ) + + def url_for_version(self, version): + return f"https://github.com/c2sm/icon4py/archive/refs/heads/{version}.zip" + + def install(self, spec, prefix): + uv = prepare_uv() + python_spec = spec["python"] + venv_path = prefix.share.venv + + tty.msg(f"creating venv using spack python at: {python_spec.command.path}") + uv( + "venv", + "--seed", + "--relocatable", + "--system-site-packages", + str(venv_path), + "--python", + python_spec.command.path, + ) + + tty.msg(f"grabbing spack installed packages (distributions)") + pip = Executable(venv_path.bin.pip) + spack_installed = get_installed_pkg(pip) + + tty.msg(f"installing missing packages") + uv( + "sync", + "--active", + "--extra", + "fortran", + "--inexact", + "--no-editable", + "--python", + str(venv_path.bin.python), + *no_install_options(spack_installed), + extra_env={"VIRTUAL_ENV": str(venv_path)}, + ) + + tty.msg(f"linking spack installed packages into venv") + pathlib.Path( + f"{venv_path.lib.python}{python_spec.version.up_to(2)}/site-packages/spack_installed.pth" + ).write_text(pythonpath_to_pth()) + + # uv("run", "--active", "py2fgen", "icon4py.tools.py2fgen.wrappers.all_bindings", "diffusion_init,diffusion_run,grid_init,solve_nh_init,solve_nh_run", "icon4py_bindings", "-o", prefix.src, extra_env={"VIRTUAL_ENV": str(venv_path)}) + + tty.msg(f"running py2fgen") + py2fgen = Executable(venv_path.bin.py2fgen) + py2fgen( + "icon4py.tools.py2fgen.wrappers.all_bindings", + "diffusion_init,diffusion_run,grid_init,solve_nh_init,solve_nh_run", + "icon4py_bindings", + "-o", + prefix.src, + extra_env={"VIRTUAL_ENV": str(venv_path)}, + ) + + +def prepare_uv(): + uv = which("uv") + uv.add_default_env("UV_NO_CACHE", "true") + uv.add_default_env("UV_NO_MANAGED_PYTHON", "true") + uv.add_default_env("UV_PYTHON_DOWNLOADS", "never") + return uv + + +def get_installed_pkg(pip): + return [ + item["name"] for item in json.loads(pip("list", "--format", "json", output=str)) + ] + + +def no_install_options(installed): + for name in installed: + yield "--no-install-package" + yield name + + +def pythonpath_to_pth(): + return "\n".join(os.environ["PYTHONPATH"].split(":")) diff --git a/recipes/icon-dsl/25.8/gh200/repo/packages/oomph/install_0.2.patch b/recipes/icon-dsl/25.8/gh200/repo/packages/oomph/install_0.2.patch new file mode 100644 index 0000000..5dc7e2e --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/repo/packages/oomph/install_0.2.patch @@ -0,0 +1,102 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ba19089..2ba222a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,12 @@ + cmake_minimum_required(VERSION 3.17) + # CMake version is set at 3.17 because of find_package(CUDAToolkit) + ++if (NOT ${CMAKE_VERSION} VERSION_LESS 3.27) ++ # new in 3.27: additionally use uppercase _ROOT ++ # environment and CMake variables for find_package ++ cmake_policy(SET CMP0144 NEW) ++endif() ++ + set(OOMPH_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + list(APPEND CMAKE_MODULE_PATH "${OOMPH_MODULE_PATH}") + +@@ -108,11 +114,11 @@ endif() + install(EXPORT oomph-targets + FILE oomph-targets.cmake + NAMESPACE oomph:: +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/oomph/cmake) + + configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/oomphConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/oomphConfig.cmake +- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) ++ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/oomph/cmake) + + write_basic_package_version_file(oomphConfigVersion.cmake + VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) +@@ -125,7 +131,7 @@ install( + ${CMAKE_CURRENT_LIST_DIR}/cmake/FindUCX.cmake + ${CMAKE_CURRENT_LIST_DIR}/cmake/FindPMIx.cmake + DESTINATION +- ${CMAKE_INSTALL_LIBDIR}/cmake) ++ ${CMAKE_INSTALL_LIBDIR}/oomph/cmake) + + export(EXPORT oomph-targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/oomph-targets.cmake") +diff --git a/cmake/oomph_external_dependencies.cmake b/cmake/oomph_external_dependencies.cmake +index ec672b5..a578ef5 100644 +--- a/cmake/oomph_external_dependencies.cmake ++++ b/cmake/oomph_external_dependencies.cmake +@@ -31,17 +31,30 @@ endif() + # --------------------------------------------------------------------- + # google test setup + # --------------------------------------------------------------------- +-add_external_cmake_project( +- NAME googletest +- PATH ext/googletest +- INTERFACE_NAME ext-gtest +- LIBS libgtest.a libgtest_main.a +- CMAKE_ARGS +- "-DCMAKE_BUILD_TYPE=release" +- "-DBUILD_SHARED_LIBS=OFF" +- "-DBUILD_GMOCK=OFF") +-# on some systems we need link explicitly against threads +-if (TARGET ext-gtest) +- find_package (Threads) +- target_link_libraries(ext-gtest INTERFACE Threads::Threads) ++cmake_dependent_option(OOMPH_USE_BUNDLED_GTEST "Use bundled googletest lib." ON ++ "OOMPH_USE_BUNDLED_LIBS" OFF) ++if (OOMPH_WITH_TESTING) ++ if(OOMPH_USE_BUNDLED_GTEST) ++ add_external_cmake_project( ++ NAME googletest ++ PATH ext/googletest ++ INTERFACE_NAME ext-gtest ++ LIBS libgtest.a libgtest_main.a ++ CMAKE_ARGS ++ "-DCMAKE_BUILD_TYPE=release" ++ "-DBUILD_SHARED_LIBS=OFF" ++ "-DBUILD_GMOCK=OFF") ++ # on some systems we need link explicitly against threads ++ if (TARGET ext-gtest) ++ find_package (Threads) ++ target_link_libraries(ext-gtest INTERFACE Threads::Threads) ++ endif() ++ else() ++ # Use system provided google test ++ find_package(GTest REQUIRED) ++ add_library(ext-gtest INTERFACE) ++ if (${CMAKE_VERSION} VERSION_LESS "3.20.0") ++ target_link_libraries(ext-gtest INTERFACE GTest::GTest GTest::Main) ++ else() ++ target_link_libraries(ext-gtest INTERFACE GTest::gtest GTest::gtest_main) ++ endif() ++ endif() + endif() +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 06d703a..5217bba 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -65,6 +65,7 @@ function(reg_parallel_test t_ lib n) + NAME ${t} + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${n} ${MPIEXEC_PREFLAGS} + $ ${MPIEXEC_POSTFLAGS}) ++ set_tests_properties(${t} PROPERTIES RUN_SERIAL TRUE) + endfunction() + + if (OOMPH_WITH_MPI) diff --git a/recipes/icon-dsl/25.8/gh200/repo/packages/oomph/install_0.3.patch b/recipes/icon-dsl/25.8/gh200/repo/packages/oomph/install_0.3.patch new file mode 100644 index 0000000..aac73e8 --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/repo/packages/oomph/install_0.3.patch @@ -0,0 +1,57 @@ +diff --git a/cmake/oomph_external_dependencies.cmake b/cmake/oomph_external_dependencies.cmake +index a578ef5..92de39b 100644 +--- a/cmake/oomph_external_dependencies.cmake ++++ b/cmake/oomph_external_dependencies.cmake +@@ -33,28 +33,30 @@ endif() + # --------------------------------------------------------------------- + cmake_dependent_option(OOMPH_USE_BUNDLED_GTEST "Use bundled googletest lib." ON + "OOMPH_USE_BUNDLED_LIBS" OFF) +-if(OOMPH_USE_BUNDLED_GTEST) +- add_external_cmake_project( +- NAME googletest +- PATH ext/googletest +- INTERFACE_NAME ext-gtest +- LIBS libgtest.a libgtest_main.a +- CMAKE_ARGS +- "-DCMAKE_BUILD_TYPE=release" +- "-DBUILD_SHARED_LIBS=OFF" +- "-DBUILD_GMOCK=OFF") +- # on some systems we need link explicitly against threads +- if (TARGET ext-gtest) +- find_package (Threads) +- target_link_libraries(ext-gtest INTERFACE Threads::Threads) +- endif() +-else() +- # Use system provided google test +- find_package(GTest REQUIRED) +- add_library(ext-gtest INTERFACE) +- if (${CMAKE_VERSION} VERSION_LESS "3.20.0") +- target_link_libraries(ext-gtest INTERFACE GTest::GTest GTest::Main) ++if (OOMPH_WITH_TESTING) ++ if(OOMPH_USE_BUNDLED_GTEST) ++ add_external_cmake_project( ++ NAME googletest ++ PATH ext/googletest ++ INTERFACE_NAME ext-gtest ++ LIBS libgtest.a libgtest_main.a ++ CMAKE_ARGS ++ "-DCMAKE_BUILD_TYPE=release" ++ "-DBUILD_SHARED_LIBS=OFF" ++ "-DBUILD_GMOCK=OFF") ++ # on some systems we need link explicitly against threads ++ if (TARGET ext-gtest) ++ find_package (Threads) ++ target_link_libraries(ext-gtest INTERFACE Threads::Threads) ++ endif() + else() +- target_link_libraries(ext-gtest INTERFACE GTest::gtest GTest::gtest_main) ++ # Use system provided google test ++ find_package(GTest REQUIRED) ++ add_library(ext-gtest INTERFACE) ++ if (${CMAKE_VERSION} VERSION_LESS "3.20.0") ++ target_link_libraries(ext-gtest INTERFACE GTest::GTest GTest::Main) ++ else() ++ target_link_libraries(ext-gtest INTERFACE GTest::gtest GTest::gtest_main) ++ endif() + endif() + endif() diff --git a/recipes/icon-dsl/25.8/gh200/repo/packages/oomph/package.py b/recipes/icon-dsl/25.8/gh200/repo/packages/oomph/package.py new file mode 100644 index 0000000..3b320f9 --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/repo/packages/oomph/package.py @@ -0,0 +1,109 @@ +from spack.package import * + + +class Oomph(CMakePackage, CudaPackage, ROCmPackage): + """Oomph is a non-blocking callback-based point-to-point communication library.""" + + homepage = "https://github.com/ghex-org/oomph" + url = "https://github.com/ghex-org/oomph/archive/refs/tags/v0.2.0.tar.gz" + git = "https://github.com/ghex-org/oomph.git" + maintainers = ["boeschf"] + + version("0.4.0", sha256="e342c872dfe4832be047f172dc55c12951950c79da2630b071c61607ef913144") + version("0.3.0", sha256="61e346d1ba28a859745de47f37edce39c7f5c5e1aab716493dc964e158fd99ec") + version("0.2.0", sha256="135cdb856aa817c053b6af1617869dbcd0ee97d34607e78874dd775ea389434e") + version("0.1.0", sha256="0ff36db0a5f30ae1bb02f6db6d411ea72eadd89688c00f76b4e722bd5a9ba90b") + version("main", branch="main") + + depends_on("cxx", type="build") + depends_on("fortran", type="build", when="+fortran-bindings") + + generator("ninja") + + backends = ("mpi", "ucx", "libfabric") + variant( + "backend", default="mpi", description="Transport backend", values=backends, multi=False + ) + + variant("fortran-bindings", default=False, description="Build Fortran bindings") + with when("+fortran-bindings"): + variant( + "fortran-fp", + default="float", + description="Floating point type", + values=("float", "double"), + multi=False, + ) + variant("fortran-openmp", default=True, description="Compile with OpenMP") + + variant( + "enable-barrier", + default=True, + description="Enable thread barrier (disable for task based runtime)", + ) + + depends_on("hwmalloc+cuda", when="+cuda") + depends_on("hwmalloc+rocm", when="+rocm") + depends_on("hwmalloc", when="~cuda~rocm") + + with when("backend=ucx"): + depends_on("ucx+thread_multiple") + depends_on("ucx+cuda", when="+cuda") + depends_on("ucx+rocm", when="+rocm") + variant("use-pmix", default="False", description="Use PMIx to establish out-of-band setup") + variant("use-spin-lock", default="False", description="Use pthread spin locks") + depends_on("pmix", when="+use-pmix") + + libfabric_providers = ("cxi", "efa", "gni", "psm2", "tcp", "verbs") + with when("backend=libfabric"): + variant( + "libfabric-provider", + default="tcp", + description="fabric", + values=libfabric_providers, + multi=False, + ) + for provider in libfabric_providers: + depends_on(f"libfabric fabrics={provider}", when=f"libfabric-provider={provider}") + + depends_on("mpi") + depends_on("boost+thread") + + depends_on("googletest", type=("build","test")) + + patch("install_0.2.patch", when="@:0.2.0", level=1) + patch("install_0.3.patch", when="@0.3.0", level=1) + + def cmake_args(self): + args = [ + self.define_from_variant("OOMPH_BUILD_FORTRAN", "fortran-bindings"), + self.define_from_variant("OOMPH_FORTRAN_OPENMP", "fortran-openmp"), + self.define_from_variant("OOMPH_UCX_USE_PMI", "use-pmix"), + self.define_from_variant("OOMPH_UCX_USE_SPIN_LOCK", "use-spin-lock"), + self.define_from_variant("OOMPH_ENABLE_BARRIER", "enable-barrier"), + self.define("OOMPH_WITH_TESTING", self.run_tests), + self.define("OOMPH_GIT_SUBMODULE", False), + self.define("OOMPH_USE_BUNDLED_LIBS", False), + ] + + if self.run_tests and self.spec.satisfies("^openmpi"): + args.append(self.define("MPIEXEC_PREFLAGS", "--oversubscribe")) + + if self.spec.variants["fortran-bindings"].value == True: + args.append(self.define("OOMPH_FORTRAN_FP", self.spec.variants["fortran-fp"].value)) + + for backend in self.backends: + args.append( + self.define( + f"OOMPH_WITH_{backend.upper()}", self.spec.variants["backend"].value == backend + ) + ) + + if self.spec.satisfies("backend=libfabric"): + args.append( + self.define( + "OOMPH_LIBFABRIC_PROVIDER", self.spec.variants["libfabric-provider"].value + ) + ) + + return args diff --git a/recipes/icon-dsl/25.8/gh200/repo/packages/uv/package.py b/recipes/icon-dsl/25.8/gh200/repo/packages/uv/package.py new file mode 100644 index 0000000..937a8d2 --- /dev/null +++ b/recipes/icon-dsl/25.8/gh200/repo/packages/uv/package.py @@ -0,0 +1,61 @@ +from spack.package import * + + +def translate_platform(platform_name: str) -> str: + if platform_name == "darwin": + return "apple-darwin" + elif platform_name == "linux": + return "unknown-linux-gnu" + return platform_name + + +def translate_arch(arch_name: str) -> str: + if arch_name in ["m1", "m2"]: + return "aarch64" + return arch_name + + +class Uv(Package): + """Install UV from binary releases""" + + url = ( + "https://github.com/astral-sh/uv/releases/download/0.7.12/uv-aarch64-apple-darwin.tar.gz", + ) + + version( + "0.7.12", + sha256="189108cd026c25d40fb086eaaf320aac52c3f7aab63e185bac51305a1576fc7e", + extension=".tar.gz", + ) + + def url_for_version(self, version): + arch = translate_arch(self.spec.target) + platform = translate_platform(self.spec.platform) + if platform == "darwin": + platform = "apple-darwin" + if arch == "m1": + arch = "aarch64" + return f"https://github.com/astral-sh/uv/releases/download/{version}/uv-{arch}-{platform}.tar.gz" + + def do_stage(self, mirror_only=False): + checksums = { + ("0.7.12", "apple-darwin", "aarch64"): ( + "189108cd026c25d40fb086eaaf320aac52c3f7aab63e185bac51305a1576fc7e" + ) + } + version = str(self.spec.version) + arch = translate_arch(self.spec.target) + platform = translate_platform(self.spec.platform) + key = (version, platform, arch) + + if key not in checksums: + msg = f"Unsupported platform/arch for version {version}: {platform}-{arch}." + raise InstallError(msg) + + self.fetcher.digest = checksums[key] + super().do_stage(mirror_only) + + def install(self, spec, prefix): + mkdir(prefix.bin) + install("uv", prefix.bin.uv) + install("uvx", prefix.bin.uvx) diff --git a/recipes/icon-dsl/README.md b/recipes/icon-dsl/README.md new file mode 100644 index 0000000..bb7fc25 --- /dev/null +++ b/recipes/icon-dsl/README.md @@ -0,0 +1,2 @@ +# ICON-DSL UENV +Experimental ALPS user environment for running icon-exclaim with DSL dycore.