[add] --ncores flag added to autoPyLoT call, also enabled in GUI widget

This commit is contained in:
2017-08-03 11:49:15 +02:00
parent 90006809a5
commit 154e7b459f
5 changed files with 42 additions and 19 deletions

View File

@@ -33,10 +33,14 @@ def getindexbounds(f, eta):
return mi, l, u
def gen_Pool(ncores='max'):
def gen_Pool(ncores=0):
'''
:param ncores: number of CPU cores for multiprocessing.Pool, if ncores == 0 use all available
:return: multiprocessing.Pool object
'''
import multiprocessing
if ncores == 'max':
if ncores == 0:
ncores = multiprocessing.cpu_count()
pool = multiprocessing.Pool(ncores)