summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTodd Gamblin <gamblin2@llnl.gov>2021-04-02 01:54:49 -0700
committerGitHub <noreply@github.com>2021-04-02 08:54:49 +0000
commit0d387678b79db8fa27ed851766890844008a8c13 (patch)
treeb3cb938dcf12ec33c57315aea4fa09aeec5aa265 /var
parent45c616529c36421db7650068ca625f4642769d67 (diff)
downloadspack-0d387678b79db8fa27ed851766890844008a8c13.tar.gz
spack-0d387678b79db8fa27ed851766890844008a8c13.tar.bz2
spack-0d387678b79db8fa27ed851766890844008a8c13.tar.xz
spack-0d387678b79db8fa27ed851766890844008a8c13.zip
concretizer: improve display of optimization criteria (#22433)
By default, clingo doesn't show any optimization criteria (maximized or minimized sums) if the set they aggregate is empty. Per the clingo mailing list, we can get around that by adding, e.g.: ``` #minimize{ 0@2 : #true }. ``` for the 2nd criterion. This forces clingo to print out the criterion but does not affect the optimization. This PR adds directives as above for all of our optimization criteria, as well as facts with descriptions of each criterion,like this: ``` opt_criterion(2, "number of non-default variants") ``` We use facts in `concretize.lp` rather than hard-coding these in `asp.py` so that the names can be maintained in the same place as the other optimization criteria. The now-displayed weights and the names are used to display optimization output like this: ```console (spackle):solver> spack solve --show opt zlib ==> Best of 0 answers. ==> Optimization Criteria: Priority Criterion Value 1 version weight 0 2 number of non-default variants (roots) 0 3 multi-valued variants + preferred providers for roots 0 4 number of non-default variants (non-roots) 0 5 number of non-default providers (non-roots) 0 6 count of non-root multi-valued variants 0 7 compiler matches + number of nodes 1 8 version badness 0 9 non-preferred compilers 0 10 target matches 0 11 non-preferred targets 0 zlib@1.2.11%apple-clang@12.0.0+optimize+pic+shared arch=darwin-catalina-skylake ``` Note that this is all hidden behind a `--show opt` option to `spack solve`. Optimization weights are no longer shown by default, but you can at least inspect them and more easily understand what is going on. - [x] always show optimization criteria in `clingo` output - [x] add `opt_criterion()` facts for all optimizationc criteria - [x] make display of opt criteria optional in `spack solve` - [x] rework how optimization criteria are displayed, and add a `--show opt` optiong to `spack solve`
Diffstat (limited to 'var')
0 files changed, 0 insertions, 0 deletions