The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: parfor in for question
Replies: 1   Last Post: Jul 12, 2012 5:30 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Edric Ellis

Posts: 721
Registered: 12/7/04
Re: parfor in for question
Posted: Jul 12, 2012 5:30 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Sandro " <> writes:

> Thanks for the comments. I wonder whether "for" or "parfor "inside
> "parfor" is allowed. It seems to have some warning.

You cannot nest a PARFOR directly in the text of another PARFOR; you can
call a function from within a PARFOR that calls PARFOR - but that
doesn't get you any additional parallelism. (The aim here is that you
can write a PARFOR loop in your function without having to worry about
whether your caller has already started a PARFOR loop). We always
currently use all workers for the outermost PARFOR loop.

> One more question: Do I need to call matlabpool each time when I start
> the matlab or once I call matlabpool function, it will use the setting
> until I change it in the future? In other words, isn't it of necessity
> to explicitly write this command in the code if I want to call parfor?

You do need to explicitly open the matlabpool each time you launch
MATLAB. Note that there's also "matlabpool('size')" which can tell you
if matlabpool is already open.



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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.