init.sprng.master {rpvm}R Documentation

Interface to rsprng for initializing SPRNG

Description

init.sprng.master and init.sprng.slave are used together to initialize the parallel random number generator (PRNG) states in the RPVM master and slaves processes, respectively.

init.sprng.group is used to initialize PRNG states for a RPVM group.

RNGkind ("user") is called at the end of these functions so that the default RNG is substituted with the parallel one.

.SPRNG.INIT.TAG is just a prefined message tag number.

Usage

init.sprng.master (children, seed = 0, kindprng = "default",
                   para = 0)
init.sprng.slave  ()
init.sprng.group  (group, rootinst = 0, seed = 0,
                   kindprng = "default", para = 0)
.SPRNG.INIT.TAG <- 199

Arguments

children vector of integer task ids of the slave processes
seed an integer of random number seed. It is not the starting state of the sequence; rather, it is an encoding of the starting state. The same seed for all the streams. Distinct streams are returned. Only the 31 least significant bits of seed are used in determining the initial starting state of the stream
kindprng a character string of the disired kind of parallel random number generator
para additional parameters for the parallel random number generators. If para is 0, default parameters for each PRNG are used. When invalid parameter is given, a warning is issued and the default paramter is used.
group a character string, the name of the group
rootinst an integer, the root instance number of the group. The root instance is responsible for getting the seed, rngkind and para parameters from the user

Value

Return the a two-element character vector of the RNG and normal kinds in use before the call.

Author(s)

Na (Michael) Li nali@umn.edu and A.J. Rossini rossini@u.washington.edu

References

SPRNG: Scalable Parallel Random Number Generator Library Web Page. http://sprng.cs.fsu.edu/

See Also

init.sprng

Examples

# in master script
## Not run: oldrng <- init.sprng.master (children, seed = 2321)
# in slave script 
## Not run: oldrng <- init.sprng.slave ()
# in group processes
## Not run: oldrng <- init.sprng.group ("mygroup", root = 0, seed = 1231)

[Package rpvm version 0.6-2 Index]