I am building a package for R which I want to be able to be cross-platform. I am developing under Linux, and the function mclapply
will be used from the parallel
package. This package is not supported for Windows (which uses doParallel
). I really like the parallel
package though for it's simplicity and speed, and I do not know if this should be a reason to have 2 different versions available of the package for CRAN, for the separate OS (seems like extra work to maintain), not to mention if it is even allowed.
Thoughts?
Also, for now I am regarding parallel
's
mclapply(ldata, function(x), mc.cores=cores)
to be equivalent of doParallel
's
cl <- makeCluster(cores)
parLapply(cl, ldata, function(x))
Is that correct?
parLapply
also from theparallel
package as I believe this is cross platform (or I hope it is since I use it in one of my packages). You can also use anif(){}else{}
withSys.info()["sysname"]
to use the correct setup. – Kelcieparallel
is supported on windows, andmclapply
can be used. It just reverts to serial evaluation, like a simplelapply
. – Renatarenate