| Rhpc_setupRNG | R Documentation |
Initializes independent random number streams for each worker process using L'Ecuyer-CMRG algorithm.
Rhpc_setupRNG(cl, iseed = NULL)
cl |
external pointer to MPI communicator |
iseed |
optional integer seed for reproducibility. If |
This function sets up independent random number streams for each worker to ensure they produce different but reproducible random sequences. It uses the L'Ecuyer-CMRG (Combined Multiple Recursive Generator) algorithm.
The master process's original .Random.seed is saved to options("Rhpc.oldseed") but is NOT
automatically restored due to CRAN policy. Users should manually restore if needed:
assign(".Random.seed", getOption("Rhpc.oldseed"), envir = globalenv())
Returns invisibly the original .Random.seed that was saved.
Rhpc_getHandle, Rhpc_lapply
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.