diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-12-21 22:16:37 +0100 |
---|---|---|
committer | Tamara Dahlgren <dahlgren1@llnl.gov> | 2021-02-17 17:07:31 -0800 |
commit | 4bbc6eec516fb7fa5ac49e55ff5fa26141f21148 (patch) | |
tree | 83b65bf9dd5418c5d811743adb9cabee7b52062e /lib | |
parent | cb76c5a90da62408356c818686bc3b325a8d7b99 (diff) | |
download | spack-4bbc6eec516fb7fa5ac49e55ff5fa26141f21148.tar.gz spack-4bbc6eec516fb7fa5ac49e55ff5fa26141f21148.tar.bz2 spack-4bbc6eec516fb7fa5ac49e55ff5fa26141f21148.tar.xz spack-4bbc6eec516fb7fa5ac49e55ff5fa26141f21148.zip |
concretizer: optimized loop on node platforms
We can speed-up the computation by avoiding a
double loop in a cardinality constraint and
enforcing the rule instead as an integrity
constraint.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/solver/concretize.lp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp index 6bbd5c03e7..cda05347ea 100644 --- a/lib/spack/spack/solver/concretize.lp +++ b/lib/spack/spack/solver/concretize.lp @@ -362,7 +362,7 @@ variant_default_value(Package, Variant, Value) % when assigned a value. auto_variant("dev_path"). auto_variant("patches"). -variant(Package, "dev_path") +variant(Package, Variant) :- variant_set(Package, Variant, _), auto_variant(Variant). variant_single_value(Package, "dev_path") :- variant_set(Package, "dev_path", _). @@ -381,9 +381,9 @@ variant_single_value(Package, "dev_path") %----------------------------------------------------------------------------- % Platform semantics %----------------------------------------------------------------------------- + % one platform per node -1 { node_platform(Package, Platform) : node_platform(Packagee, Platform) } 1 - :- node(Package). +:- M = #count { Platform : node_platform(Package, Platform) }, M !=1, node(Package). % if no platform is set, fall back to the default node_platform(Package, Platform) |