setup_mcmc_env: Setup single-threaded MCMC environment

View source: R/tools-mcmc.R

setup_mcmc_envR Documentation

Setup single-threaded MCMC environment

Description

Ensures each MCMC chain runs strictly on a single OS thread by setting environment variables that control Stan-internal threading and BLAS-level parallelism. The validated core count is returned inside the result list.

Usage

setup_mcmc_env(cores)

Arguments

cores

Desired number of parallel chains (one chain per core).

Value

A named list with old environment values and the validated cores value. Pass this to restore_mcmc_env() to restore the previous thread-control state.


ForceChoice documentation built on Sept. 13, 2026, 1:06 a.m.