View source: R/utils-control-par.R
| parallel_start | R Documentation |
Start parallel clusters / plans
parallel_start(
...,
.method = c("parallel", "spark", "future"),
.export_vars = NULL,
.packages = NULL
)
parallel_stop()
... |
Parameters passed to underlying functions (See Details Section) |
.method |
The method to create the parallel backend. Supports:
|
.export_vars |
Environment variables that can be sent to the workers (not needed for "future") |
.packages |
Packages that can be sent to the workers (auto-handled by "future") |
.method = "future")Sets a future::multisession plan (portable across OSes) and registers a foreach
backend via doFuture::registerDoFuture(). This avoids the tune foreach/future warning.
Pass the first unnamed ... argument as worker count (numeric) or omit to
default to parallelly::availableCores(logical = FALSE) or 2 if unknown.
.method = "parallel")parallel::makeCluster(...) 2) doParallel::registerDoParallel(cl)
Set .libPaths() on workers; optional clusterExport and package loads.
.method = "spark")Requires sparklyr::spark_connect(); registers foreach via sparklyr::registerDoSpark(...).
# Starts 2 clusters
parallel_start(2)
# Returns to sequential processing
parallel_stop()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.