Fix build_jobs exceeding number of cores
All documentation mentions that `build_jobs` is limited by the number of cores available in the system. This is also enforced when setting it via `--jobs`. However, when setting it via `config.yaml`, it can exceed the number of cores available, making builds run out of memory.
This commit is contained in:
parent
3f83a2a7d8
commit
a7e915d38b
1 changed files with 1 additions and 0 deletions
|
@ -406,6 +406,7 @@ def _set_variables_for_single_module(pkg, module):
|
|||
"""Helper function to set module variables for single module."""
|
||||
|
||||
jobs = spack.config.get('config:build_jobs') if pkg.parallel else 1
|
||||
jobs = min(jobs, multiprocessing.cpu_count())
|
||||
assert jobs is not None, "no default set for config:build_jobs"
|
||||
|
||||
m = module
|
||||
|
|
Loading…
Reference in a new issue