Changed default to CPU_TARGET env var. Helps deal with target differences between cori and edison

This commit is contained in:
Mario Melara 2015-12-01 11:57:17 -08:00
parent 89fbe4fdfa
commit 58f2b39bc8

View file

@ -6,15 +6,23 @@ class Cray(Architecture):
priority = 20 priority = 20
front_end = 'sandybridge' front_end = 'sandybridge'
back_end = 'ivybridge' back_end = 'ivybridge'
default = 'ivybridge' default = os.environ['CRAY_CPU_TARGET']
#default = 'ivybridge'
def __init__(self): 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') super(Cray, self).__init__('cray')
# Back End compiler needs the proper target module loaded. # 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 # Could switch to use modules and fe targets for front end
# Currently using compilers by path 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 @classmethod
def detect(self): def detect(self):