【发布时间】:2015-05-13 10:24:28
【问题描述】:
关于foreach函数,R中的doParallel和doMC有什么区别? doParallel 支持 windows,类 unix,而 doMC 仅支持类 unix。换句话说,为什么doParallel不能直接替换doMC?谢谢。
更新:
doParallel 建立在parallel 的基础上,它本质上是multicore 和snow 的合并,并自动为您的系统使用适当的工具。因此,我们可以使用doParallel 来支持多系统。也就是说,我们可以用doParallel代替doMC。
参考:http://michaeljkoontz.weebly.com/uploads/1/9/9/4/19940979/parallel.pdf
顺便说一句,registerDoParallel(ncores=3) 和
cl <- makeCluster(3)
registerDoParallel(cl)
看来registerDoParallel(ncores=3)可以自动停止集群,而第二个不会自动停止,需要stopCluster(cl)。
参考:http://cran.r-project.org/web/packages/doParallel/vignettes/gettingstartedParallel.pdf
【问题讨论】:
-
只是为了让两者联系起来stackoverflow.com/questions/28829300/…
标签: r parallel-processing domc doparallel