Closed wfmueller29 closed 3 years ago
You can't pass futures between processes, so you can't create (future())
them in a parallel worker and ask them to be resolved (value()
) in another. Instead, use:
fun_a <- function(x){
a <- list()
for(i in 1:x){
a[[i]] <- future(Sys.sleep(5))
}
value(a)
}
or, equivalently using implicit future assignments syntax:
fun_a <- function(x){
a <- listenv()
for(i in 1:x){
a[[i]] %<-% Sys.sleep(5)
}
as.list(a)
}
See also https://future.futureverse.org/articles/future-3-topologies.html
Hi Henrik,
Thank you for the awesome package. It is such an elegant and powerful way to parallelize. I have a question regarding nested parallelization. I am developing some functions which can be simplified to
fun_a
below.I can then call the function sequentially while the function itself is processed asynchronously without any problems:
However it would be great if I could also run calls b, c, and e in parallel. I am trying to do this as shown below:
However I get the error in your Common Issues Vignette:
Here is my session info:
Any help would be much appreciated.