Skip to content
Prev 970 / 2152 Next

Problems with package SNOW

2011/5/7 Mar?a del Carmen Romero <mariadelc.romero at gmail.com>:
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.
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