makeCluster(spec, type, ...)
makePSOCKcluster(names, ...)
makeForkCluster(nnodes = getOption("mc.cores", 2L), ...)
stopCluster(cl = NULL)
setDefaultCluster(cl = NULL)"cluster".c("SOCKcluster", "cluster").
makeCluster creates a cluster of one of the supported types.
The default type, "PSOCK", calls makePSOCKcluster. Type
"FORK" calls makeForkCluster. Other types are passed to
package \href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}snowsnow. makePSOCKcluster is an enhanced version of
makeSOCKcluster in package \href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}snowsnow. It runs
Rscript on the specified host(s) to set up a worker process
which listens on a socket for expressions to evaluate, and returns the
results (as serialized objects).
makeForkCluster is merely a stub on Windows. On Unix-alike
platforms it creates the worker process by forking.
The workers are most often running on the same host as the master, when no options need be set.
Several options are supported (mainly for makePSOCKcluster):
master
port11000:11999.
timeout
outfilestdout and
stderr connection output from the workers.
"" indicates no redirection (which may only be useful for
workers on the local machine).
Defaults to /dev/null (nul: on Windows). The other
possibility is a file path on the worker's host.
Files will be opened in append mode, as all workers log to the
same file.
homogeneousRscript can be launched using
the same path on each? Otherwise Rscript has to be in
the default path on the workers.
rscriptRscript on the workers,
used if homogeneous is true. Defaults to the full path on
the master.
rscript_argsRscript such as --no-environ.
renice15 for a low priority.
OS-dependent: see psnice for details.
rshcmdssh.
user
manual
methods
useXDR
Function makeForkCluster creates a socket cluster by forking
(and hence is not available on Windows). It supports options
port, timeout and outfile, and always uses
useXDR = FALSE.
It is good practice to shut down the workers by calling
stopCluster: however the workers will terminate
themselves once the socket on which they are listening for commands
becomes unavailable, which it should if the master R session is
completed (or its process dies).
Function setDefaultCluster registers a cluster as the default one
for the current session. Using setDefaultCluster(NULL) removes
the registered cluster, as does stopping that cluster.