Skip to content
Prev 1804 / 2152 Next

parallel library's random numbers

Ross,

Consider writing this SPMD style and run as Rscript. Here is a short 
example:

library(pbdMPI, quiet=TRUE)
init()
comm.set.seed(1234567, diff=TRUE)
r <- runif(5)
comm.print(r, all.rank=TRUE)
finalize()

Put the above 6 lines of R code into file rand.r and then run
mpirun -np 2 Rscript rand.r
Experiment with diff=FALSE and with more than 2 nodes. Then start 
reading the vignette for the pbdDEMOpackage.

If diff=TRUE, the streams are independent. This uses the package rlecuyer.

Good luck!

George

P.S. I assume your 50 nodes are in a cluster, probably managed with PBS. 
Then the mpirun is issued after a "qsub -I ..." interactive allocation.
On 12/19/13 5:08 PM, Ross Boylan wrote: