Learn R Programming

riemtan (version 0.2.5)

set_parallel_plan: 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)

Value

Invisibly returns the future plan object.

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

See Also

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

Examples

Run this code
if (FALSE) {
# 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")
}

Run the code above in your browser using DataLab