MATLAB Answers

How is parfor indexed?

1 view (last 30 days)
My code is below.... how is the sequence of numbers chosen for what indexes parfor decides to tackle next?
parpool;
parfor i = 1:10; disp(i); end
ans = 1
5
7
3
8
4
2
6
9
10

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 11 Feb 2014
The sequence is not documented and is subject to change even on the same run. If your body code needs to know the order the bodies are executed in, then you are not using parfor correctly (and your task might be better suited to spmd)

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.