[minor] improve user output on used CPU cores
This commit is contained in:
parent
7027f9ca58
commit
0cf46a0cc3
@ -64,8 +64,11 @@ def autopickevent(data, param, iplot=0, fig_dict=None, fig_dict_wadatijack=None,
|
|||||||
print('iPlot Flag active: NO MULTIPROCESSING possible.')
|
print('iPlot Flag active: NO MULTIPROCESSING possible.')
|
||||||
return all_onsets
|
return all_onsets
|
||||||
|
|
||||||
|
# rename str for ncores in case ncores == 0 (use all cores)
|
||||||
|
ncores_str = ncores if ncores != 0 else 'all available'
|
||||||
|
|
||||||
print('Autopickstation: Distribute autopicking for {} '
|
print('Autopickstation: Distribute autopicking for {} '
|
||||||
'stations on {} cores.'.format(len(input_tuples), ncores))
|
'stations on {} cores.'.format(len(input_tuples), ncores_str))
|
||||||
|
|
||||||
pool = gen_Pool(ncores)
|
pool = gen_Pool(ncores)
|
||||||
result = pool.map(call_autopickstation, input_tuples)
|
result = pool.map(call_autopickstation, input_tuples)
|
||||||
|
@ -72,6 +72,8 @@ def gen_Pool(ncores=0):
|
|||||||
if ncores == 0:
|
if ncores == 0:
|
||||||
ncores = multiprocessing.cpu_count()
|
ncores = multiprocessing.cpu_count()
|
||||||
|
|
||||||
|
print('gen_Pool: Generated multiprocessing Pool with {} cores\n'.format(ncores))
|
||||||
|
|
||||||
pool = multiprocessing.Pool(ncores)
|
pool = multiprocessing.Pool(ncores)
|
||||||
return pool
|
return pool
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user