Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

autoStopCluster

Automatically Stop a Cluster when Garbage Collected


Description

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

Usage

autoStopCluster(cl, debug = FALSE)

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

options(parallelly.debug = TRUE)

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

parallelly

Enhancing the 'parallel' Package

v1.25.0
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.