elpa: new version and recipe tuning (#44749)

Add version 2024.03.001 and fix #43902.

---------

Co-authored-by: Rocco Meli <r.meli@bluemail.ch>
This commit is contained in:
Loris Ercole 2024-06-20 23:16:10 +02:00 committed by GitHub
parent 9c31ff74c4
commit 5e8f9ed1c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,6 +24,9 @@ class Elpa(AutotoolsPackage, CudaPackage, ROCmPackage):
version("master", branch="master")
version(
"2024.03.001", sha256="41c6cbf56d2dac26443faaba8a77307d261bf511682a64b96e24def77c813622"
)
version(
"2023.11.001-patched",
sha256="62ee109afc06539507f459c08b958dc4db65b757dbd77f927678c77f7687415e",
@ -48,11 +51,18 @@ class Elpa(AutotoolsPackage, CudaPackage, ROCmPackage):
variant("openmp", default=True, description="Activates OpenMP support")
variant("mpi", default=True, description="Activates MPI support")
variant("gpu_streams", default=True, description="Activates GPU streams support")
with when("@2021.11.001:"):
variant(
"autotune", default=False, description="Enables autotuning for matrix restribution"
)
variant(
"gpu_streams", default=True, when="+cuda", description="Activates GPU streams support"
)
patch("fujitsu.patch", when="%fj")
depends_on("autoconf", type="build", when="@master")
depends_on("autoconf@2.71:", type="build", when="@master")
depends_on("automake", type="build", when="@master")
depends_on("blas")
@ -62,12 +72,20 @@ class Elpa(AutotoolsPackage, CudaPackage, ROCmPackage):
depends_on("rocblas", when="+rocm")
depends_on("libtool", type="build")
depends_on("python@3:", type="build")
depends_on("scalapack", when="+autotune")
with when("@2021.11.01:"):
variant(
"autotune", default=False, description="Enables autotuning for matrix restribution"
# Force openmp propagation on some providers of blas/lapack, as adviced by docs
# https://gitlab.mpcdf.mpg.de/elpa/elpa/-/blob/master/documentation/PERFORMANCE_TUNING.md?ref_type=heads#builds-with-openmp-enabled
with when("+openmp"):
requires("^openblas threads=openmp", when="^[virtuals=blas,lapack] openblas")
requires("^intel-mkl threads=openmp", when="^[virtuals=blas,lapack] intel-mkl")
requires(
"^intel-oneapi-mkl threads=openmp", when="^[virtuals=blas,lapack] intel-oneapi-mkl"
)
requires(
"^intel-parallel-studio threads=openmp",
when="^[virtuals=blas,lapack] intel-parallel-studio",
)
depends_on("scalapack", when="+autotune")
# fails to build due to broken type-bound procedures in OMP parallel regions
conflicts(
@ -76,10 +94,9 @@ class Elpa(AutotoolsPackage, CudaPackage, ROCmPackage):
msg="ELPA-2021.05.001+ requires GCC-8+ for OpenMP support",
)
conflicts("+mpi", when="+rocm", msg="ROCm support and MPI are not yet compatible")
conflicts(
"+gpu_streams",
when="+openmp",
when="@:2023.11.001-patched +openmp",
msg="GPU streams currently not supported in combination with OpenMP",
)
@ -193,14 +210,9 @@ def configure_args(self):
options += self.enable_or_disable("openmp")
# Additional linker search paths and link libs
ldflags = [spec["blas"].libs.search_flags, spec["lapack"].libs.search_flags]
ldflags = [spec["blas"].libs.search_flags, spec["lapack"].libs.search_flags, "-lstdc++"]
libs = [spec["lapack"].libs.link_flags, spec["blas"].libs.link_flags]
# If using blas with openmp support, link with openmp
# Needed for Spack-provided OneAPI MKL and for many externals
if self.spec["blas"].satisfies("threads=openmp"):
ldflags.append(self.compiler.openmp_flag)
options += [f'LDFLAGS={" ".join(ldflags)}', f'LIBS={" ".join(libs)}']
if "+mpi" in self.spec: