mirror of
https://github.com/status-im/das-research.git
synced 2025-02-22 19:38:14 +00:00
add numJobs parameter to config
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
16b670e916
commit
567d13e370
@ -20,6 +20,10 @@ dumpXML = 1
|
||||
visualization = 1
|
||||
logLevel = logging.INFO
|
||||
|
||||
# number of parallel workers. -1: all cores; 1: sequential
|
||||
# for more details, see joblib.Parallel
|
||||
numJobs = 3
|
||||
|
||||
# Number of simulation runs with the same parameters for statistical relevance
|
||||
runs = range(10)
|
||||
|
||||
|
3
study.py
3
study.py
@ -50,7 +50,8 @@ def study():
|
||||
sim.logger.info("Starting simulations:", extra=sim.format)
|
||||
start = time.time()
|
||||
|
||||
results = Parallel(-1)(delayed(runOnce)(sim, config, shape) for shape in config.nextShape())
|
||||
results = Parallel(config.numJobs)(delayed(runOnce)(sim, config, shape) for shape in config.nextShape())
|
||||
|
||||
|
||||
end = time.time()
|
||||
sim.logger.info("A total of %d simulations ran in %d seconds" % (len(results), end-start), extra=sim.format)
|
||||
|
Loading…
x
Reference in New Issue
Block a user