Suppose I fork an R process into 10 workers to run some parallel simulations. What would be a reliable method to make sure that each worker uses different random numbers? I been using this:
myseed <- (unclass(Sys.time())*1e9 * Sys.getpid()) %% 1e9;
set.seed(myseed);
However to my surprise I was getting problems due to RNG clashes between workers. What could have gone wrong here? Is there a better source of randomness that I can use to seed the RNG?
doRNG
package, which is built expressly for this purpose. – Simon O'Hanlon