ASP: targets, compilers and providers soft-preferences are only global#31261
ASP: targets, compilers and providers soft-preferences are only global#31261alalazo merged 3 commits intospack:developfrom
Conversation
58882ea to
ec59165
Compare
This comment was marked as outdated.
This comment was marked as outdated.
ec59165 to
3e7c089
Compare
3e7c089 to
b60fd34
Compare
|
Tested this change on a few concretizations that don't involve package preferences, and there is no impact. I used the same configuration for both and |
b60fd34 to
9b94dac
Compare
|
I have a couple thoughts on this due to running into one of the things this involves. On the modifications
These changes are very sensible. The first one is kind of a surprise that it was this way at all. And the last one is the best approach when what is allowed in a config file changes.
I don't know about It is definitely true that forcing And with But, on On
I actually have a somewhat naive question on this. If the user specifically asks for a specific config, whether in their specs or in their |
Just to be sure there are no misconceptions: I am forcing target and compiler preferences to be global. The DAG can be mixed as it was before. For instance: $ spack spec hdf5 %clang target=icelake ^zlib %gcc target=x86_64is still perfectly valid. Users can mix and match as they want, either using spec literals or the requirements in the configuration file.
If the users asks for a specific configuration, i.e. they use spec literals or requirements, Spack either provides that or errors out. We have also a less strict "preferences" mechanism, and that's what I am touching here. |
I don't know how I missed or misunderstood that feature. So, something like |
3a98fbd to
7e90bc8
Compare
7e90bc8 to
8ddeaee
Compare
8ddeaee to
0c8b138
Compare
|
Benchmarked on:
radiuss-pr.csv There is no impact in performance. |
alecbcs
left a comment
There was a problem hiding this comment.
This PR looks good to me. I agree with the previous discussion, I'm a fan of how this PR brings the functionality of the concretizer more into line with my general assumptions and gets rid of surprising behavior.
Modify the packages.yaml schema so that soft-preferences on targets, compilers and providers can only be specified under the "all" attribute. This makes them effectively global preferences. Version preferences instead can only be specified under a package specific section. If a preference attribute is found in a section where it should not be, it will be ignored and a warning is printed to screen.
fc49a02 to
5ca20d2
Compare
|
This PR has no impact on the solver performance. Tested on:
|
|
I'd get rid of the |
…ly global (spack#31261)" This reverts commit f3537bc.
spack#31261) Modify the packages.yaml schema so that soft-preferences on targets, compilers and providers can only be specified under the "all" attribute. This makes them effectively global preferences. Version preferences instead can only be specified under a package specific section. If a preference attribute is found in a section where it should not be, it will be ignored and a warning is printed to screen.
spack#31261) Modify the packages.yaml schema so that soft-preferences on targets, compilers and providers can only be specified under the "all" attribute. This makes them effectively global preferences. Version preferences instead can only be specified under a package specific section. If a preference attribute is found in a section where it should not be, it will be ignored and a warning is printed to screen.




fixes #31199
fixes #27055
A number of our soft preferences are broken and hard to make sense of when specified at the package level. Similarly,
versionwhen specified at theall:level is unintuitive -- there are very few situations where we'd want to universally prefer "1.0".This PR disallows unintuitive per-package soft preferences in
packages.yaml, and forcescompilers:,targets:, andproviders:to only appear at theall:level. Similarly, it disallowsversion:at theall:level and only allows it in per-package sections ofpackages.yaml.The new
require:style preferences are much more intuitive for setting one-off preferences in the DAG, and you can use them to force a node to use certain compilers, targets, or providers. Userequire:instead of the preferences syntax if you need to be this specific.Modifications:
target,compilerandproviderssoft-preferences can only be set underall:inpackages.yamlversioncan only be set under each specific package (and not underall:)packages.yaml