autoStopCluster: Automatically Stop a Cluster when Garbage Collected

Description Usage Arguments Value See Also Examples

View source: R/autoStopCluster.R

Description

Registers a finalizer to a cluster such that the cluster will be stopped when garbage collected

Usage

1

Arguments

cl

A cluster object created by for instance makeClusterPSOCK() or parallel::makeCluster().

debug

If TRUE, then debug messages are produced when the cluster is garbage collected.

Value

The cluster object with attribute gcMe set.

See Also

The cluster is stopped using stopCluster(cl).

Examples

1
2
3
4
5
6
7
options(parallelly.debug = TRUE)

cl <- makeClusterPSOCK(2, dryrun = TRUE)
cl <- autoStopCluster(cl)
print(cl)
rm(list = "cl")
gc()

MINATILO/parallelly documentation built on Dec. 17, 2021, 2:11 a.m.