From 8c15151a4e8f18d03869ab182315afc4cfba70b2 Mon Sep 17 00:00:00 2001 From: Andreas Kotowicz Date: Fri, 11 Jul 2014 15:21:25 +0200 Subject: [PATCH] added warnings about change in parfor behaviour with matlab >= 2014a. --- ParforProgressStarter2.m | 10 ++++++++++ ParforProgressStressTest2.m | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/ParforProgressStarter2.m b/ParforProgressStarter2.m index 57d8e86..6c50425 100644 --- a/ParforProgressStarter2.m +++ b/ParforProgressStarter2.m @@ -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); diff --git a/ParforProgressStressTest2.m b/ParforProgressStressTest2.m index ac01f72..3c95e9d 100644 --- a/ParforProgressStressTest2.m +++ b/ParforProgressStressTest2.m @@ -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