Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Re: random numbers in parallel
Posted:
Apr 26, 2013 1:12 PM


"Gideon" <gideon.simpson@gmail.com> wrote in message news:28fe2c6fc9e049fb9514f59287e53b1b@googlegroups.com... > Thanks Patrick.
Peter is the one to whom you responded.
> It sounds like I am in the "easy" case. The code I have is of the > following form: > > data = zeros(N,1); > > parfor k = 1:N > > xi = randn(M,1); > data(k) = f(xi); > > end > > In other words, I want N realizations of a certain function f which > depends on having M i.i.d. Gaussian random variables. So all I want here > is to ensure that each worker is getting an independent stream of random > numbers when it goes on to use randn.
You might find this section of the documentation interesting and/or reassuring.
http://www.mathworks.com/help/distcomp/controlrandomnumberstreams.html
 Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com



