parallel.destroy: Parallel Destruction

Description Usage Arguments Value Examples

View source: R/parallel.destroy.R

Description

Attempt to kill the specified parallel cluster. Might have unexpected side effects when using the kill all command.

Usage

1
parallel.destroy(cl = NULL, destroy = FALSE)

Arguments

cl

Type: cluster or integer. A parallel cluster. When it is a number, creates a cluster with the specified number of parallel clusters. Defaults to parallel::detectCores().

destroy

Type: logical. Whether to attempt to destroy any cluster. Might have side effects. Defaults to FALSE.

Value

TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Cannot pass CRAN checks. Disabled.
library(parallel)

# Generate 2 useless clusters of 8 threads
cl <- parallel::makeCluster(8)
cl <- parallel::makeCluster(8)

# Attempts to stop the second cluster
parallel.destroy(cl)

# Kills any clusters
parallel.destroy(destroy = TRUE)

## End(Not run)

Laurae2/LauraeDS documentation built on May 29, 2019, 2:25 p.m.