Path: news.mathworks.com!not-for-mail
From: "Yoav" <yoav.farkash@utoronto.ca>
Newsgroups: comp.soft-sys.matlab
Subject: Parfor counts backward?
Date: Wed, 7 Oct 2009 15:36:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <haich2$38a$1@fred.mathworks.com>
Reply-To: "Yoav" <yoav.farkash@utoronto.ca>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1254929762 3338 172.30.248.38 (7 Oct 2009 15:36:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 7 Oct 2009 15:36:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 990663
Xref: news.mathworks.com comp.soft-sys.matlab:575642


Hi,

When using a parfor loop without the matlabpool open it is supposed to default to a regular for loop (see documentation). This works fine but it seems to be counting from the END of the numbering array to the beginning. For example, run the following code without opening a matlab pool:

parfor x = 1:10
    disp(x);
end

And instead of seeing 1, 2, 3...10 (as you would with a for loop)  you see 10, 9, 8... 1.

Any idea why it happens this way? It shouldn't matter much for results collection but still a curious behaviour.

Cheers,

Yoav