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
This commit is contained in:
parent
0e87243284
commit
5c7dda7e14
@ -29,6 +29,7 @@ def setup_parser(subparser):
|
|||||||
)
|
)
|
||||||
|
|
||||||
spack.cmd.common.arguments.add_concretizer_args(subparser)
|
spack.cmd.common.arguments.add_concretizer_args(subparser)
|
||||||
|
spack.cmd.common.arguments.add_common_arguments(subparser, ["jobs"])
|
||||||
|
|
||||||
|
|
||||||
def concretize(parser, args):
|
def concretize(parser, args):
|
||||||
|
@ -1475,7 +1475,10 @@ def _concretize_separately(self, tests=False):
|
|||||||
|
|
||||||
# Solve the environment in parallel on Linux
|
# Solve the environment in parallel on Linux
|
||||||
start = time.time()
|
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
|
# TODO: revisit this print as soon as darwin is parallel too
|
||||||
msg = "Starting concretization"
|
msg = "Starting concretization"
|
||||||
|
@ -734,7 +734,7 @@ _spack_compilers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_spack_concretize() {
|
_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() {
|
_spack_config() {
|
||||||
|
Loading…
Reference in New Issue
Block a user