lmod: module files are written in a root folder named by target family (#13121)
fixes #13005 This commit fixes an issue with the name of the root directory for module file hierarchies. Since #3206 the root folder was named after the microarchitecture used for the spec, which is too specific and not backward compatible for lmod hierarchies. Here we compute the root folder name using the target family instead of the target name itself and we add target information in the 'whatis' portion of the module file.
This commit is contained in:
parent
41e7e5693e
commit
d33b0ffc50
@ -198,7 +198,11 @@ class LmodFileLayout(BaseFileLayout):
|
|||||||
@property
|
@property
|
||||||
def arch_dirname(self):
|
def arch_dirname(self):
|
||||||
"""Returns the root folder for THIS architecture"""
|
"""Returns the root folder for THIS architecture"""
|
||||||
arch_folder = str(self.spec.architecture)
|
arch_folder = '-'.join([
|
||||||
|
str(self.spec.platform),
|
||||||
|
str(self.spec.os),
|
||||||
|
str(self.spec.target.family)
|
||||||
|
])
|
||||||
return os.path.join(
|
return os.path.join(
|
||||||
self.dirname(), # root for lmod module files
|
self.dirname(), # root for lmod module files
|
||||||
arch_folder, # architecture relative path
|
arch_folder, # architecture relative path
|
||||||
|
@ -262,3 +262,19 @@ def no_op_set(*args, **kwargs):
|
|||||||
# Assert we have core compilers now
|
# Assert we have core compilers now
|
||||||
writer, _ = factory(mpileaks_spec_string)
|
writer, _ = factory(mpileaks_spec_string)
|
||||||
assert writer.conf.core_compilers
|
assert writer.conf.core_compilers
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('spec_str', [
|
||||||
|
'mpileaks target=haswell',
|
||||||
|
'mpileaks target=core2',
|
||||||
|
'mpileaks target=x86_64',
|
||||||
|
])
|
||||||
|
@pytest.mark.regression('13005')
|
||||||
|
def test_only_generic_microarchitectures_in_root(
|
||||||
|
self, spec_str, factory, module_configuration
|
||||||
|
):
|
||||||
|
module_configuration('complex_hierarchy')
|
||||||
|
writer, spec = factory(spec_str)
|
||||||
|
|
||||||
|
assert str(spec.target.family) in writer.layout.arch_dirname
|
||||||
|
if spec.target.family != spec.target:
|
||||||
|
assert str(spec.target) not in writer.layout.arch_dirname
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
{% if short_description %}
|
{% if short_description %}
|
||||||
whatis([[Name : {{ spec.name }}]])
|
whatis([[Name : {{ spec.name }}]])
|
||||||
whatis([[Version : {{ spec.version }}]])
|
whatis([[Version : {{ spec.version }}]])
|
||||||
|
whatis([[Target : {{ spec.target }}]])
|
||||||
whatis([[Short description : {{ short_description }}]])
|
whatis([[Short description : {{ short_description }}]])
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if configure_options %}
|
{% if configure_options %}
|
||||||
|
Loading…
Reference in New Issue
Block a user