From 84e459da4a12a737ff7cf87d2e4fc05c82488585 Mon Sep 17 00:00:00 2001 From: Gerald Ragghianti Date: Mon, 7 Jul 2025 14:33:22 +0000 Subject: [PATCH 1/5] New package dplasma with required updates to parsec package --- .../builtin/packages/dplasma/package.py | 57 +++++++++++++++++++ .../packages/parsec/apply-header.patch | 14 +++++ .../builtin/packages/parsec/package.py | 4 +- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 repos/spack_repo/builtin/packages/dplasma/package.py create mode 100644 repos/spack_repo/builtin/packages/parsec/apply-header.patch diff --git a/repos/spack_repo/builtin/packages/dplasma/package.py b/repos/spack_repo/builtin/packages/dplasma/package.py new file mode 100644 index 00000000000..bb425fedc7b --- /dev/null +++ b/repos/spack_repo/builtin/packages/dplasma/package.py @@ -0,0 +1,57 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +# + +from spack_repo.builtin.build_systems.cmake import CMakePackage +from spack_repo.builtin.build_systems.cuda import CudaPackage +from spack.package import * + + +class Dplasma(CMakePackage, CudaPackage): + """"DPLASMA is a highly optimized, accelerator-aware, implementation of a + dense linear algebra package for distributed heterogeneous systems. It is + designed to deliver sustained performance for distributed systems where each + node featuring multiple sockets of multicore processors, and if available, + accelerators, using the PaRSEC runtime as a backend. """ + + homepage = "https://github.com/ICLDisco/dplasma" + git = "https://github.com/ICLDisco/dplasma.git" + maintainers("G-Ragghianti", "abouteiller", "bosilca", "herault") + + license("BSD-3-Clause-Open-MPI") + + version("develop", branch="master") + + variant( + "build_type", + default="RelWithDebInfo", + description="CMake build type", + values=("Debug", "Release", "RelWithDebInfo"), + ) + variant("shared", default=True, description="Build a shared library") + variant("cuda", default=True, description="Build with CUDA") + variant("internal-parsec", default="False", description="Build with internal PaRSEC") + + depends_on("c", type="build") + depends_on("cmake@3.18:", type="build") + depends_on("python", type="build") + depends_on("flex", type="build") + depends_on("bison", type="build") + depends_on("hwloc") + depends_on("mpi") + depends_on("blas") + depends_on("lapack") + depends_on("parsec+cuda", when="~internal-parsec+cuda") + depends_on("parsec~cuda", when="~internal-parsec~cuda") + + def cmake_args(self): + args = [ + self.define_from_variant("CMAKE_BUILD_TYPE", "build_type"), + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("DPLASMA_GPU_WITH_CUDA", "cuda"), + self.define("DPLASMA_GPU_WITH_HIP", "Off"), + ] + if "~internal-parsec" in self.spec: + args.append(self.define("PaRSEC_ROOT", self.spec["parsec"].prefix)) + return args diff --git a/repos/spack_repo/builtin/packages/parsec/apply-header.patch b/repos/spack_repo/builtin/packages/parsec/apply-header.patch new file mode 100644 index 00000000000..993edd43f0c --- /dev/null +++ b/repos/spack_repo/builtin/packages/parsec/apply-header.patch @@ -0,0 +1,14 @@ +diff --git a/parsec/data_dist/matrix/CMakeLists.txt b/parsec/data_dist/matrix/CMakeLists.txt +index 51beffec2..597557c08 100644 +--- a/parsec/data_dist/matrix/CMakeLists.txt ++++ b/parsec/data_dist/matrix/CMakeLists.txt +@@ -32,7 +32,7 @@ if( TARGET parsec-ptgpp ) + target_ptg_sources(parsec PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/reduce_col.jdf;${CMAKE_CURRENT_SOURCE_DIR}/reduce_row.jdf;${CMAKE_CURRENT_SOURCE_DIR}/reduce.jdf;${CMAKE_CURRENT_SOURCE_DIR}/diag_band_to_rect.jdf;${CMAKE_CURRENT_SOURCE_DIR}/apply.jdf") + set_property(TARGET parsec + APPEND PROPERTY +- PRIVATE_HEADER_H data_dist/matrix/diag_band_to_rect.h) ++ PRIVATE_HEADER_H data_dist/matrix/diag_band_to_rect.h data_dist/matrix/apply.h) + endif( TARGET parsec-ptgpp ) + + target_sources(parsec PRIVATE ${sources}) + diff --git a/repos/spack_repo/builtin/packages/parsec/package.py b/repos/spack_repo/builtin/packages/parsec/package.py index 10fc41bb2a3..be887e0c8b5 100644 --- a/repos/spack_repo/builtin/packages/parsec/package.py +++ b/repos/spack_repo/builtin/packages/parsec/package.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) # - from spack_repo.builtin.build_systems.cmake import CMakePackage from spack_repo.builtin.build_systems.cuda import CudaPackage @@ -38,6 +37,8 @@ class Parsec(CMakePackage, CudaPackage): url="https://github.com/ICLDisco/parsec/archive/refs/tags/v1.1.0.tar.gz", ) + patch("apply-header.patch", when="@4.0.2411") + variant( "build_type", default="RelWithDebInfo", @@ -85,6 +86,7 @@ def cmake_args(self): self.define_from_variant("PARSEC_PROF_TRACE", "profile"), self.define_from_variant("PARSEC_DEBUG_HISTORY", "debug_verbose"), self.define_from_variant("PARSEC_DEBUG_PARANOID", "debug_verbose"), + self.define("PARSEC_GPU_WITH_HIP", "Off"), ] return args From 471f12baa1c95bac490e6b9720e2fd3da3e81a30 Mon Sep 17 00:00:00 2001 From: Gerald Ragghianti Date: Mon, 7 Jul 2025 14:48:40 +0000 Subject: [PATCH 2/5] Style fix --- repos/spack_repo/builtin/packages/dplasma/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/repos/spack_repo/builtin/packages/dplasma/package.py b/repos/spack_repo/builtin/packages/dplasma/package.py index bb425fedc7b..2e37479b334 100644 --- a/repos/spack_repo/builtin/packages/dplasma/package.py +++ b/repos/spack_repo/builtin/packages/dplasma/package.py @@ -5,6 +5,7 @@ from spack_repo.builtin.build_systems.cmake import CMakePackage from spack_repo.builtin.build_systems.cuda import CudaPackage + from spack.package import * From 25071070e96b4624a11069291d9a6856940dd39a Mon Sep 17 00:00:00 2001 From: Gerald Ragghianti Date: Mon, 7 Jul 2025 14:52:00 +0000 Subject: [PATCH 3/5] Style fix --- repos/spack_repo/builtin/packages/dplasma/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/spack_repo/builtin/packages/dplasma/package.py b/repos/spack_repo/builtin/packages/dplasma/package.py index 2e37479b334..6a0bd4afe57 100644 --- a/repos/spack_repo/builtin/packages/dplasma/package.py +++ b/repos/spack_repo/builtin/packages/dplasma/package.py @@ -10,11 +10,11 @@ class Dplasma(CMakePackage, CudaPackage): - """"DPLASMA is a highly optimized, accelerator-aware, implementation of a + """DPLASMA is a highly optimized, accelerator-aware, implementation of a dense linear algebra package for distributed heterogeneous systems. It is designed to deliver sustained performance for distributed systems where each node featuring multiple sockets of multicore processors, and if available, - accelerators, using the PaRSEC runtime as a backend. """ + accelerators, using the PaRSEC runtime as a backend.""" homepage = "https://github.com/ICLDisco/dplasma" git = "https://github.com/ICLDisco/dplasma.git" From 9bbb34d10e8ebcd12062408c3c5d6fb753b8b275 Mon Sep 17 00:00:00 2001 From: G-Ragghianti Date: Fri, 1 Aug 2025 10:12:52 -0400 Subject: [PATCH 4/5] Adding patch comment --- repos/spack_repo/builtin/packages/parsec/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/repos/spack_repo/builtin/packages/parsec/package.py b/repos/spack_repo/builtin/packages/parsec/package.py index be887e0c8b5..e6dd51a93de 100644 --- a/repos/spack_repo/builtin/packages/parsec/package.py +++ b/repos/spack_repo/builtin/packages/parsec/package.py @@ -37,6 +37,8 @@ class Parsec(CMakePackage, CudaPackage): url="https://github.com/ICLDisco/parsec/archive/refs/tags/v1.1.0.tar.gz", ) + // Add data_dist/matrix/apply.h to the list of header files to install. + // This is required for building against this parsec installation. patch("apply-header.patch", when="@4.0.2411") variant( From 4f95b80452fd35b1ae65ea5b7a78b0b80418c433 Mon Sep 17 00:00:00 2001 From: G-Ragghianti Date: Fri, 1 Aug 2025 10:15:44 -0400 Subject: [PATCH 5/5] Fixing comment --- repos/spack_repo/builtin/packages/parsec/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/spack_repo/builtin/packages/parsec/package.py b/repos/spack_repo/builtin/packages/parsec/package.py index e6dd51a93de..abce8323517 100644 --- a/repos/spack_repo/builtin/packages/parsec/package.py +++ b/repos/spack_repo/builtin/packages/parsec/package.py @@ -37,8 +37,8 @@ class Parsec(CMakePackage, CudaPackage): url="https://github.com/ICLDisco/parsec/archive/refs/tags/v1.1.0.tar.gz", ) - // Add data_dist/matrix/apply.h to the list of header files to install. - // This is required for building against this parsec installation. + # Add data_dist/matrix/apply.h to the list of header files to install. + # This is required for building against this parsec installation. patch("apply-header.patch", when="@4.0.2411") variant(