An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-hpc/attachments/20110507/b1ab12bc/attachment.pl>
Problems with package SNOW
5 messages · María del Carmen Romero, Stephen Weston
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
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
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-hpc/attachments/20110507/79b2669e/attachment.pl>
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