init: remove build_jobs global variable
This commit is contained in:
parent
2ab7b7a5a0
commit
d4709673b5
3 changed files with 4 additions and 15 deletions
|
@ -24,7 +24,6 @@
|
|||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
import sys
|
||||
import multiprocessing
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Below code imports spack packages.
|
||||
|
@ -33,22 +32,10 @@
|
|||
# TODO: refactor everything below to be more init order agnostic.
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Import spack.config first, as other modules may rely on its options.
|
||||
# TODO: Below code should not import modules other than spack.config
|
||||
#-----------------------------------------------------------------------------
|
||||
import spack.config
|
||||
|
||||
|
||||
# TODO: get this out of __init__.py
|
||||
binary_cache_retrieved_specs = set()
|
||||
|
||||
|
||||
#: The number of jobs to use when building in parallel.
|
||||
#: By default, use all cores on the machine.
|
||||
build_jobs = spack.config.get('config:build_jobs', multiprocessing.cpu_count())
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Initialize various data structures & objects at the core of Spack.
|
||||
#
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
from llnl.util.tty.color import colorize
|
||||
from llnl.util.filesystem import mkdirp, install, install_tree
|
||||
|
||||
import spack.config
|
||||
import spack.main
|
||||
import spack.paths
|
||||
import spack.store
|
||||
|
@ -347,7 +348,7 @@ def set_module_variables_for_package(pkg, module):
|
|||
This makes things easier for package writers.
|
||||
"""
|
||||
# number of jobs spack will build with.
|
||||
jobs = spack.build_jobs
|
||||
jobs = spack.config.get('config:build_jobs') or multiprocessing.cpu_count()
|
||||
if not pkg.parallel:
|
||||
jobs = 1
|
||||
elif pkg.make_jobs:
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
import llnl.util.tty as tty
|
||||
|
||||
import spack
|
||||
import spack.config
|
||||
import spack.paths
|
||||
import spack.store
|
||||
import spack.compilers
|
||||
|
@ -506,7 +507,7 @@ class SomePackage(Package):
|
|||
parallel = True
|
||||
|
||||
#: # jobs to use for parallel make. If set, overrides default of ncpus.
|
||||
make_jobs = spack.build_jobs
|
||||
make_jobs = None
|
||||
|
||||
#: By default do not run tests within package's install()
|
||||
run_tests = False
|
||||
|
|
Loading…
Reference in a new issue