summaryrefslogtreecommitdiff
path: root/lib/spack/docs
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-11-07 15:38:24 +0100
committerGitHub <noreply@github.com>2022-11-07 15:38:24 +0100
commit2ab974f5301746f20ff19cb991951158a9c498fd (patch)
treef233b1d4bb6e8a00de24d772c7f1e89826aa8396 /lib/spack/docs
parente045dabb3afbc6b2af78fe7deeb92d0fe995c814 (diff)
downloadspack-2ab974f5301746f20ff19cb991951158a9c498fd.tar.gz
spack-2ab974f5301746f20ff19cb991951158a9c498fd.tar.bz2
spack-2ab974f5301746f20ff19cb991951158a9c498fd.tar.xz
spack-2ab974f5301746f20ff19cb991951158a9c498fd.zip
concretizer:unify:true as a default (#31787)
`spack env create` enables a view by default (in a weird hidden directory, but well...). This is asking for trouble with the other default of `concretizer:unify:false`, since having different flavors of the same spec in an environment, leads to collision errors when generating the view. A change of defaults would improve user experience: However, `unify:true` makes most sense, since any time the issue is brought up in Slack, the user changes the concretization config, since it wasn't the intention to have different flavors of the same spec, and install times are decreased. Further we improve the docs and drop the duplicate root spec limitation
Diffstat (limited to 'lib/spack/docs')
-rw-r--r--lib/spack/docs/environments.rst55
1 files changed, 31 insertions, 24 deletions
diff --git a/lib/spack/docs/environments.rst b/lib/spack/docs/environments.rst
index b417e26f3e..9f75f789ae 100644
--- a/lib/spack/docs/environments.rst
+++ b/lib/spack/docs/environments.rst
@@ -519,27 +519,33 @@ available from the yaml file.
^^^^^^^^^^^^^^^^^^^
Spec concretization
^^^^^^^^^^^^^^^^^^^
-An environment can be concretized in three different modes and the behavior active under any environment
-is determined by the ``concretizer:unify`` property. By default specs are concretized *separately*, one after the other:
+An environment can be concretized in three different modes and the behavior active under
+any environment is determined by the ``concretizer:unify`` configuration option.
+
+The *default* mode is to unify all specs:
.. code-block:: yaml
spack:
specs:
- - hdf5~mpi
- hdf5+mpi
- zlib@1.2.8
concretizer:
- unify: false
+ unify: true
+
+This means that any package in the environment corresponds to a single concrete spec. In
+the above example, when ``hdf5`` depends down the line of ``zlib``, it is required to
+take ``zlib@1.2.8`` instead of a newer version. This mode of concretization is
+particularly useful when environment views are used: if every package occurs in
+only one flavor, it is usually possible to merge all install directories into a view.
-This mode of operation permits to deploy a full software stack where multiple configurations of the same package
-need to be installed alongside each other using the best possible selection of transitive dependencies. The downside
-is that redundancy of installations is disregarded completely, and thus environments might be more bloated than
-strictly needed. In the example above, for instance, if a version of ``zlib`` newer than ``1.2.8`` is known to Spack,
-then it will be used for both ``hdf5`` installations.
+A downside of unified concretization is that it can be overly strict. For example, a
+concretization error would happen when both ``hdf5+mpi`` and ``hdf5~mpi`` are specified
+in an environment.
-If redundancy of the environment is a concern, Spack provides a way to install it *together where possible*,
-i.e. trying to maximize reuse of dependencies across different specs:
+The second mode is to *unify when possible*: this makes concretization of root specs
+more independendent. Instead of requiring reuse of dependencies across different root
+specs, it is only maximized:
.. code-block:: yaml
@@ -551,26 +557,27 @@ i.e. trying to maximize reuse of dependencies across different specs:
concretizer:
unify: when_possible
-Also in this case Spack allows having multiple configurations of the same package, but privileges the reuse of
-specs over other factors. Going back to our example, this means that both ``hdf5`` installations will use
-``zlib@1.2.8`` as a dependency even if newer versions of that library are available.
-Central installations done at HPC centers by system administrators or user support groups are a common case
-that fits either of these two modes.
+This means that both ``hdf5`` installations will use ``zlib@1.2.8`` as a dependency even
+if newer versions of that library are available.
-Environments can also be configured to concretize all the root specs *together*, in a self-consistent way, to
-ensure that each package in the environment comes with a single configuration:
+The third mode of operation is to concretize root specs entirely independently by
+disabling unified concretization:
.. code-block:: yaml
spack:
specs:
+ - hdf5~mpi
- hdf5+mpi
- zlib@1.2.8
concretizer:
- unify: true
+ unify: false
+
+In this example ``hdf5`` is concretized separately, and does not consider ``zlib@1.2.8``
+as a constraint or preference. Instead, it will take the latest possible version.
-This mode of operation is usually what is required by software developers that want to deploy their development
-environment and have a single view of it in the filesystem.
+The last two concretization options are typically useful for system administrators and
+user support groups providing a large software stack for their HPC center.
.. note::
@@ -581,10 +588,10 @@ environment and have a single view of it in the filesystem.
.. admonition:: Re-concretization of user specs
- When concretizing specs *together* or *together where possible* the entire set of specs will be
+ When using *unified* concretization (when possible), the entire set of specs will be
re-concretized after any addition of new user specs, to ensure that
- the environment remains consistent / minimal. When instead the specs are concretized
- separately only the new specs will be re-concretized after any addition.
+ the environment remains consistent / minimal. When instead unified concretization is
+ disabled, only the new specs will be concretized after any addition.
^^^^^^^^^^^^^
Spec Matrices