Memoizing wrapper for parLapplyLB

parLapplyLBm(cl = NULL, X, fun, ..., chunk.size = NULL)

Arguments

cl

cluster object

X

list or vector of inputs

fun

function to apply

...

additional arguments passed to lapply

chunk.size

passed to parallel::parLapplyLB

Value

list of results.

See also

Examples

if(requireNamespace("parallel", quietly = TRUE)) { cl <- parallel::makeCluster(2) fs <- function(x) { x <- x[[1]]; Sys.sleep(1); sin(x) } # without memoization should take 1000 seconds lst <- parLapplyLBm(cl, c(rep(0, 1000), rep(1, 1000)), fs) parallel::stopCluster(cl) }