[R-sig-hpc] Problems with package SNOW

Stephen Weston stephen.b.weston at gmail.com
Sat May 7 20:40:07 CEST 2011


It appears to me that in R 2.13.0, the internal function
.path.package has changed.  Instead of returning the old-
style, short file names, it's returning paths that can contain
white space.  snow uses .path.package("snow") to set the
default values of several options, including "snowlib", and
makeSOCKcluster uses "snowlib" to locate RSOCKnode.R,
for example.  Since makeSOCKcluster doesn't quote the
command for starting the workers, it can fail if there are
blanks in the path of RSOCKnode, for example.

I'm not sure why you didn't see an error message from
Rscript when you tried to start the worker, however.
Anyway, I would suggest that you specify a value for
the "snowlib" option to see if it helps.  Here's my guess
of how to set it:

    > snowlib <- file.path(Sys.getenv("R_HOME"), "library")
    > setDefaultClusterOptions(snowlib=snowlib)

I suggest this because it appears from your output that
the R_HOME environment variable still uses the short
file name form.

You can verify that you set it properly with the command:

    > list.files(file.path(getClusterOption("snowlib"), "snow"))

which should list the contents of the snow installation directory.

Now you can create a socket cluster as before.

Good luck,

- Steve


2011/5/7 María del Carmen Romero <mariadelc.romero at gmail.com>:
> Steven,
>
> Thank you for your answer.
>
> I executed the instruction in Version 2.13:
>
>> cl <- makeSOCKcluster(2, manual=TRUE, outfile="")
> Manually start worker on localhost with
>      C:/ARCHIV~1/R/R-213~1.0/bin/Rscript.exe C:/Archivos de
> programa/R/R-2.13.0/library/snow/RSOCKnode.R MASTER=localhost PORT=10187
> OUT= SNOWLIB=C:/Archivos de programa/R/R-2.13.0/library
> in the Version 2.13, and now the program and hangs and I have to hit Ctrl-C.
>
> If I open another session (while the other is running), end execute the same
> instruction, the error is:
> Manually start worker on localhost with
>      C:/ARCHIV~1/R/R-213~1.0/bin/Rscript.exe C:/Archivos de
> programa/R/R-2.13.0/library/snow/RSOCKnode.R MASTER=localhost PORT=10187
> OUT= SNOWLIB=C:/Archivos de programa/R/R-2.13.0/library
> Error en socketConnection(port = port, server = TRUE, blocking = TRUE,  :
>   no se puede abrir la conexión
> Además: Mensajes de aviso perdidos
> In socketConnection(port = port, server = TRUE, blocking = TRUE,  :
>   port 10187 cannot be opened
>
> Clearly, the problem is with the connection... but I do not find it...
>
> María
>
>
>
> El 7 de mayo de 2011 12:34, Stephen Weston <stephen.b.weston at gmail.com>
> escribió:
>>
>> I seem to have garbled my instructions on getting the default
>> port value.
>>
>> 2011/5/7 Stephen Weston <stephen.b.weston at gmail.com>:
>>
>> > You could look at the default value of the port option using:
>> > cl <- makeCluster(2, type="SOCK", manual=TRUE)
>> >    > getClusterOption("port")
>>
>> Ignore that extra line.  I meant to say:
>>
>> You could look at the default value of the port option using:
>>
>>    > getClusterOption("port")
>>
>> - Steve
>
>



More information about the R-sig-hpc mailing list