From 5ac974c9b2072631eab490cce8f2922420eef9e4 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Wed, 4 Nov 2015 12:50:22 -0800 Subject: [PATCH 1/2] Enforced that the architecture subclass cannot add a target that shares a name with a target alias --- lib/spack/spack/architecture.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py index 442180242b..890df9b1e5 100644 --- a/lib/spack/spack/architecture.py +++ b/lib/spack/spack/architecture.py @@ -77,9 +77,14 @@ def __init__(self, name): self.name = name def add_target(self, name, target): - self.targets[name] = target - - + """Used by the architecture specific subclass to list available targets. Raises an error + if the architecture specifies a name that is reserved by spack as an alias. + """ + if name in ['front_end', 'fe', 'back_end', 'be', 'default']: + raise ValueError("%s is a spack reserved alias and cannot be the name of a target" % name) + self.targets[name] = target + + def target(self, name): """This is a getter method for the target dictionary that handles defaulting based on the values provided by default, front-end, and back-end. This can be overwritten From 35532d6b0aaa428e1d8234513e9e887d08c3914c Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Wed, 4 Nov 2015 13:00:35 -0800 Subject: [PATCH 2/2] Changed cray architecture subclass to add proper targets for front at back end nodes --- lib/spack/spack/architectures/cray.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/spack/spack/architectures/cray.py b/lib/spack/spack/architectures/cray.py index a79c916684..420b7c589e 100644 --- a/lib/spack/spack/architectures/cray.py +++ b/lib/spack/spack/architectures/cray.py @@ -10,6 +10,11 @@ class Cray(Architecture): def __init__(self): super(Cray, self).__init__('cray') + # Back End compiler needs the proper target module loaded. + self.add_target('ivybridge','craype-ivybridge') + # Could switch to use modules and fe targets for front end + # Currently using compilers by path for front end. + self.add_target('sandybridge') @classmethod def detect(self):