cray architecture detection for zen3/milan (#26827)
* Update cray architecture detection for milan Update the cray architecture module table with x86-milan -> zen3 Make cray architecture more robust to back off from frontend architecture to a recent ancestor if necessary. This should make future cray updates less paingful for users. Co-authored-by: Gregory Becker <becker33.llnl.gov> Co-authored-by: Todd Gamblin <gamblin2@llnl.gov>
This commit is contained in:
parent
501fa6767b
commit
7dc0ca4ee6
@ -24,6 +24,7 @@
|
||||
'x86-cascadelake': 'cascadelake',
|
||||
'x86-naples': 'zen',
|
||||
'x86-rome': 'zen2',
|
||||
'x86-milan': 'zen3',
|
||||
'x86-skylake': 'skylake_avx512',
|
||||
'mic-knl': 'mic_knl',
|
||||
'interlagos': 'bulldozer',
|
||||
@ -143,19 +144,25 @@ def _default_target_from_env(self):
|
||||
env={'TERM': os.environ.get('TERM', '')},
|
||||
output=str, error=os.devnull
|
||||
)
|
||||
|
||||
default_from_module = ''.join(output.split()) # rm all whitespace
|
||||
if default_from_module:
|
||||
tty.debug("Found default module:%s" % default_from_module)
|
||||
return default_from_module
|
||||
else:
|
||||
front_end = archspec.cpu.host().name
|
||||
if front_end in list(
|
||||
map(lambda x: _target_name_from_craype_target_name(x),
|
||||
self._avail_targets())
|
||||
):
|
||||
tty.debug("default to front-end architecture")
|
||||
return archspec.cpu.host().name
|
||||
front_end = archspec.cpu.host()
|
||||
# Look for the frontend architecture or closest ancestor
|
||||
# available in cray target modules
|
||||
avail = [
|
||||
_target_name_from_craype_target_name(x)
|
||||
for x in self._avail_targets()
|
||||
]
|
||||
for front_end_possibility in [front_end] + front_end.ancestors:
|
||||
if front_end_possibility.name in avail:
|
||||
tty.debug("using front-end architecture or available ancestor")
|
||||
return front_end_possibility.name
|
||||
else:
|
||||
tty.debug("using platform.machine as default")
|
||||
return platform.machine()
|
||||
|
||||
def _avail_targets(self):
|
||||
|
Loading…
Reference in New Issue
Block a user