[R-sig-hpc] Problems with package SNOW

Stephen Weston stephen.b.weston at gmail.com
Sat May 7 17:28:53 CEST 2011


2011/5/7 María del Carmen Romero <mariadelc.romero at gmail.com>:
> Hi,
>
> My name is Maria del Carmen Romero and I was working with package snow until
> December, 2010 without problems. Now, when I try to create 2 clusters
> (because I have a dual-core processor) with the instruction:
>> cl<-makeCluster(2,type="SOCK")
>
> I have to different problems:
>
> - In earlier versions to 2.13, the error is:
> Error en socketConnection(host, port, open = "a+b", blocking = TRUE) :
>  argumento 'port' inválido
> Además: Warning message:
> In socketConnection(host, port, open = "a+b", blocking = TRUE) :
>  NAs introducidos por coerción

It looks like a worker is seeing a corrupted port value.
I can reproduce this type of error with:

    > setDefaultClusterOptions(port="frank")
    > cl <- makeCluster(2, type="SOCK")

In this case, the worker tries to convert "frank" to an integer,
gets an NA instead, and then socketConnection complains that
NA is an invalid port value.

But I don't see how that would happen accidentally.  snow doesn't
use a configuration file that I know of.  You're not executing any
snow functions in a Rprofile file, are you?

You could look at the default value of the port option using:
cl <- makeCluster(2, type="SOCK", manual=TRUE)
    > getClusterOption("port")

By default, it returns 10187.

> - In the version to 2.13, the program hangs and I have to hit Ctrl-C.

That's rather common when something goes wrong in
makeSOCKcluster.  The fact that you're using local workers
rules out a number of possible problems, but it still doesn't tell
me much.

In both cases, I suggest using the manual=TRUE option, and then
starting the workers on the local machine using the specified
command lines.  That will tell you how the port value is being set
in the first case.  And you might see some other error message
from the workers in the second case.

In your case, use the command:

    > cl <- makeCluster(2, type="SOCK", manual=TRUE, outfile="")

Setting outfile to an empty string will prevent the worker from
redirecting informational messages.  I think that is useful when
executing workers manually.

- Steve



More information about the R-sig-hpc mailing list