% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tools-mcmc.R
\name{setup_mcmc_env}
\alias{setup_mcmc_env}
\title{Setup single-threaded MCMC environment}
\usage{
setup_mcmc_env(cores)
}
\arguments{
\item{cores}{Desired number of parallel chains (one chain per core).}
}
\value{
A named list with old environment values and the validated
\code{cores} value.  Pass this to \code{restore_mcmc_env()} to restore
the previous thread-control state.
}
\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.
}
\keyword{internal}
