View source: R/utils-control-par.R
parallel_start | R Documentation |
parallel
packageStart parallel clusters using parallel
package
parallel_start(
...,
.method = c("parallel", "spark"),
.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 |
.packages |
Packages that can be sent to the workers |
.method = "parallel"
)Performs 3 Steps:
Makes clusters using parallel::makeCluster(...)
. The parallel_start(...)
are passed to parallel::makeCluster(...)
.
Registers clusters using doParallel::registerDoParallel()
.
Adds .libPaths()
using parallel::clusterCall()
.
.method = "spark"
) Important, make sure to create a spark connection using sparklyr::spark_connect()
.
Pass the connection object as the first argument.
For example, parallel_start(sc, .method = "spark")
.
The parallel_start(...)
are passed to 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.