makeCluster
Create a Parallel Socket Cluster

Description

Create or stop a cluster, or set the default cluster.

Usage

makeCluster(spec, type = getClusterOption("type"), ...)
makeTERRcluster(nnodes = getOption("mc.cores", 2L), outfile=NULL,
                affinity = NULL, verbose = FALSE, ...)
makePSOCKcluster(names, ...)
makeForkCluster(nnodes = getOption("mc.cores", 2L), ...) 
stopCluster(cl = NULL) 
setDefaultCluster(cl = NULL)

Arguments

spec the cluster specification. The form of this specification depends on the cluster type. In Spotfire Enterprise Runtime for R, spec must be the number of nodes to be created. In open-source R, spec could also be a vector of node names.
type a character string specifying the type of cluster. In Spotfire Enterprise Runtime for R, this should be the string "TERR" (to call makeTERRcluster). The string "TERR" is used as the default value if this argument is not given. (In open-source R, this must be one of "PSOCK", "FORK", "SOCK", "PVM", "MPI" or "NWS", with the default of "PSOCK".)
... the cluster options. Must be given in the pair-list format tag = value. These arguments are passed to the function that creates the cluster, such as makeTERRcluster.
outfile a character string or NULL specifying how to handle text output printed by the nodes. If this is NULL, node text output is silently discarded. If this is "", node text output is printed as it is received. If this is any other string, this is a file name, and node text output is written to this file.
affinity an integer vector giving the CPU cores where each node should run on a Windows machine with multiple cores.
verbose a logical value. If TRUE, debugging information is printed.
names a character vector specifying the names of the cluster nodes to be created, or an integer specifying the number of times to replicate "localhost" as the node name.
nnodes an integer specifying the number of nodes to be created. Must not be less than 1.
cl a cluster object.

Details

makeCluster Creates a cluster of engine nodes to use for parallel computating using functions such as clusterApply. The spec argument must be the number of nodes to be created. The type argument gives the particuar type of cluster. If this is "TERR" or is not given, makeTERRcluster is called.

makeTERRcluster

Creates one or more engine node processes on the same machine.

When Spotfire Enterprise Runtime for R creates engine node processes on a Windows machine with multiple cores, it attempts to assign processor affinities so different nodes run on different cores. Normally, this default behavior should be satisfactory. However, it is possible to specify the affinities explicitly by setting the affinity argument. This should be a vector of integers giving the CPU (from 1 to the number of cores available) where each node should run, or zero if the node should run without core affinity. Thus, makeCluster(3, affinity=c(1,3,5)) runs three nodes on cores 1, 3, and 5 respectively.

If the argument JAVA_OPTIONS is specified in the ... cluster options, it should be a string of options used when starting Java in the engine node processes. For example, JAVA_OPTIONS='-Xmx1024m' can be used to increase the maximum memory size for the Java process. Different options can be specified for the N engine node processes by specifying a string vector with N strings.

makePSOCKcluster and makeForkCluster

Defined to be compatible with open-source R, but Spotfire Enterprise Runtime for R does not support these types of clusters. If they are called, they generate an error.

stopCluster

Stops the engine nodes in the cluster cl.

setDefaultCluster

Registers a cluster as the default for the current session. If a cluster is registered as the default cluster, and a function such as clusterApply is called with its cl argument set to NULL, the default cluster is used.
Value
makeClusterreturns a cluster object.
stopClusterreturns NULL invisibly.
setDefaultClusterreturns cl invisibly.
See Also
clusterApply, clusterSetRNGStream.
Examples
## Not run: 
# Create TERR cluster with 2 nodes
cl <- makeCluster(2)
setDefaultCluster(cl)
stopCluster(cl)

## End(Not run)
Package parallel version 6.1.4-13
Package Index