User`s guide
Introduction to Parallel Solutions
1-7
parfor
MATLAB
®
workers
MATLAB
®
client
Because the iterations run in parallel in other MATLAB sessions, each iteration
must be completely independent of all other iterations. The worker calculating the
value for A(100) might not be the same worker calculating A(500). There is no
guarantee of sequence, so A(900) might be calculated before A(400). (The MATLAB
Editor can help identify some problems with parfor code that might not contain
independent iterations.) The only place where the values of all the elements of the
array A are available is in your MATLAB client session, after the data returns from
the MATLAB workers and the loop completes.
For more information on parfor-loops, see “Parallel for-Loops (parfor)”.
You can modify your cluster profiles to control how many workers run your loops, and
whether the workers are local or on a cluster. For more information on profiles, see
“Clusters and Cluster Profiles” on page 6-14.
Modify your parallel preferences to control whether a parallel pool is created
automatically, and how long it remains available before timing out. For more information
on preferences, see “Parallel Preferences” on page 6-12.
You can run Simulink models in parallel loop iterations with the sim command inside
your loop. For more information and examples of using Simulink with parfor, see “Run
Parallel Simulations” in the Simulink documentation.