multiprocessing implemented for restitution and autopicker

This commit is contained in:
2017-04-06 15:37:54 +02:00
parent ef1755a80f
commit 393289245f
6 changed files with 125 additions and 92 deletions

View File

@@ -29,19 +29,16 @@ def getindexbounds(f, eta):
u = find_nearest(f[mi:], b) + mi
return mi, l, u
def worker(func, input, cores='max', async=False):
def gen_Pool(ncores='max'):
import multiprocessing
if cores == 'max':
cores = multiprocessing.cpu_count()
if ncores=='max':
ncores=multiprocessing.cpu_count()
pool = multiprocessing.Pool(ncores)
return pool
pool = multiprocessing.Pool(cores)
if async == True:
result = pool.map_async(func, input)
else:
result = pool.map(func, input)
pool.close()
return result
def clims(lim1, lim2):
"""