start_parallel: Initializes a cluster for parallel computing

Description Usage Arguments Value Examples

Description

On Windows, this function initializes a socket cluster and then (optionally) registers the cluster with the DoParallel package, loads a list of packages on each node of the cluster, exports a list of objects to each node, and returns the cluster object. On Mac and other operating systems that can take advantage of multicore, the function does nothing but (optionally) register a cluster of the specified number of nodes with DoParallel. On TACC, the function detects an existing MPI cluster using getMPIcluster, (optionally) registers the cluster with doSNOW, loads a list of packages on each node, exports a list of objects to each node, and returns the cluster object.

Usage

1
2
start_parallel(cores, source_obj = NULL, packages = NULL,
  setup = "plan")

Arguments

cores

desired number of cores. Defaults to one less than the number of available cores.

source_obj

list of objects to be exported to each node of the cluster. Defaults to NULL.

packages

list of package names to be exported to each node of the cluster. Defaults to NULL.

setup

character string indicating how to further configure the cluster. Set to "plan" to initiate a future evaluation strategy using future::plan. Set to "register" to register the cluster using doParallel or doSNOW, which is necessary for using the .parallel option in plyr functions. Defaults to "plan".

Value

On TACC or Windows, returns the cluster object. On Mac, returns NULL.

Examples

1
2
3
4
5
## Not run: 
cluster <- start_parallel()
stopCluster(cluster)

## End(Not run)

jepusto/Pusto documentation built on June 5, 2019, 9:51 p.m.