X-Received: by with SMTP id f13mr28450250qah.7.1366934518771;
        Thu, 25 Apr 2013 17:01:58 -0700 (PDT)
X-Received: by with SMTP id y7mr3780127qer.26.1366934518632; Thu,
 25 Apr 2013 17:01:58 -0700 (PDT)
Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!feeder.erje.net!us.feeder.erje.net!news.glorb.com!gp5no7013682qab.0!news-out.google.com!ef9ni16888qab.0!nntp.google.com!gp5no7013669qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.soft-sys.matlab
Date: Thu, 25 Apr 2013 17:01:58 -0700 (PDT)
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=;
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <74bbfeaa-2bc7-4c3d-9b2c-39624a0229bb@googlegroups.com>
Subject: random numbers in parallel
From: Gideon <gideon.simpson@gmail.com>
Injection-Date: Fri, 26 Apr 2013 00:01:58 +0000
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Lines: 8
Xref: news.mathworks.com comp.soft-sys.matlab:794373

I was wondering if people knew how robust the standard matlab rng function was when used in parallel matlab.  The problem I have in mind just has a parfor loop and I'm generating monte carlo samples.  I know there are issues when using random numbers in parallel to ensure each thread is generating independent samples.  How is this handled in MATLAB?   If I generically set rng(SEED) at the beginning of my code, then go into the parallel section, calling randn, will that be sufficient, or do I need to do something more sophisticated?