开发者

Parallel processing in R 2.11 Windows 64-bit using SNOW not quite working

开发者 https://www.devze.com 2022-12-30 05:15 出处:网络
I\'m running R 2.11 64-bit on a WinXP64 machine with 8 processors. With R 2.10.1 the following code spawned 6 R processes for parallel processing:

I'm running R 2.11 64-bit on a WinXP64 machine with 8 processors. With R 2.10.1 the following code spawned 6 R processes for parallel processing:


require(foreach)
require(doSNOW)
cl = makeCluster(6, type='SOCK')
registerDoSNOW(cl)
bl2 = foreach(i=icount(length(unqmrno))) %dopar% {
    (Some code here)
}
stopCluster(cl)

When I run the same code in R 2.11 Win64, the 6 R processes are not spawning, and the code hangs. I'm wondering if this is a problem with the port of SNOW to 2.11-64bit, or if any additional code is required on my part. Thanks

BTW, this works just fine on my multicore 开发者_StackOverflow中文版machine at home running Ubuntu Karmic 64-bit and R 2.11. Unfortunately I have to work on Win64 at work


The code seems to be working here.

R version 2.11.0 (2010-04-22) 
x86_64-pc-mingw32 
other attached packages:
[1] doSNOW_1.0.3    snow_0.3-3      foreach_1.3.0   codetools_0.2-2
[5] iterators_1.0.3
loaded via a namespace (and not attached):
[1] tools_2.11.0

Check your sessionInfo() to make sure your versions match mine. One thing I noted is that on my Windows 7 machine the first attempt to makeCluster made a request for a firewall exception. If you did not explicitly make allowances for the socket communication that could be why it is hanging. The defaults it opened (ugly as it is) was all TCP and UDP ports when operating under the private profile.


It is an old question, but I encountered the same problems with R-2.13.1 64 on Win 64 bits.

doSNOW was working fine with R 32-bits but not with R 64-bits, and was hanging at "cl = makeCluster(6, type='SOCK')" as well.

To resolve the problem I eventually added "C:\Program Files\R\R-2.13.1\bin\x64" to the %PATH% environment variable (win+pause/advanced system settings/advanced/environment variables/system variables). Make also sure to allow the R connections in Windows Firewall, and that C:\Program Files\R\R-2.13.1\bin contains copy of the 32-bits version of R.exe and Rscript.exe (not the x64 ones).

After doing this, when running makeCluster() 12 processes are started, 6 32 bits and 6 64 bits, but during the calculations only the 64 bits one are used.

0

精彩评论

暂无评论...
验证码 换一张
取 消