From 58f2b39bc844d1c8beffd6449a9047c5ec5522e5 Mon Sep 17 00:00:00 2001 From: Mario Melara Date: Tue, 1 Dec 2015 11:57:17 -0800 Subject: [PATCH] Changed default to CPU_TARGET env var. Helps deal with target differences between cori and edison --- lib/spack/spack/architectures/cray.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/spack/spack/architectures/cray.py b/lib/spack/spack/architectures/cray.py index 640a3933e0..e4a3617dc9 100644 --- a/lib/spack/spack/architectures/cray.py +++ b/lib/spack/spack/architectures/cray.py @@ -6,15 +6,23 @@ class Cray(Architecture): priority = 20 front_end = 'sandybridge' back_end = 'ivybridge' - default = 'ivybridge' - + default = os.environ['CRAY_CPU_TARGET'] + #default = 'ivybridge' + def __init__(self): + ''' Since cori doesn't have ivybridge as a front end it's better + if we use CRAY_CPU_TARGET as the default. This will ensure + that if we're on a XC-40 or XC-30 then we can detect the target + ''' super(Cray, self).__init__('cray') + # Back End compiler needs the proper target module loaded. - self.add_target('ivybridge', Target('ivybridge','craype-ivybridge')) + self.add_target(self.front_end, Target(self.front_end,'craype-' + self.front_end)) + self.add_target(self.default, Target(self.default,'craype-' + self.default)) # Could switch to use modules and fe targets for front end # Currently using compilers by path for front end. - self.add_target('sandybridge', Target('sandybridge')) + self.add_target(self.back_end, Target('craype-' + self.back_end)) + @classmethod def detect(self):