You think this will be a simple question, but I cannot find a solution. Take the following loop:
A = zeros(1,10000000); parfor i = 1:length(A) A(i) = i; end
This only works on one core on my computer, although it can be easily parallelized (or at least should be). I am using Matlab 2012b, and I tried to find documentation on how to create parallel loops but cannot find them (the matlab docs provide examples of how to create these loops, and not how to run them in parallel).
I tried to figure out how to change the parameters of the parallel computing toolbar, but none of them work, since they are all designed for Matlab 2013 (I use 2012b). If someone could provide an example of a trivial parallelizable loop that actually works in parallel, I would be very grateful!
Note. I checked and installed a set of parallel computing tools, although I donβt know if it is enabled or how to enable it, since the documentation does not seem to give an answer for this for my version (I typed preferences on the command line, but did not see it there).
EDITOR: I got this by doing this:
matlabpool('open',4); A = zeros(1,10000000); parfor i = 1:length(A) A(i) = i; end matlabpool('close');
... but I really donβt know why this works, regardless of whether I close each pool, what the pool is (I read the documnentation , still not get it) and how matlabpool differs from parpool ...
parallel-processing matlab
arman
source share