In create_SE and probably elsewhere, the map_df function is called inside of already parallelized calls, resulting in nested parallelization which does not respect the number of workers set via BiocParallel::register.
Options for nested parallelization with BiocParallel can be controlled by passing a list of back-end objects to the BPPARAM parameter in bplappy. It is probably a good idea to make the default only one level of parallelization unless explicitly set by the user via BPPARAM.
It also seems a bit excessive to have so many nested parallelized calls and maybe some of them can be removed?
In
create_SE
and probably elsewhere, themap_df
function is called inside of already parallelized calls, resulting in nested parallelization which does not respect the number of workers set viaBiocParallel::register
.Options for nested parallelization with
BiocParallel
can be controlled by passing a list of back-end objects to theBPPARAM
parameter inbplappy
. It is probably a good idea to make the default only one level of parallelization unless explicitly set by the user viaBPPARAM
.It also seems a bit excessive to have so many nested parallelized calls and maybe some of them can be removed?
To reprex, pull my repo and run:
This is what![image](https://user-images.githubusercontent.com/44755307/194177079-3fa72178-3077-4b33-97b7-01c4073f04aa.png)
htop
looks like after like 1 minute:You can see it is touching all 24 thread despite setting the number of workers to 4. And it eventually crashes with OOM.
Best, Chris