[R-sig-hpc] rsprng
Ross Boylan
ross at biostat.ucsf.edu
Wed May 20 18:22:26 CEST 2009
I overlooked a 3rd issue: my R code is calling C code, which is calling
the system random number functions.
So I also need to figure out how that interacts with the stuff that R
and SPRNG are doing.
I could also change the C code to work with sprng. There are two
difficulties: first, I think I need an explicit way to pass the state
between R and C; second, (ideally) the C module needs to work both in
the presence and the absence of mpi and sprng.
Using sprng to generate a seed for the C code to set seems like the
easiest course. However, that's only safe if the C system random number
generator and R's sprng live in different worlds.
At the moment my simulation code accepts a C and sets it in R, the basis
for my original experiments. Maybe set.seed, though a no-op for R with
rsprng installed, still affects the system RNG, and so the random
numbers my C code gets.
Ross
More information about the R-sig-hpc
mailing list