set_parallel_plan: Set Parallel Processing Plan

View source: R/parallel_config.R

set_parallel_planR Documentation

Set Parallel Processing Plan

Description

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".

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").

Value

Invisibly returns the future plan object.

See Also

future::plan(), is_parallel_enabled(), should_parallelize()

Examples

## Not run: 
# 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")

## End(Not run)


riemtan documentation built on Nov. 11, 2025, 1:06 a.m.