Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
parallelization within drake targets
library(drake)
library(furrr)
future::plan(future::multiprocess)
tictoc::tic()
params = data.frame(t = c(1, 2, 3, 1, 2, 3))
out = purrr::pmap(params, Sys.sleep)
tictoc::toc()
tictoc::tic()
params = data.frame(t = c(1, 2, 3, 1, 2, 3))
out = future_pmap(params, Sys.sleep)
tictoc::toc()
my_plan <- drake_plan(
params = data.frame(t = c(1, 2, 3, 1, 2, 3)),
out = future_pmap(params, Sys.sleep)
)
future::plan(future.callr::callr)
tictoc::tic()
clean()
make(my_plan)
tictoc::toc()
tictoc::tic()
clean()
make(my_plan, parallelism = "future", jobs = 3)
tictoc::toc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.