[R-sig-hpc] unable to create localhost clusters with doSNOW

Dirk Eddelbuettel edd at debian.org
Fri Aug 20 16:52:14 CEST 2010


On 20 August 2010 at 11:32, Roman Luštrik wrote:
| I'm trying to parallel compute with doSNOW and foreach package (%dopar%) on
| my 4 core W7 32 bit machine.
| 
| I'm stuck at the first line when I try to create a cluster
| 
| wrk  <-  makeCluster(spec = 4, type = "SOCK")
| 
| The computer hangs and waits until I stop the process.

I am not the best person for advice on Windows but I think what this means is
that you cannot spawn extra shells on your machine via the default mechanism,
which I believe to be ssh.  

Whereas on my Linux box, using first a quick ssh test and then a one-line
invocation of R via r (aka littler, and older cousin of Rscript): 

edd at max:~$ ssh localhost hostname    # proves I can ssh to myself
max
edd at max:~$ r -lsnow -e'wrk <- makeCluster(spec = 4, type = "SOCK"); print(str(wrk)); stopCluster(wrk)'
Loading required package: utils
Loading required package: utils
Loading required package: utils
Loading required package: utils
List of 4
 $ :List of 3
  ..$ con :Classes 'sockconn', 'connection'  atomic [1:1] 3
  .. .. ..- attr(*, "conn_id")=<externalptr> 
  ..$ host: chr "localhost"
  ..$ rank: int 1
  ..- attr(*, "class")= chr "SOCKnode"
 $ :List of 3
  ..$ con :Classes 'sockconn', 'connection'  atomic [1:1] 4
  .. .. ..- attr(*, "conn_id")=<externalptr> 
  ..$ host: chr "localhost"
  ..$ rank: int 2
  ..- attr(*, "class")= chr "SOCKnode"
 $ :List of 3
  ..$ con :Classes 'sockconn', 'connection'  atomic [1:1] 5
  .. .. ..- attr(*, "conn_id")=<externalptr> 
  ..$ host: chr "localhost"
  ..$ rank: int 3
  ..- attr(*, "class")= chr "SOCKnode"
 $ :List of 3
  ..$ con :Classes 'sockconn', 'connection'  atomic [1:1] 6
  .. .. ..- attr(*, "conn_id")=<externalptr> 
  ..$ host: chr "localhost"
  ..$ rank: int 4
  ..- attr(*, "class")= chr "SOCKnode"
 - attr(*, "class")= chr [1:2] "SOCKcluster" "cluster"
NULL
edd at max:~$ 

Now, you don't _have_ to use ssh but it may well be fallback. You may need to
peruse the snow documentation to learn which other authentication mechanisms
you have your disposal.

Dirk


| Following some advice from this
| list<http://article.gmane.org/gmane.comp.lang.r.hpc/216/>,
| I tried "nudging" it from another terminal (running the same command). I got
| the following error.
| 
| Error in socketConnection(port = port, server = TRUE, blocking = TRUE,  :
|   cannot open the connection
| In addition: Warning message:
| In socketConnection(port = port, server = TRUE, blocking = TRUE,  :
|   port 10187 cannot be opened
| 
| Per advice from the same link I tried adding outfile argument, but nothing
| happened (looks like cluster wasn't created).
| 
| wrk <- makeSOCKcluster(rep("localhost", 4), manual = TRUE, outfile =
| "d:/workspace/para/snow.log")
| 
| Manually start worker on localhost with
|      C:\Program Files\R\R-2.11.1/bin/Rscript.exe
| C:/Users/romunov/Documents/R/win-library/2.11/snow/RSOCKnode.R
| MASTER=localhost PORT=10187 OUT=d:/workspace/para/snow.log
| SNOWLIB=C:/Users/romunov/Documents/R/win-library/2.11
| 
| I have tried turning off firewall and program blocker, but I got the same,
| unresponsive, result. Any suggestions welcome.
| 
| Cheers,
| Roman
| 
| 
| 
| R version 2.11.1 (2010-05-31)
| i386-pc-mingw32
| 
| locale:
| [1] LC_COLLATE=Slovenian_Slovenia.1250  LC_CTYPE=Slovenian_Slovenia.1250
| [3] LC_MONETARY=Slovenian_Slovenia.1250 LC_NUMERIC=C
| [5] LC_TIME=Slovenian_Slovenia.1250
| 
| attached base packages:
| [1] stats     graphics  grDevices utils     datasets  methods   base
| 
| 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.1
| 
| -- 
| In God we trust, all others bring data.
| 
| 	[[alternative HTML version deleted]]
| 
| _______________________________________________
| R-sig-hpc mailing list
| R-sig-hpc at r-project.org
| https://stat.ethz.ch/mailman/listinfo/r-sig-hpc

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



More information about the R-sig-hpc mailing list