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 makePSOCKcluster
is an enhanced version of
makeSOCKcluster
in package
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
):
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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 Rsession 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.