Skip to content

Commit

Permalink
added warnings about change in parfor behaviour with matlab >= 2014a.
Browse files Browse the repository at this point in the history
  • Loading branch information
kotowicz committed Jul 11, 2014
1 parent 4fa1b48 commit 8c15151
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ParforProgressStarter2.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@
% end
% end
%
%
% !! PARFOR behaviour has changed !!
%
% With Matlab >= 2014a, "parfor" will automatically startup the
% parallel pool, even if you don't want it:
% "Starting parallel pool (parpool) using the 'local' profile"
%
% With Matlab < 2014a, "parfor" will be ignored and would fallback to
% a simple "for", if parallel pool wasn't manually started.
%
% parfor i = 1 : N
% your_crazy_function();
% ppm.increment(i);
Expand Down
9 changes: 9 additions & 0 deletions ParforProgressStressTest2.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ function ParforProgressStressTest2(N, run_javaaddpath, show_execution_time)

t0 = tic();

% !! PARFOR behaviour has changed !!
%
% With Matlab >= 2014a, "parfor" will automatically startup the
% parallel pool, even if you don't want it:
% "Starting parallel pool (parpool) using the 'local' profile"
%
% With Matlab < 2014a, "parfor" will be ignored and would fallback to
% a simple "for", if parallel pool wasn't manually started.
%
parfor i = 1 : N
rand(1, 10000);
ppm.increment(i); %#ok<PFBNS>
Expand Down

0 comments on commit 8c15151

Please sign in to comment.