mclapply_socket: Define a sockets version of mclapply

Description Usage Arguments Details Value

View source: R/parallelsugar.r

Description

An implementation of mclapply using parallel::parLapply

Usage

1
2
3
mclapply_socket(X, FUN, ..., mc.preschedule = TRUE, mc.set.seed = TRUE,
  mc.silent = FALSE, mc.cores = 1L, mc.cleanup = TRUE,
  mc.allow.recursive = TRUE)

Arguments

X

A vector/list to iterate over

FUN

A function to apply to X

...

What you pass to mclapply

mc.preschedule

Not used, provided for consistency with parallel::mclapply

mc.set.seed

Not used, provided for consistency with parallel::mclapply

mc.silent

Not used, provided for consistency with parallel::mclapply

mc.cores

Number of cores (default 1)

mc.cleanup

Not used, provided for consistency with parallel::mclapply

mc.allow.recursive

Not used, provided for consistency with parallel::mclapply

Details

Windows does not support forking. This makes it impossible to use mclapply on Windows to farm out work to additional cores.

NOTE: This calls a load-balancing function, which doesn't play well with random number generation. Everything I'm doing is deterministic, but be careful. If you need to change it, switch out the clusterApplyLB for clusterApply.

Value

lapply-like list


karldw/kdw.junk documentation built on Dec. 24, 2018, 1:07 a.m.