rtopCluster: start, access, stop or restart a cluster for parallel...

View source: R/rtopCluster.R

rtopClusterR Documentation

start, access, stop or restart a cluster for parallel computation with rtop

Description

Convenience function for using parallel computation with rtop. The function is usually not called by the user.

Usage

rtopCluster(nclus, ..., action = "start", type, outfile = NULL)

Arguments

nclus

The number of workers in the cluster

...

Arguments for clusterEvalQ; commands to be evaluated for each worker, such as library-calls

action

Defines the action of the function. There are three options:

"start"

Starts a new cluster if necessary, reuses an existing if it has already been started

"restart"

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

type

The type of cluster; see makeCluster for more details. The default of makeCluster is used if type is missing or NA.

outfile

File to direct the output, makeCluster for more details.

Details

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.

Value

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.

Author(s)

Jon Olav Skoien


rtop documentation built on Nov. 2, 2023, 5:07 p.m.