Rf中的sfInit()降雪包在Windows 7上挂起

时间:2015-06-12 22:46:33

标签: r windows-7 snow snowfall

我一直在尝试按照一些指南在我运行Windows 7的工作机上使用所有(4)处理器。他们都建议使用snowfall()包。但是,当我运行以下代码时,R运行直到我终止它。换句话说,R挂起。

sfInit(parallel = TRUE, cpus = 4)

相同的结果
sfInit(parallel = TRUE, cpus = 2)

再次使用

sfInit(parallel = TRUE)

好奇的,我的Sys.info()

                 sysname                      release                      version                     nodename 
               "Windows"                          "7" "build 7601, Service Pack 1"                 "<REDACTED>" 
                 machine                        login                         user               effective_user 
                   "x86"                  "<REDACTED>"                  "<REDACTED>"                  "<REDACTED>" 

和...

sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] actuar_1.1-8       fitdistrplus_1.0-4 MASS_7.3-40        doParallel_1.0.8   doSNOW_1.0.12     
[6] iterators_1.0.7    foreach_1.4.2      snowfall_1.84-6    snow_0.3-13       

loaded via a namespace (and not attached):
[1] compiler_3.2.0   tools_3.2.0      survival_2.38-1  splines_3.2.0    codetools_0.2-11

1 个答案:

答案 0 :(得分:0)

虽然没有直接使用降雪,但我可以通过运行以下

来达到我想要的效果
library(doParallel)
win7 <- makeCluster(4) 
registerDoParallel(win7)
#... rest of code to run in parallel ...
#... using doParallel specific syntax