diff options
author | Gregory Becker <becker33@llnl.gov> | 2015-11-12 13:27:10 -0800 |
---|---|---|
committer | Gregory Becker <becker33@llnl.gov> | 2015-11-12 13:27:10 -0800 |
commit | e78b8c16be5334aa4aea29313a77da8923319a8f (patch) | |
tree | 6a06a1c2c8881431aeb4ef2ba834ebb501f43fa3 /lib | |
parent | eb2c08315905e0484dbd4d866396563487d7d249 (diff) | |
download | spack-e78b8c16be5334aa4aea29313a77da8923319a8f.tar.gz spack-e78b8c16be5334aa4aea29313a77da8923319a8f.tar.bz2 spack-e78b8c16be5334aa4aea29313a77da8923319a8f.tar.xz spack-e78b8c16be5334aa4aea29313a77da8923319a8f.zip |
used key_comparator decorator from util.lang to compare targets. Fixes find bug
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/architecture.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py index 349a7b33db..f4b8585c2f 100644 --- a/lib/spack/spack/architecture.py +++ b/lib/spack/spack/architecture.py @@ -27,7 +27,7 @@ import imp import platform as py_platform import inspect -from llnl.util.lang import memoized, list_modules +from llnl.util.lang import memoized, list_modules, key_ordering from llnl.util.filesystem import join_path import llnl.util.tty as tty @@ -47,6 +47,7 @@ class NoSysTypeError(serr.SpackError): super(NoSysTypeError, self).__init__("Could not determine sys_type for this machine.") +@key_ordering class Target(object): """ Target is the processor of the host machine. The host machine may have different front-end and back-end targets, especially if it is a Cray machine. The target will have a name and @@ -79,7 +80,6 @@ class Target(object): @staticmethod def from_dict(d): - print "from_dict" target = Target.__new__(Target) target.name = d['name'] target.module_name = d['module_name'] @@ -87,6 +87,10 @@ class Target(object): # target.architecture = d['architecture'] return target + + def _cmp_key(self): + return (self.name, self.module_name) + def __repr__(self): return self.__str__() |