Skip to contents

Configure the parallel processing strategy for riemtan operations. Uses the future package to manage parallel backends.

Usage

set_parallel_plan(strategy = "sequential", workers = NULL)

Arguments

strategy

Character string specifying the parallel strategy:

  • "sequential": No parallelization (default for safety)

  • "multisession": Parallel processing using multiple R sessions (works on all platforms including Windows)

  • "multicore": Parallel processing using forked R processes (Unix-like systems only, faster but not available on Windows)

  • "cluster": Parallel processing on a cluster of machines

workers

Integer specifying the number of parallel workers. If NULL (default), uses parallel::detectCores() - 1 to leave one core free. Ignored when strategy = "sequential".

Value

Invisibly returns the future plan object.

Details

The multisession strategy is recommended for most users as it works on all platforms. The multicore strategy is faster on Unix-like systems but is not available on Windows.

To disable parallel processing, use set_parallel_plan("sequential").

Examples

if (FALSE) { # \dontrun{
# Enable parallel processing with automatic worker detection
set_parallel_plan("multisession")

# Use 4 parallel workers
set_parallel_plan("multisession", workers = 4)

# Disable parallel processing
set_parallel_plan("sequential")
} # }