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:
Greg Becker 2021-10-19 16:39:50 -05:00 committed by GitHub
parent 501fa6767b
commit 7dc0ca4ee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@
'x86-cascadelake': 'cascadelake', 'x86-cascadelake': 'cascadelake',
'x86-naples': 'zen', 'x86-naples': 'zen',
'x86-rome': 'zen2', 'x86-rome': 'zen2',
'x86-milan': 'zen3',
'x86-skylake': 'skylake_avx512', 'x86-skylake': 'skylake_avx512',
'mic-knl': 'mic_knl', 'mic-knl': 'mic_knl',
'interlagos': 'bulldozer', 'interlagos': 'bulldozer',
@ -143,19 +144,25 @@ def _default_target_from_env(self):
env={'TERM': os.environ.get('TERM', '')}, env={'TERM': os.environ.get('TERM', '')},
output=str, error=os.devnull output=str, error=os.devnull
) )
default_from_module = ''.join(output.split()) # rm all whitespace default_from_module = ''.join(output.split()) # rm all whitespace
if default_from_module: if default_from_module:
tty.debug("Found default module:%s" % default_from_module) tty.debug("Found default module:%s" % default_from_module)
return default_from_module return default_from_module
else: else:
front_end = archspec.cpu.host().name front_end = archspec.cpu.host()
if front_end in list( # Look for the frontend architecture or closest ancestor
map(lambda x: _target_name_from_craype_target_name(x), # available in cray target modules
self._avail_targets()) avail = [
): _target_name_from_craype_target_name(x)
tty.debug("default to front-end architecture") for x in self._avail_targets()
return archspec.cpu.host().name ]
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: else:
tty.debug("using platform.machine as default")
return platform.machine() return platform.machine()
def _avail_targets(self): def _avail_targets(self):