[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-18 Thread Gray Calhoun
On Tuesday, July 15, 2014 5:25:11 PM UTC-5, Gray Calhoun wrote: > Hi everyone, I'm trying to start using Julia for some Monte > Carlo simulations (not MCMC) which I'd like to parallelize. I > haven't found any documentation for setting the RNG's seed for > parallelization. The naive approach gives

[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-16 Thread Tomas Lycken
Yeah, sorry - I suspected there might be something I was missing. According to the wikipedia page about the MT one of its disadvantages is just that: It can take a long time to turn a non-random initial state—particularly an initial state with

[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-16 Thread Gray Calhoun
On Wednesday, July 16, 2014 2:09:41 AM UTC-5, Tomas Lycken wrote: > Another way would be to just initialize a `MersenneTwister` stream > on each process, and seed them differently. Since the streams are > process local, there shouldn't be any communication overhead, and > streams with different see

[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-16 Thread Gray Calhoun
On Wednesday, July 16, 2014 12:07:09 AM UTC-5, James Delaney wrote: If your goal is that each call to rand(), regardless of process, > sequentially pulls a number from the RNG stream, then perhaps > you just need to create a MersenneTwister([seed]) object. > > mystream = MersenneTwister(1) > ##

[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-16 Thread Tomas Lycken
Another way would be to just initialize a `MersenneTwister` stream on each process, and seed them differently. Since the streams are process local, there shouldn't be any communication overhead, and streams with different seeds should be independent. // T On Wednesday, July 16, 2014 7:07:09 AM

[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-15 Thread james . dillon . delaney
If your goal is that each call to rand(), regardless of process, sequentially pulls a number from the RNG stream, then perhaps you just need to create a MersenneTwister([seed]) object. mystream = MersenneTwister(1) ## Parallel execution srand(1) parfor = @parallel (vcat) for i=1:4