diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2021-08-10 23:15:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-10 14:15:45 -0700 |
commit | 371bc37dd4536009787fa4370b5fd7539e6e0478 (patch) | |
tree | f157ac69177ce5b69226d48305448caa0abd75b2 /bin | |
parent | 3fafbafab09967d55301b2f8c1879c5ee3b86d2f (diff) | |
download | spack-371bc37dd4536009787fa4370b5fd7539e6e0478.tar.gz spack-371bc37dd4536009787fa4370b5fd7539e6e0478.tar.bz2 spack-371bc37dd4536009787fa4370b5fd7539e6e0478.tar.xz spack-371bc37dd4536009787fa4370b5fd7539e6e0478.zip |
Rework rules for provider weights (#25331)
Preferred providers had a non-zero weight because in an earlier formulation of the logic program that was needed to prefer external providers over default providers. With the current formulation for externals this is not needed anymore, so we can give a weight of zero to both default choices and providers that are externals. _Using zero ensures that we don't introduce any drift towards having less providers, which was happening when minimizing positive weights_.
Modifications:
- [x] Default weight for providers starts at 0 (instead of 10, needed before to prefer externals)
- [x] Rules to compute the `provider_weight` have been refactored. There are multiple possible weights for a given `Virtual`. Only one gets selected by the solver (the one that minimizes the objective function).
- [x] `provider_weight` are now accounting for each different `Virtual`. Before there was a single weight per provider, even if the package was providing multiple virtuals.
* Give preferred providers a weight of zero
Preferred providers had a non-zero weight because in an earlier
formulation of the logic program that was needed to prefer
external providers over default providers.
With the current formulation for externals this is not needed anymore,
so we can give a weight of zero to default choices. Using zero
ensures that we don't introduce any drift towards having
less providers, which was happening when minimizing positive weights.
* Simplify how we compute weights for providers
Rewrite rules so that specific events (i.e. being
an external) unlock the possibility to use certain
weights. The weight being considered is then selected
by the minimization process to be the one that gives
the best score.
* Allow providers to have different weights for different virtuals
Before this change we didn't differentiate providers based on
the virtual they provide, which meant that packages providing
more than one virtual had nonetheless a single weight.
With this change there will be a weight per virtual.
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions