squidpy icon indicating copy to clipboard operation
squidpy copied to clipboard

occurrence uses all the cores

Open wangjiawen2013 opened this issue 3 years ago • 7 comments
trafficstars

Hi, when I ran sq.gr.co_occurrence, it used all the 128 cores of my server, even the n_jobs were set to n_jobs=30, how to limit the number of cores it uses ?

wangjiawen2013 avatar May 07 '22 15:05 wangjiawen2013

Hi @wangjiawen2013 , sorry for such a late reply. I will investigate, but I suppose this is due to implicit OMP parallelism and not because of the process parallelism we use explicitly.

michalk8 avatar May 30 '22 08:05 michalk8

hi @wangjiawen2013 ,

is this still an issue? It's probably not dependent on our joblib implementatioon.

giovp avatar Aug 18 '22 19:08 giovp

Yes, and it breaks as "segment fault" when treating some datasets. But when setting numba_parallel=False and n_jobs=1, the problem was solved, and faster than using all the cores.

wangjiawen2013 avatar Aug 19 '22 01:08 wangjiawen2013

Thanks for the feedback, if you set numba_parallel=False yet set n_jobs=2, does it use 2 cores correctly?

giovp avatar Aug 19 '22 04:08 giovp

it also worked when numba_parallel=False and n_jobs=2, why ?

wangjiawen2013 avatar Aug 19 '22 10:08 wangjiawen2013

Sorry, I mean sq.gr.ligrec can also use all cores. But when setting numba_parallel=False and n_jobs=1, the problem was solved, and faster than using all the cores. In the case of sq.gr.co_occurrence, I cannot set numba_paralle, becuase this parameter is not in sq.gr.co_occurrence(). It still used all of the CPU cores.

wangjiawen2013 avatar Aug 25 '22 06:08 wangjiawen2013

thanks for trying it out, I will check again with the co_occurrence? Shall we set numba_parallell = False by default @michalk8 ?

giovp avatar Sep 10 '22 11:09 giovp

hi @wangjiawen2013 , I'll close this issue as it seems it's a matter of setting defaults and am not super sure tbh. thanks for raising this, let's continue conversation if it raises again.

giovp avatar Oct 11 '22 12:10 giovp