Skip to content

Commit

Permalink
[balfrin] Update Balfrin sysconfig to v5 env (#806)
Browse files Browse the repository at this point in the history
- use v5 env
- change nwp master icon test to use mch prod gpu config only
  • Loading branch information
dominichofer authored Aug 14, 2023
1 parent 5bb7348 commit 2a932c2
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
**.swo
log/
env/
.venv/
spack-build_stage/
spack-test_stage/
spack-misc_cache/
spack-misc_cache/
user-config/
user-cache/
102 changes: 100 additions & 2 deletions repos/alps/packages/cray-mpich/package.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Copyright 2013-2023 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)
Expand All @@ -15,9 +15,36 @@ class CrayMpich(Package):

homepage = "https://www.hpe.com/us/en/compute/hpc/hpc-software.html"
url = "https://jfrog.svc.cscs.ch/artifactory/cray-mpich/cray-mpich-8.1.18.4-gcc.tar.gz"

maintainers = ["haampie"]

version(
"8.1.25-gcc",
sha256=
"95a8a161dc9704ea7b971dc8c1b7ec4d63de57e2f6932f0aa3d1ff1d73899765",
url=
"https://jfrog.svc.cscs.ch/artifactory/cray-mpich/cray-mpich-8.1.25-gcc.tar.gz",
)
version(
"8.1.25-nvhpc",
sha256=
"7a89a3f5d35538a4f7984c1403ca888e1b018485597318eaefa4639341e1eb27",
url=
"https://jfrog.svc.cscs.ch/artifactory/cray-mpich/cray-mpich-8.1.25-nvhpc.tar.gz",
)
version(
"8.1.24-gcc",
sha256=
"3da0e421c3faaadbe18e57dd033b0ec6513e0d9ed7fbfa77f05a02bada4cd483",
url=
"https://jfrog.svc.cscs.ch/artifactory/cray-mpich/cray-mpich-8.1.24-gcc.tar.gz",
)
version(
"8.1.24-nvhpc",
sha256=
"1b507f4e9150cf188a0571aad0d190fc8ee981def1d6198c998673d73828ed6f",
url=
"https://jfrog.svc.cscs.ch/artifactory/cray-mpich/cray-mpich-8.1.24-nvhpc.tar.gz",
)
version(
"8.1.23-gcc",
sha256=
Expand Down Expand Up @@ -83,6 +110,36 @@ class CrayMpich(Package):
# libfabric.so.1
depends_on("libfabric@1:", type="link")

with when("@8.1.25-gcc"):
# libgfortran.so.5
conflicts("%gcc@:7")
for __compiler in spack.compilers.supported_compilers():
if __compiler != "gcc":
conflicts("%{}".format(__compiler), msg="gcc required")

with when("@8.1.25-nvhpc"):
conflicts("%nvhpc@:20.7")
conflicts("+rocm")
conflicts("~cuda")
for __compiler in spack.compilers.supported_compilers():
if __compiler != "nvhpc":
conflicts("%{}".format(__compiler), msg="nvhpc required")

with when("@8.1.24-gcc"):
# libgfortran.so.5
conflicts("%gcc@:7")
for __compiler in spack.compilers.supported_compilers():
if __compiler != "gcc":
conflicts("%{}".format(__compiler), msg="gcc required")

with when("@8.1.24-nvhpc"):
conflicts("%nvhpc@:20.7")
conflicts("+rocm")
conflicts("~cuda")
for __compiler in spack.compilers.supported_compilers():
if __compiler != "nvhpc":
conflicts("%{}".format(__compiler), msg="nvhpc required")

with when("@8.1.23-gcc"):
# libgfortran.so.5
conflicts("%gcc@:7")
Expand Down Expand Up @@ -238,3 +295,44 @@ def fixup_compiler_paths(self):
gtl_library,
self.prefix.bin.mpifort,
string=True)

@property
def headers(self):
hdrs = find_headers("mpi", self.prefix.include, recursive=True)
hdrs += find_headers("cray_version",
self.prefix.include,
recursive=True) # cray_version.h
# cray-mpich depends on cray-pmi
hdrs += find_headers("pmi", self.prefix.include,
recursive=True) # See cray-pmi package
hdrs.directories = os.path.dirname(hdrs[0])
return hdrs

@property
def libs(self):
query_parameters = self.spec.last_query.extra_parameters

libraries = ["libmpi", "libmpich"]

if "f77" in query_parameters:
libraries.extend(
["libmpifort", "libmpichfort", "libfmpi", "libfmpich"])

if "f90" in query_parameters:
libraries.extend(["libmpif90", "libmpichf90"])

if "+cuda" in self.spec:
libraries.append("libmpi*cuda")

if "+rocm" in self.spec:
libraries.append("libmpi*hsa")

libs = []
for lib_folder in [self.prefix.lib, self.prefix.lib64]:
libs += find_libraries(libraries, root=lib_folder, recursive=True)
# cray-mpich depends on cray-pmi
libs += find_libraries("libpmi", root=lib_folder, recursive=True)
libs += find_libraries("libopa", root=lib_folder, recursive=True)
libs += find_libraries("libmpl", root=lib_folder, recursive=True)

return libs
16 changes: 8 additions & 8 deletions sysconfigs/balfrin/compilers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ compilers:
- compiler:
spec: gcc@11.3.0
paths:
cc: /mch-environment/v4/linux-sles15-zen3/gcc-11.3.0/gcc-11.3.0-gyb6liat3gnkygiwzvrqjof2rnqw3krd/bin/gcc
cxx: /mch-environment/v4/linux-sles15-zen3/gcc-11.3.0/gcc-11.3.0-gyb6liat3gnkygiwzvrqjof2rnqw3krd/bin/g++
f77: /mch-environment/v4/linux-sles15-zen3/gcc-11.3.0/gcc-11.3.0-gyb6liat3gnkygiwzvrqjof2rnqw3krd/bin/gfortran
fc: /mch-environment/v4/linux-sles15-zen3/gcc-11.3.0/gcc-11.3.0-gyb6liat3gnkygiwzvrqjof2rnqw3krd/bin/gfortran
cc: /mch-environment/v5/linux-sles15-zen3/gcc-11.3.0/gcc-11.3.0-7vcnno655nolw6ted2kgzoumoocsxxin/bin/gcc
cxx: /mch-environment/v5/linux-sles15-zen3/gcc-11.3.0/gcc-11.3.0-7vcnno655nolw6ted2kgzoumoocsxxin/bin/g++
f77: /mch-environment/v5/linux-sles15-zen3/gcc-11.3.0/gcc-11.3.0-7vcnno655nolw6ted2kgzoumoocsxxin/bin/gfortran
fc: /mch-environment/v5/linux-sles15-zen3/gcc-11.3.0/gcc-11.3.0-7vcnno655nolw6ted2kgzoumoocsxxin/bin/gfortran
flags: {}
operating_system: sles15
target: x86_64
Expand All @@ -15,10 +15,10 @@ compilers:
- compiler:
spec: nvhpc@23.3
paths:
cc: /mch-environment/v4/linux-sles15-zen3/gcc-11.3.0/nvhpc-23.3-bubpfon3axcnv5k2e2mrd6myvrgg3lby/Linux_x86_64/23.3/compilers/bin/nvc
cxx: /mch-environment/v4/linux-sles15-zen3/gcc-11.3.0/nvhpc-23.3-bubpfon3axcnv5k2e2mrd6myvrgg3lby/Linux_x86_64/23.3/compilers/bin/nvc++
f77: /mch-environment/v4/linux-sles15-zen3/gcc-11.3.0/nvhpc-23.3-bubpfon3axcnv5k2e2mrd6myvrgg3lby/Linux_x86_64/23.3/compilers/bin/nvfortran
fc: /mch-environment/v4/linux-sles15-zen3/gcc-11.3.0/nvhpc-23.3-bubpfon3axcnv5k2e2mrd6myvrgg3lby/Linux_x86_64/23.3/compilers/bin/nvfortran
cc: /mch-environment/v5/linux-sles15-zen3/gcc-11.3.0/nvhpc-23.3-4sf7jktvmwpir5zm3bvnqvsjjaihxqzb/Linux_x86_64/23.3/compilers/bin/nvc
cxx: /mch-environment/v5/linux-sles15-zen3/gcc-11.3.0/nvhpc-23.3-4sf7jktvmwpir5zm3bvnqvsjjaihxqzb/Linux_x86_64/23.3/compilers/bin/nvc++
f77: /mch-environment/v5/linux-sles15-zen3/gcc-11.3.0/nvhpc-23.3-4sf7jktvmwpir5zm3bvnqvsjjaihxqzb/Linux_x86_64/23.3/compilers/bin/nvfortran
fc: /mch-environment/v5/linux-sles15-zen3/gcc-11.3.0/nvhpc-23.3-4sf7jktvmwpir5zm3bvnqvsjjaihxqzb/Linux_x86_64/23.3/compilers/bin/nvfortran
flags: {}
operating_system: sles15
target: x86_64
Expand Down
2 changes: 1 addition & 1 deletion sysconfigs/balfrin/upstreams.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
upstreams:
system:
install_tree: /mch-environment/v4
install_tree: /mch-environment/v5
8 changes: 3 additions & 5 deletions test/system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,9 @@ def test_install_2_6_6_nvhpc(self):

@pytest.mark.no_daint # libxml2 %nvhpc fails to build
def test_install_nwp_gpu(self):
spack_install_and_test(f'icon @nwp-master %nvhpc +cuda')

@pytest.mark.no_daint # libxml2 %nvhpc fails to build
def test_install_nwp_cpu(self):
spack_install_and_test(f'icon @nwp-master %nvhpc ~cuda')
spack_install_and_test(
'icon @nwp-master %nvhpc +grib2 +eccodes-definitions +ecrad +art +dace gpu=openacc+cuda +mpi-gpu +realloc-buf +pgi-inlib ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma +mixed-precision'
)

@pytest.mark.no_balfrin # config file does not exist for this machine
def test_install_c2sm_test_cpu_gcc(self):
Expand Down

0 comments on commit 2a932c2

Please sign in to comment.