Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: random numbers in parallel
Replies: 3   Last Post: Apr 26, 2013 1:12 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: random numbers in parallel
Posted: Apr 26, 2013 1:12 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"Gideon" <gideon.simpson@gmail.com> wrote in message
news:28fe2c6f-c9e0-49fb-9514-f59287e53b1b@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/control-random-number-streams.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.