From 5c7dda7e14ef05741d8dd1c4335883638836ee6b Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 11 May 2023 22:29:17 +0200 Subject: 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 --- lib/spack/spack/cmd/concretize.py | 1 + lib/spack/spack/environment/environment.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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" -- cgit v1.2.3-70-g09d2