Convenience function for using parallel computation with rtop. The function is usually not called by the user.
rtopCluster(nclus, ..., action = "start", type, outfile = NULL)
If the function is called with action equal to "start" or "restart", the result is a cluster with nclus workers.
The cluster is also added to the global options with the name rtopCluster
(getOption("rtopCluster")
).
If the function is called with action equal to "stop", the function stops the cluster, sets the rtopCluster of options to NULL and returns NULL to the user.
The number of workers in the cluster
Arguments for clusterEvalQ
; commands to be evaluated for each worker, such as library-calls
Defines the action of the function. There are three options:
Starts a new cluster if necessary, reuses an existing if it has already been started
Stops the cluster and starts it again. To be used in case there are difficulties with the cluster, or if the user wants to change the type of the cluster
The type of cluster; see makeCluster
for more details.
The default of makeCluster is used if type is missing or NA.
File to direct the output, makeCluster
for more details.
Jon Olav Skoien
It is usually not necessary for the user to call this function for starting or accessing a cluster. This is done automatically
by the different rtop-functions when needed if the parameter nclus is larger than one (see getRtopParams
). If the user actually starts the cluster by a call to this function, it will
also be necessary to set the nclus parameter to a value larger than one for the cluster to be used by different functions.
Restarting the cluster might be necessary if the cluster has a problem (e.g. does not return memory) or if the user wants to change to a different cluster type.
Stopping the cluster is useful when the user does not want to continue with parallel computation and wants to close down the workers.