spawn.sprng {rsprng} | R Documentation |
Some times when a process spawns children processes, it is desirable
to spawn new streams from an old one and pass them on to children.
spawn.sprng
creates new random number streams based on the
current one, and returns them as columns of an integer matrix.
These new streams can be then transfered to children processes.
spawn.sprng (nspawn)
nspawn |
number of new streams to spawn |
Return an integer matrix with nstream
columns, each column
corresponds to one stream. The number of rows will depend on the type
of the PRNG.
Na (Michael) Li nali@umn.edu
SPRNG: Scalable Parallel Random Number Generator Library Web Page. http://sprng.cs.fsu.edu/
pack.sprng
, unpack.sprng
,
spawn.new.sprng
init.sprng (1, 0, kind = "CMRG") child.rngs <- spawn.sprng (3) unpack.sprng (child.rngs[,1]) runif (10) unpack.sprng (child.rngs[,2]) runif (10) free.sprng ()