
Execute a stochastic map with core-count-invariant L'Ecuyer-CMRG RNG streams
Source:R/audit-parallel-rng.R
statci_parallel_apply.RdPre-generates one independent seed per element of X from a master
"L'Ecuyer-CMRG" stream and evaluates FUN(X[[i]], ...) inside a locally
scoped L'Ecuyer-CMRG RNG context. Because each task receives its own
deterministic stream independent of worker partitioning, results are
bit-for-bit identical across cores = 1, cores = 2, or any larger core
count on macOS, Linux, and Windows.
Arguments
- X
A vector or list to iterate over.
- FUN
A function applied to each element of
X.- ...
Additional arguments passed to
FUN.- cores
Integer number of worker processes (
>= 1). When running underR CMD check(_R_CHECK_LIMIT_CORES_set),coresis automatically capped at 2.- seed
Integer master seed used to derive per-task L'Ecuyer streams.