Skip to content
Prev 245 / 2152 Next

rsprng

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