Skip to content

Commit dfb7167

Browse files
authored
Merge pull request #3745 from akesandgren/fix-hmns-for-intel-compilers
fix location for modules installed with intel-compilers toolchain in HierarchicalMNS by always checking toolchain compiler name against template map
2 parents bf08de0 + 763d727 commit dfb7167

File tree

8 files changed

+124
-19
lines changed

8 files changed

+124
-19
lines changed

easybuild/tools/module_naming_scheme/hierarchical_mns.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,28 @@ def det_toolchain_compilers_name_version(self, tc_comps):
116116
if tc_comps is None:
117117
# no compiler in toolchain, system toolchain
118118
res = None
119-
elif len(tc_comps) == 1:
120-
tc_comp = tc_comps[0]
121-
if tc_comp is None:
122-
res = None
123-
else:
124-
res = (tc_comp['name'], self.det_full_version(tc_comp))
125119
else:
126-
comp_versions = dict([(comp['name'], self.det_full_version(comp)) for comp in tc_comps])
127-
comp_names = comp_versions.keys()
128-
key = ','.join(sorted(comp_names))
129-
if key in COMP_NAME_VERSION_TEMPLATES:
130-
tc_comp_name, tc_comp_ver_tmpl = COMP_NAME_VERSION_TEMPLATES[key]
131-
tc_comp_ver = tc_comp_ver_tmpl % comp_versions
132-
# make sure that icc/ifort versions match (unless not existing as separate modules)
133-
if tc_comp_name == 'intel' and comp_versions.get('icc') != comp_versions.get('ifort'):
134-
raise EasyBuildError("Bumped into different versions for Intel compilers: %s", comp_versions)
120+
if len(tc_comps) > 0 and tc_comps[0]:
121+
comp_versions = dict([(comp['name'], self.det_full_version(comp)) for comp in tc_comps])
122+
comp_names = comp_versions.keys()
123+
key = ','.join(sorted(comp_names))
124+
if key in COMP_NAME_VERSION_TEMPLATES:
125+
tc_comp_name, tc_comp_ver_tmpl = COMP_NAME_VERSION_TEMPLATES[key]
126+
tc_comp_ver = tc_comp_ver_tmpl % comp_versions
127+
# make sure that icc/ifort versions match (unless not existing as separate modules)
128+
if tc_comp_name == 'intel' and comp_versions.get('icc') != comp_versions.get('ifort'):
129+
raise EasyBuildError("Bumped into different versions for Intel compilers: %s", comp_versions)
130+
res = (tc_comp_name, tc_comp_ver)
131+
else:
132+
if len(tc_comps) == 1:
133+
tc_comp = tc_comps[0]
134+
res = (tc_comp['name'], self.det_full_version(tc_comp))
135+
else:
136+
raise EasyBuildError("Unknown set of toolchain compilers, module naming scheme needs work: %s",
137+
comp_names)
135138
else:
136-
raise EasyBuildError("Unknown set of toolchain compilers, module naming scheme needs work: %s",
137-
comp_names)
138-
res = (tc_comp_name, tc_comp_ver)
139+
res = None
140+
139141
return res
140142

141143
def det_module_subdir(self, ec):
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This is an easyconfig file for EasyBuild, see http://easybuilders.github.io/easybuild
2+
easyblock = 'Toolchain'
3+
4+
name = 'iimpi'
5+
version = '2021a'
6+
7+
homepage = 'https://software.intel.com/parallel-studio-xe'
8+
description = """Intel C/C++ and Fortran compilers, alongside Intel MPI."""
9+
10+
toolchain = SYSTEM
11+
12+
local_comp_ver = '2021.2.0'
13+
dependencies = [
14+
('intel-compilers', local_comp_ver),
15+
('impi', local_comp_ver, '', ('intel-compilers', local_comp_ver)),
16+
]
17+
18+
moduleclass = 'toolchain'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# dummy easyconfig, only for use with easybuild-framwork test suite!
2+
easyblock = 'Toolchain'
3+
4+
name = 'imkl'
5+
version = '2021.2.0'
6+
7+
homepage = 'https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html'
8+
description = "Intel oneAPI Math Kernel Library"
9+
10+
toolchain = {'name': 'iimpi', 'version': '2021a'}
11+
12+
# see https://software.intel.com/content/www/us/en/develop/articles/oneapi-standalone-components.html
13+
source_urls = ['https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17757/']
14+
sources = ['l_onemkl_p_%(version)s.296_offline.sh']
15+
checksums = ['816e9df26ff331d6c0751b86ed5f7d243f9f172e76f14e83b32bf4d1d619dbae']
16+
17+
moduleclass = 'numlib'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# dummy easyconfig, only for use with easybuild-framwork test suite!
2+
easyblock = 'Toolchain'
3+
4+
name = 'impi'
5+
version = '2021.2.0'
6+
7+
homepage = 'https://software.intel.com/content/www/us/en/develop/tools/mpi-library.html'
8+
description = "Intel MPI Library, compatible with MPICH ABI"
9+
10+
toolchain = {'name': 'intel-compilers', 'version': '2021.2.0'}
11+
12+
# see https://software.intel.com/content/www/us/en/develop/articles/oneapi-standalone-components.html
13+
source_urls = ['https://registrationcenter-download.intel.com/akdlm/irc_nas/17729/']
14+
sources = ['l_mpi_oneapi_p_%(version)s.215_offline.sh']
15+
checksums = ['d0d4cdd11edaff2e7285e38f537defccff38e37a3067c02f4af43a3629ad4aa3']
16+
17+
# dummy easyconfig, only for use with easybuild-framwork test suite!
18+
dependencies = [
19+
# ('UCX', '1.10.0'),
20+
]
21+
22+
moduleclass = 'mpi'
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# dummy easyconfig, only for use with easybuild-framwork test suite!
2+
easyblock = 'Toolchain'
3+
4+
name = 'intel-compilers'
5+
version = '2021.2.0'
6+
7+
homepage = 'https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit.html'
8+
description = "Intel C, C++ & Fortran compilers (classic and oneAPI)"
9+
10+
toolchain = SYSTEM
11+
12+
# see https://software.intel.com/content/www/us/en/develop/articles/oneapi-standalone-components.html
13+
sources = [
14+
{
15+
'source_urls': ['https://registrationcenter-download.intel.com/akdlm/irc_nas/17749/'],
16+
'filename': 'l_dpcpp-cpp-compiler_p_%(version)s.118_offline.sh',
17+
},
18+
{
19+
'source_urls': ['https://registrationcenter-download.intel.com/akdlm/irc_nas/17756/'],
20+
'filename': 'l_fortran-compiler_p_%(version)s.136_offline.sh',
21+
},
22+
]
23+
checksums = [
24+
# l_dpcpp-cpp-compiler_p_2021.2.0.118_offline.sh
25+
'5d01cbff1a574c3775510cd97ffddd27fdf56d06a6b0c89a826fb23da4336d59',
26+
'a62e04a80f6d2f05e67cd5acb03fa58857ee22c6bd581ec0651c0ccd5bdec5a1', # l_fortran-compiler_p_2021.2.0.136_offline.sh
27+
]
28+
29+
# dummy easyconfig, only for use with easybuild-framwork test suite!
30+
local_gccver = '10.3.0'
31+
dependencies = [
32+
# ('GCCcore', local_gccver),
33+
# ('binutils', '2.36.1', '', ('GCCcore', local_gccver)),
34+
]
35+
36+
moduleclass = 'compiler'

test/framework/filetools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,7 @@ def test_index_functions(self):
21282128
# test with specified path with and without trailing '/'s
21292129
for path in [test_ecs, test_ecs + '/', test_ecs + '//']:
21302130
index = ft.create_index(path)
2131-
self.assertEqual(len(index), 85)
2131+
self.assertEqual(len(index), 89)
21322132

21332133
expected = [
21342134
os.path.join('b', 'bzip2', 'bzip2-1.0.6-GCC-4.9.2.eb'),

test/framework/module_generator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,14 @@ def test_ec(ecfile, short_modname, mod_subdir, modpath_exts, user_modpath_exts,
13011301
['Compiler/intel/2019.4.243'], ['Core']),
13021302
'imkl-2019.4.243-iimpi-2019.08.eb': ('imkl/2019.4.243',
13031303
'MPI/intel/2019.4.243/impi/2019.4.243', [], [], ['Core']),
1304+
'intel-compilers-2021.2.0.eb': ('intel-compilers/2021.2.0', 'Core',
1305+
['Compiler/intel/2021.2.0'], ['Compiler/intel/2021.2.0'], ['Core']),
1306+
'impi-2021.2.0-intel-compilers-2021.2.0.eb': ('impi/2021.2.0', 'Compiler/intel/2021.2.0',
1307+
['MPI/intel/2021.2.0/impi/2021.2.0'],
1308+
['MPI/intel/2021.2.0/impi/2021.2.0'],
1309+
['Core']),
1310+
'imkl-2021.2.0-iimpi-2021a.eb': ('imkl/2021.2.0', 'MPI/intel/2021.2.0/impi/2021.2.0',
1311+
[], [], ['Core']),
13041312
'CUDA-9.1.85-GCC-6.4.0-2.28.eb': ('CUDA/9.1.85', 'Compiler/GCC/6.4.0-2.28',
13051313
['Compiler/GCC-CUDA/6.4.0-2.28-9.1.85'],
13061314
['Compiler/GCC-CUDA/6.4.0-2.28-9.1.85'], ['Core']),

test/framework/options.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,7 @@ def test_search_archived(self):
10311031
txt = self.get_stdout().rstrip()
10321032
self.mock_stdout(False)
10331033
expected = '\n'.join([
1034+
' * intel-compilers-2021.2.0.eb',
10341035
' * intel-2018a.eb',
10351036
'',
10361037
"Note: 1 matching archived easyconfig(s) found, use --consider-archived-easyconfigs to see them",
@@ -1043,6 +1044,7 @@ def test_search_archived(self):
10431044
txt = self.get_stdout().rstrip()
10441045
self.mock_stdout(False)
10451046
expected = '\n'.join([
1047+
' * intel-compilers-2021.2.0.eb',
10461048
' * intel-2018a.eb',
10471049
'',
10481050
"Matching archived easyconfigs:",

0 commit comments

Comments
 (0)