summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2023-05-11 22:29:17 +0200
committerGitHub <noreply@github.com>2023-05-11 13:29:17 -0700
commit5c7dda7e14ef05741d8dd1c4335883638836ee6b (patch)
tree788e0b8d2e4d9f89fdb91c0a228bbfab65defbf5
parent0e87243284d7c8992ae0cbb9e46348557119a117 (diff)
downloadspack-5c7dda7e14ef05741d8dd1c4335883638836ee6b.tar.gz
spack-5c7dda7e14ef05741d8dd1c4335883638836ee6b.tar.bz2
spack-5c7dda7e14ef05741d8dd1c4335883638836ee6b.tar.xz
spack-5c7dda7e14ef05741d8dd1c4335883638836ee6b.zip
Allow using -j to control the parallelism of concretization (#37608)
fixes #29464 This PR allows to use ``` $ spack concretize -j X ``` to set a cap on the parallelism of concretization from the command line
-rw-r--r--lib/spack/spack/cmd/concretize.py1
-rw-r--r--lib/spack/spack/environment/environment.py5
-rwxr-xr-xshare/spack/spack-completion.bash2
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/spack/spack/cmd/concretize.py b/lib/spack/spack/cmd/concretize.py
index 14ff1ac1e2..1b3ad66f93 100644
--- a/lib/spack/spack/cmd/concretize.py
+++ b/lib/spack/spack/cmd/concretize.py
@@ -29,6 +29,7 @@ chosen, test dependencies are enabled for all packages in the environment.""",
)
spack.cmd.common.arguments.add_concretizer_args(subparser)
+ spack.cmd.common.arguments.add_common_arguments(subparser, ["jobs"])
def concretize(parser, args):
diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py
index 7774810102..263b30edab 100644
--- a/lib/spack/spack/environment/environment.py
+++ b/lib/spack/spack/environment/environment.py
@@ -1475,7 +1475,10 @@ class Environment:
# Solve the environment in parallel on Linux
start = time.time()
- max_processes = min(len(arguments), 16) # Number of specs # Cap on 16 cores
+ max_processes = min(
+ len(arguments), # Number of specs
+ spack.config.get("config:build_jobs"), # Cap on build jobs
+ )
# TODO: revisit this print as soon as darwin is parallel too
msg = "Starting concretization"
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 0db940129a..1644cffe6f 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -734,7 +734,7 @@ _spack_compilers() {
}
_spack_concretize() {
- SPACK_COMPREPLY="-h --help -f --force --test -q --quiet -U --fresh --reuse --reuse-deps"
+ SPACK_COMPREPLY="-h --help -f --force --test -q --quiet -U --fresh --reuse --reuse-deps -j --jobs"
}
_spack_config() {