mercredi 8 avril 2015

Reproducing random numbers in R using an Rcpp function on different SOCKET clusters (two Win7 machines)

I am running an Rcpp function on four nodes using the snow package (two on localhost and two on an openssh server, both machines use Win7)


Before I do my calculations, I'd like to make test runs to get an idea of the time required to do load and calculate on the different nodes. For this, I'd need to set identical seeds for all my nodes. Now, if I use



clusterSetupRNGstream(cl, seed=1234)


I can reproduce random numbers in R, e.g. by



rnorm(2) # -0.7575862 -0.3914031 on all nodes


If I use my Rcpp function, I can reproduce identical results for my two nodes on localhost, as well as identical results for my two nodes on my second machine. The two machines, however, do differ...


What am I missing? How can I get identical results from all four nodes?





Aucun commentaire:

Enregistrer un commentaire