Entering edit mode
Has anyone tried using BiocParallel inside a drake plan? For some reason it hangs if I don't set lock_envir = FALSE
telling me that BiocParallel is modifying the global environment somehow but I'd like to know which part that is, to be able to expose that before running make.
can you provide more detail, e.g., a link to 'drake plan', what 'lock_envir =' does, and when you say 'modifying the global environment' are you referring to the R global environment or the operating system environment or, ..., and a simple reproducible example, e.g.,
bplapply(1:5, sqrt, BPPARAM = SnowParam())
that illustrates where the problem occurs?Hi Martin,
Yes apologies for not providing a reprex. I'm using the {drake} package (https://cran.r-project.org/web/packages/drake/index.html)
The following hangs forever:
What works is if I change the
gen_graph
function to not include BPPARAM:Or if I keep
gen_graph
as is and unlock the environment indrake::make
, like so:It would still help to simplify your example further, to direct calls to BiocParallel like the one provided in my first comment. It would also help to see whether the problem involves drake at all, or whether the process (in the simple example) hangs regardless. From your question it seems that this genuinely involves an interaction between BiocParallel and drake. One possibility is that BiocParallel choose a 'port' socket connection to communicate with manager and worker by generating a random number. This could change the random number stream. Solutions might be to provide a port as described in the 'Global Options' section of
?SnowParam
or to start the clusterbpstart(param)
outside the drake command.Hi Martin,
Using your example,
SnowParam()
works, whereasMulticoreParam()
hangs. I'm not sure I understand the difference well enough to grasp what's going on.Thanks.
Can you help me to make a simple reproducible example? For instance
results in
If you help me to get a simple reproducible example using the packages I don't know anything about, I'll be able t help you answer questions about packages I do know about.
Hi Martin,
The exact code you pasted yourself :
for me hangs (as in never ends) in my RStudio Server, which is why I unfortunately can't report an error message as there is none. I have to interrupt R manually. I can, however, see I get the same
$ operator is invalid for atomic vectors
error message on my Mac.This does not hang and produces the predicted result (on both platforms):
with the warning message:
To loadd the results of the drake_plan, you need to
loadd(target1)
I was hoping for anyone using drake to have noticed this issue before. I apologise.