Commit cf74b030 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Removed 'maxtasksperchild=1' from Pool.


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 2747586a
Pipeline #8034 passed with stage
in 17 minutes and 50 seconds
......@@ -50,7 +50,7 @@ def MAP(func, args, CPUs=None, flatten_output=False):
CPUs = CPUs if CPUs <= CFG.CPUs else CFG.CPUs # treat CFG.CPUs as maximum number of CPUs
if CPUs and CPUs > 1 and len(args) > 1:
with Pool(CPUs, maxtasksperchild=1) as pool:
with Pool(CPUs) as pool:
results = pool.map(func, args) # always returns a list
else:
results = [func(argset) for argset in args] # generator does not always work properly here
......@@ -83,7 +83,7 @@ def imap_unordered(func, args, CPUs=None, flatten_output=False):
CPUs = CPUs if CPUs <= CFG.CPUs else CFG.CPUs # treat CFG.CPUs as maximum number of CPUs
if CPUs and CPUs > 1 and len(args) > 1:
with Pool(CPUs, maxtasksperchild=1) as pool:
with Pool(CPUs) as pool:
results = list(pool.imap_unordered(func, args)) # returns an iterator
else:
results = [func(argset) for argset in args] # generator does not always work properly here
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment