diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2023-05-11 22:29:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-11 13:29:17 -0700 |
commit | 5c7dda7e14ef05741d8dd1c4335883638836ee6b (patch) | |
tree | 788e0b8d2e4d9f89fdb91c0a228bbfab65defbf5 /lib | |
parent | 0e87243284d7c8992ae0cbb9e46348557119a117 (diff) | |
download | spack-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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/concretize.py | 1 | ||||
-rw-r--r-- | lib/spack/spack/environment/environment.py | 5 |
2 files changed, 5 insertions, 1 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" |