summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2021-10-19 16:39:50 -0500
committerGitHub <noreply@github.com>2021-10-19 21:39:50 +0000
commit7dc0ca4ee68ef028b9f6226d13a49e495bee63c6 (patch)
treeb8bdcdf3c4df1a0e7a6e8bb1ba146efe34e5639c /lib
parent501fa6767b8d3b453a4fced361971c61ce6d33cd (diff)
downloadspack-7dc0ca4ee68ef028b9f6226d13a49e495bee63c6.tar.gz
spack-7dc0ca4ee68ef028b9f6226d13a49e495bee63c6.tar.bz2
spack-7dc0ca4ee68ef028b9f6226d13a49e495bee63c6.tar.xz
spack-7dc0ca4ee68ef028b9f6226d13a49e495bee63c6.zip
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/platforms/cray.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/spack/spack/platforms/cray.py b/lib/spack/spack/platforms/cray.py
index cc66d8aadc..d9df8137a3 100644
--- a/lib/spack/spack/platforms/cray.py
+++ b/lib/spack/spack/platforms/cray.py
@@ -24,6 +24,7 @@ _craype_name_to_target_name = {
'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 @@ class Cray(Platform):
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):