Skip to content

Commit ced2fb0

Browse files
committed
make HierarhicalMNS compatible with Cray toolchains (proper fix for #3265)
1 parent 1a0cbcf commit ced2fb0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

easybuild/tools/module_naming_scheme/hierarchical_mns.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@
4141
CORE = 'Core'
4242
COMPILER = 'Compiler'
4343
MPI = 'MPI'
44+
TOOLCHAIN = 'Toolchain'
4445

4546
MODULECLASS_COMPILER = 'compiler'
4647
MODULECLASS_MPI = 'mpi'
48+
MODULECLASS_TOOLCHAIN = 'toolchain'
4749

4850
GCCCORE = GCCcore.NAME
4951

@@ -107,7 +109,11 @@ def det_toolchain_compilers_name_version(self, tc_comps):
107109
# no compiler in toolchain, system toolchain
108110
res = None
109111
elif len(tc_comps) == 1:
110-
res = (tc_comps[0]['name'], self.det_full_version(tc_comps[0]))
112+
tc_comp = tc_comps[0]
113+
if tc_comp is None:
114+
res = None
115+
else:
116+
res = (tc_comp['name'], self.det_full_version(tc_comp))
111117
else:
112118
comp_versions = dict([(comp['name'], self.det_full_version(comp)) for comp in tc_comps])
113119
comp_names = comp_versions.keys()
@@ -135,6 +141,10 @@ def det_module_subdir(self, ec):
135141
if tc_comps is None:
136142
# no compiler in toolchain, system toolchain => Core module
137143
subdir = CORE
144+
elif tc_comps == [None]:
145+
# no info on toolchain compiler (cfr. Cray toolchains),
146+
# then use toolchain name/version
147+
subdir = os.path.join(TOOLCHAIN, ec.toolchain.name, ec.toolchain.version)
138148
else:
139149
tc_comp_name, tc_comp_ver = self.det_toolchain_compilers_name_version(tc_comps)
140150
tc_mpi = det_toolchain_mpi(ec)
@@ -223,6 +233,10 @@ def det_modpath_extensions(self, ec):
223233
fullver = self.det_full_version(ec)
224234
paths.append(os.path.join(MPI, tc_comp_name, tc_comp_ver, ec['name'], fullver))
225235

236+
# special case for Cray toolchains
237+
elif modclass == MODULECLASS_TOOLCHAIN and tc_comp_info is None:
238+
paths.append(os.path.join(TOOLCHAIN, ec.toolchain.name, ec.toolchain.version))
239+
226240
return paths
227241

228242
def expand_toolchain_load(self, ec=None):

0 commit comments

Comments
 (0)