[minor] improve user output on used CPU cores

This commit is contained in:
Marcel Paffrath 2017-09-12 11:02:08 +02:00
parent 7027f9ca58
commit 0cf46a0cc3
2 changed files with 6 additions and 1 deletions

View File

@ -64,8 +64,11 @@ def autopickevent(data, param, iplot=0, fig_dict=None, fig_dict_wadatijack=None,
print('iPlot Flag active: NO MULTIPROCESSING possible.')
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 {} '
'stations on {} cores.'.format(len(input_tuples), ncores))
'stations on {} cores.'.format(len(input_tuples), ncores_str))
pool = gen_Pool(ncores)
result = pool.map(call_autopickstation, input_tuples)

View File

@ -72,6 +72,8 @@ def gen_Pool(ncores=0):
if ncores == 0:
ncores = multiprocessing.cpu_count()
print('gen_Pool: Generated multiprocessing Pool with {} cores\n'.format(ncores))
pool = multiprocessing.Pool(ncores)
return pool