diff options
author | Gregory Becker <becker33@llnl.gov> | 2016-01-05 19:03:25 -0800 |
---|---|---|
committer | Gregory Becker <becker33@llnl.gov> | 2016-01-05 19:03:25 -0800 |
commit | 61b03b72b0fb1aa5c4ddbaff8079d9c0258efb76 (patch) | |
tree | fc7cafb24958453d8ced9b3d332c039adc6ce811 /lib | |
parent | 93c9c45580d89ccbab441c5808192e149731c85f (diff) | |
download | spack-61b03b72b0fb1aa5c4ddbaff8079d9c0258efb76.tar.gz spack-61b03b72b0fb1aa5c4ddbaff8079d9c0258efb76.tar.bz2 spack-61b03b72b0fb1aa5c4ddbaff8079d9c0258efb76.tar.xz spack-61b03b72b0fb1aa5c4ddbaff8079d9c0258efb76.zip |
improved concretize efficiency for determining whether compilers come from the proper strategy
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/concretize.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index 2013ae2e84..854db949e3 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -265,11 +265,9 @@ class DefaultConcretizer(object): #Although this usually means changed, this means awaiting other changes return True - # Examine only those compilers found by the proper compiler strategy for this architecture + # Only use a matching compiler if it is of the proper style # Takes advantage of the proper logic already existing in compiler_for_spec - # Should be redone more efficiently if this works - all_compilers = spack.compilers.all_compilers() - + # Should think whether this can be more efficient def _proper_compiler_style(cspec, target): compilers = spack.compilers.compilers_for_spec(cspec) if target.compiler_strategy == 'PATH': @@ -278,8 +276,8 @@ class DefaultConcretizer(object): filter(lambda c: c.modules, compilers) return compilers - filter(lambda c: _proper_compiler_style(c, spec.architecture), all_compilers) - + + all_compilers = spack.compilers.all_compilers() if (spec.compiler and spec.compiler.concrete and @@ -306,7 +304,12 @@ class DefaultConcretizer(object): raise UnavailableCompilerVersionError(other_compiler) # copy concrete version into other_compiler - spec.compiler = matches[-1].copy() + index = len(matches)-1 + while not _proper_compiler_style(matches[index], spec.architecture): + index -= 1 + if index == 0: + raise NoValidVersionError(spec) + spec.compiler = matches[index].copy() assert(spec.compiler.concrete) return True # things changed. |