Skip to content

Commit 1f38202

Browse files
authored
Merge pull request #5141 from lexming/fix-nvhpc-hmns
fix handling of NVHPC toolchain with HMNS
2 parents 241faa8 + 0564af2 commit 1f38202

3 files changed

Lines changed: 59 additions & 5 deletions

File tree

easybuild/tools/module_naming_scheme/hierarchical_mns.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,18 @@ def det_modpath_extensions(self, ec):
240240
raise EasyBuildError("No compiler available in toolchain %s used to install MPI library %s v%s, "
241241
"which is required by the active module naming scheme.",
242242
ec['toolchain'], ec['name'], ec['version'])
243-
else:
244-
tc_comp_name, tc_comp_ver = tc_comp_info
245-
fullver = self.det_full_version(ec)
246-
paths.append(os.path.join(MPI, tc_comp_name, tc_comp_ver, ec['name'], fullver))
243+
tc_comp_name, tc_comp_ver = tc_comp_info
244+
fullver = self.det_full_version(ec)
245+
paths.append(os.path.join(MPI, tc_comp_name, tc_comp_ver, ec['name'], fullver))
247246

248-
# special case for Cray toolchains
249247
elif modclass == MODULECLASS_TOOLCHAIN and tc_comp_info is None:
248+
# special case for Cray toolchains
250249
if any(ec.name.startswith(x) for x in CRAY_TOOLCHAIN_NAME_PREFIXES):
251250
paths.append(os.path.join(TOOLCHAIN, ec.name, ec.version))
251+
# special case for NVHPC toolchains that lack standalone MPI component
252+
elif ec.name == "NVHPC" and "GCCcore" not in {dep['name'] for dep in ec['dependencies']}:
253+
fullver = self.det_full_version(ec)
254+
paths.append(os.path.join(MPI, "nvidia-compilers", fullver, ec.name, fullver))
252255

253256
return paths
254257

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# should be EB_NVHPC, but toy is enough for testing purposes
2+
easyblock = 'EB_toy'
3+
4+
name = 'NVHPC'
5+
version = '25.9'
6+
7+
homepage = 'https://developer.nvidia.com/hpc-sdk/'
8+
description = """Complete toolchain based on NVIDIA HPC SDK. Includes C, C++ and FORTRAN
9+
compilers (nvidia-compilers), an MPI implementation based on OpenMPI (NVHPCX)
10+
and math libraries based on OpenBLAS and ScaLAPACK."""
11+
12+
toolchain = SYSTEM
13+
14+
# By downloading, you accept the HPC SDK Software License Agreement
15+
# https://docs.nvidia.com/hpc-sdk/eula/index.html
16+
local_tarball_tmpl = 'nvhpc_2025_%%(version_major)s%%(version_minor)s_Linux_%s_cuda_multi.tar.gz'
17+
source_urls = ['https://developer.download.nvidia.com/hpc-sdk/%(version)s/']
18+
sources = [local_tarball_tmpl % '%(arch)s']
19+
checksums = [
20+
{
21+
local_tarball_tmpl % 'aarch64':
22+
'c50f5cef29a3d535605409effab26c45bb36ba237968565856f733d7b733b514',
23+
local_tarball_tmpl % 'x86_64':
24+
'382e50122119a7aff4cfb3e3180342d02e09a9e47beaaac66441ff843f89077d',
25+
}
26+
]
27+
28+
dependencies = [
29+
('nvidia-compilers', version),
30+
]
31+
32+
# NVHPC needs CUDA to work. This easyconfig uses CUDA bundled in NVHPC
33+
# The default CUDA version used by NVHPC is the one defined in nvidia-compilers
34+
35+
# The default Compute Capability used by NVHPC is the one defined in nvidia-compilers (if any)
36+
37+
moduleclass = 'toolchain'

test/framework/module_generator.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,14 @@ def test_ec(ecfile, short_modname, mod_subdir, modpath_exts, user_modpath_exts,
16391639
['Toolchain/cpeGNU/21.04'],
16401640
['Core']),
16411641
'HPL-2.1-CrayCCE-5.1.29.eb': ('HPL/2.1', 'Toolchain/CrayCCE/5.1.29', [], [], ['Core']),
1642+
'nvidia-compilers-25.9.eb': ('nvidia-compilers/25.9', 'Core',
1643+
['Compiler/nvidia-compilers/25.9'],
1644+
['Compiler/nvidia-compilers/25.9'],
1645+
['Core']),
1646+
'NVHPC-25.9.eb': ('NVHPC/25.9', 'Core',
1647+
['MPI/nvidia-compilers/25.9/NVHPC/25.9'],
1648+
['MPI/nvidia-compilers/25.9/NVHPC/25.9'],
1649+
['Core']),
16421650
}
16431651
for ecfile, mns_vals in test_ecs.items():
16441652
test_ec(ecfile, *mns_vals)
@@ -1676,6 +1684,12 @@ def test_ec(ecfile, short_modname, mod_subdir, modpath_exts, user_modpath_exts,
16761684
['MPI/intel/%s/impi/5.1.2.150' % iccver]),
16771685
imkl_ec: ('imkl/11.3.1.150', 'MPI/intel/%s/impi/5.1.2.150/numlib' % iccver,
16781686
[], []),
1687+
'nvidia-compilers-25.9.eb': ('nvidia-compilers/25.9', 'Core/compiler',
1688+
['Compiler/nvidia-compilers/25.9/%s' % c for c in moduleclasses],
1689+
['Compiler/nvidia-compilers/25.9']),
1690+
'NVHPC-25.9.eb': ('NVHPC/25.9', 'Core/toolchain',
1691+
['MPI/nvidia-compilers/25.9/NVHPC/25.9/%s' % c for c in moduleclasses],
1692+
['MPI/nvidia-compilers/25.9/NVHPC/25.9']),
16791693
}
16801694
for ecfile, mns_vals in test_ecs.items():
16811695
test_ec(ecfile, *mns_vals, init_modpaths=['Core/%s' % c for c in moduleclasses])

0 commit comments

Comments
 (0)