r - How do I set preschedule=FALSE for llply's parallel mode? -
i want use llply perform parallel computations using multicore doparallel backend (i.e. doparallel::registerdoparallel(cores=8)
), each computation take different amount of time, want set multicore preschedule option false computation. however, i'm unsure how pass option llply
pass foreach
pass doparallel
pass mclapply
. can give example of doing this?
in other words, how disable prescheduling in following code?
library(plyr) library(doparallel) registerdoparallel(cores=2) x <- llply(1:10, sqrt, .parallel=true)
you can use llply ".paropts" option that:
opts <- list(.options.multicore=list(preschedule=false)) x <- llply(1:10, sqrt, .parallel=true, .paropts=opts)
as guessed, ".paropts" option passes ".options.multicore" option foreach, propagates on doparallel, calls mclapply mc.preschedule=false
.
Comments
Post a Comment