/usr/lib/R/site-library/snow/RNWSnode.R is in r-cran-snow 1:0.4.2-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | local({
master <- "localhost"
port <- "8765"
snowlib <- Sys.getenv("R_SNOW_LIB")
outfile <- Sys.getenv("R_SNOW_OUTFILE")
args <- commandArgs()
pos <- match("--args", args)
args <- args[-(1 : pos)]
for (a in args) {
pos <- regexpr("=", a)
name <- substr(a, 1, pos - 1)
value <- substr(a,pos + 1, nchar(a))
switch(name,
MASTER = master <- value,
PORT = port <- value,
SNOWLIB = snowlib <- value,
OUT = outfile <- value,
RANK = rank <- value,
TMPWS = tmpWsName <- value)
}
##**** these should be passed as arguments to makeNWSmaster
Sys.setenv(MASTER = master)
Sys.setenv(PORT = port)
Sys.setenv(RANK = rank)
Sys.setenv(TMPWS = tmpWsName)
if (! (snowlib %in% .libPaths()))
.libPaths(c(snowlib, .libPaths()))
library(methods) ## because Rscript as of R 2.7.0 doesn't load methods
library(nws)
library(snow)
sinkWorkerOutput(outfile)
master <- makeNWSmaster()
sendData(master, "ping")
cat("starting NWS worker\n")
slaveLoop(master)
})
|