diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-10-31 00:18:05 +0100 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2020-11-17 10:04:13 -0800 |
commit | 27bb970a97858a6ac812c34ba2feeafbddb7e4c0 (patch) | |
tree | 602b9b8a1a04bb7b2ce30fe1a742bf71f2773d76 /lib | |
parent | 930b05fab41e39ed5554dea853ccfac246f0c229 (diff) | |
download | spack-27bb970a97858a6ac812c34ba2feeafbddb7e4c0.tar.gz spack-27bb970a97858a6ac812c34ba2feeafbddb7e4c0.tar.bz2 spack-27bb970a97858a6ac812c34ba2feeafbddb7e4c0.tar.xz spack-27bb970a97858a6ac812c34ba2feeafbddb7e4c0.zip |
Fixed branch after rebase (port to archspec)
TODO: Investigate the need to remove
memoization on Spec.patches (infinite
recursion when testing `__contains__`)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/solver/asp.py | 11 | ||||
-rw-r--r-- | lib/spack/spack/test/conftest.py | 16 |
2 files changed, 14 insertions, 13 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index eb54026bf8..c14906f5a2 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -17,12 +17,13 @@ import time import types from six import string_types +import archspec.cpu + try: import clingo except ImportError: clingo = None -import llnl.util.cpu import llnl.util.lang import llnl.util.tty as tty import llnl.util.tty.color as color @@ -1068,7 +1069,7 @@ class SpackSolverSetup(object): key_fn = spack.package_prefs.PackagePrefs(pkg_name, 'target') target_specs = [ spack.spec.Spec('target={0}'.format(target_name)) - for target_name in llnl.util.cpu.targets + for target_name in archspec.cpu.TARGETS ] preferred_targets = [x for x in target_specs if key_fn(x) < 0] if not preferred_targets: @@ -1218,7 +1219,7 @@ class SpackSolverSetup(object): try: target.optimization_flags(compiler.name, compiler.version) supported.append(target) - except llnl.util.cpu.UnsupportedMicroarchitecture: + except archspec.cpu.UnsupportedMicroarchitecture: continue except ValueError: continue @@ -1253,7 +1254,7 @@ class SpackSolverSetup(object): self.gen.h2('Default target') platform = spack.architecture.platform() - uarch = llnl.util.cpu.targets.get(platform.default) + uarch = archspec.cpu.TARGETS.get(platform.default) self.gen.h2('Target compatibility') @@ -1284,7 +1285,7 @@ class SpackSolverSetup(object): continue print("TTYPE:", type(platform.target(spec.target.name))) - target = llnl.util.cpu.targets.get(spec.target.name) + target = archspec.cpu.TARGETS.get(spec.target.name) if not target: raise ValueError("Invalid target: ", spec.target.name) if target not in compatible_targets: diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py index 30497fefd7..527d6a3380 100644 --- a/lib/spack/spack/test/conftest.py +++ b/lib/spack/spack/test/conftest.py @@ -18,8 +18,8 @@ import xml.etree.ElementTree import py import pytest -import llnl.util.cpu.microarchitecture -import llnl.util.cpu.schema +import archspec.cpu.microarchitecture +import archspec.cpu.schema from llnl.util.filesystem import mkdirp, remove_linked_tree import spack.architecture @@ -464,14 +464,14 @@ def mock_uarch_json(tmpdir_factory): @pytest.fixture(scope='session') def mock_uarch_configuration(mock_uarch_json): - """Create mock dictionaries for the llnl.util.cpu.""" + """Create mock dictionaries for the archspec.cpu.""" def load_json(): with open(mock_uarch_json) as f: return json.load(f) - targets_json = llnl.util.cpu.schema.LazyDictionary(load_json) - targets = llnl.util.cpu.microarchitecture.LazyDictionary( - llnl.util.cpu.microarchitecture._known_microarchitectures) + targets_json = archspec.cpu.schema.LazyDictionary(load_json) + targets = archspec.cpu.microarchitecture.LazyDictionary( + archspec.cpu.microarchitecture._known_microarchitectures) yield targets_json, targets @@ -481,8 +481,8 @@ def mock_targets(mock_uarch_configuration, monkeypatch): """Use this fixture to enable mock uarch targets for testing.""" targets_json, targets = mock_uarch_configuration - monkeypatch.setattr(llnl.util.cpu.schema, "targets_json", targets_json) - monkeypatch.setattr(llnl.util.cpu.microarchitecture, "targets", targets) + monkeypatch.setattr(archspec.cpu.schema, "TARGETS_JSON", targets_json) + monkeypatch.setattr(archspec.cpu.microarchitecture, "TARGETS", targets) @pytest.fixture(scope='session') |