How would I register a PSOCK cluster (created using package Parallel) with foreach? I'm currently using registerDoSNOW in the doSNOW package to register a snow SOCK cluster.
Asked
Active
Viewed 742 times
7
-
Just curious, why do you want to use a PSOCK cluster? – Paul Hiemstra Nov 30 '11 at 08:40
-
I'm hopeful that the re-write will be more stable on Windows than a snow sock cluster. Its also nice that Parallel ships as part of the base R package - its likely to get more attention than snow with more people reporting bugs and larger audience to voice questions. Seems logical to make the upgrade. – Suraj Nov 30 '11 at 13:31
-
Hmm, I use a SOCK cluster under Linux without problems. What kind of instabilities do you experience? – Paul Hiemstra Nov 30 '11 at 13:34
-
http://stackoverflow.com/questions/7237024/error-in-unserialize-foreach-dosnow-snow-with-sock-windows A few others that I haven't reported because they happen from time-to-time and I haven't been able to repro. Overall I found there was a lack of resources for parallelization on windows and I had to stumble though it. I figure now that this is a part of base R, more people are likely to use it on Windows and write about it. – Suraj Nov 30 '11 at 13:35
-
See a comment to one of the answers in your other post. – Paul Hiemstra Nov 30 '11 at 13:40
-
SOCK clusters should work just fine under Windows (although I have no direct experience). Switching to Linux would definitely fix this problem, and be a good idea anyway ;). – Paul Hiemstra Nov 30 '11 at 13:41
-
The problem is that anyone who has done serious work with the various parallel packages uses Linux and says the same thing "it should work on Windows." In my experience, getting parallelization to work on Windows was a painful experience. I got it to be semi-stable. That's why I'm so excited that Parallel is part of base R. And yes yes, I know all the Linux folks think that all problems in the world go away when you make the switch, but I like Windows for many reasons and I'm sticking around =) – Suraj Nov 30 '11 at 13:47
-
sorry, just got this...added to chat – Suraj Nov 30 '11 at 15:23
1 Answers
4
Use registerDoParallel from the doParallel package on the cluster handle. It is essentially the same as registerDoSNOW for socket clusters.
Simon Urbanek
- 13,842
- 45
- 45