[R] makeSOCKcluster

Luke Tierney luke at stat.uiowa.edu
Fri Sep 1 13:33:16 CEST 2006


On Fri, 1 Sep 2006, Prof Brian Ripley wrote:

> On Fri, 1 Sep 2006, Hrishikesh Rajpathak wrote:
>
>> Hi,
>>
>>   I am a newbie to R and trying to implement parallelism in R. I am
>>   currently using R-2.3.1, and Cygwin to run R on Windows xp.
>
> Did you build R under Cygwin (which is not a supported platform), or are
> you running a native Windows build of R?  If the latter, you may be being
> optimistic to expect R to run Unix commands in the same way as under Unix.
>
> I presume you mean this line in package snow:
>
>    system(paste(rshcmd, "-l", user, machine, "env", env, script))
>
> which appears to be attempting to run a shell script: no shell is used by
> system() on Windows R.  As the return value is not checked, this will not
> fail.
>
> R under Windows differs from R under Unix in a number of ways, and
> system() is a major one.

This runs a command of the form

 	ssh -l user machine env X=x Y=z script

so if your ssh is a .exe this should be OK.  I have successfully run a
snow master on Windows with slave nodes on Linux with I believe the
ssh coming from cygwin, but that was a while ago.

My suggestion is that you look at the command that is generated by the
paste and try running it by hand and see if you can work out why it
hangs.

Best,

luke


>
>
>>   ssh and all are working fine,
>>
>>   When I try to create a socket connection as
>>
>>    makeSOCKcluster(c("localhost","localhost")),
>>
>>   it just waits for the other prcess on localhost to get created and respond. But this other process is not created.
>>
>>   To debug, I put print statements in the "snow " file in library\snow\r  of R after every statement that comes under Socket Implementation. I  realized that it does the execution till
>>
>>   system(a<-paste(rshcmd, "-l", user, machine, "env", env, script))
>>
>>   part and then it goes in wait state. It cannot run the next command which is
>>
>>   con <- socketConnection(port = port, server=TRUE, blocking=TRUE,
>>                                open="a+b")
>>
>>   can someone please tell me what exactly could be the problem?
>>
>>   Thank you,
>>   Rishi
>
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



More information about the R-help mailing list