0

This is the original for loop before using parfor, where I have a variable count that keeps track of my progress.

for i = 1:um_Elements
    for j = 1:Temp_Elements

        % statements
        % statements
        % statements

        if mod(count,10) == 0
        fprintf('%d/%d completed\n',count,total);
        end
        count = count + 1;

    end
end

However, if I use multi-core to do the for loop, I can't have the count variable any more, since it updates itself outside the inner loop.

parfor i = 1:um_Elements
    for j = 1:Temp_Elements

        % statement
        % statement
        % statement

    end
end

How can I use parallel and keep track of the overall progress at the same time? Thanks for any help.

Hong
  • 151
  • 1
  • 2
  • 13
  • Did you try these submissions: [link1](http://www.mathworks.com/matlabcentral/fileexchange/32101-progress-monitor--progress-bar--that-works-with-parfor), [link2](http://www.mathworks.com/matlabcentral/fileexchange/31673-parfor-progress-monitor-v2)? – Dev-iL Jun 17 '15 at 11:05
  • possible duplicate of [Matlab: Print progress from parfor loop](http://stackoverflow.com/questions/23515240/matlab-print-progress-from-parfor-loop) – Dev-iL Jun 17 '15 at 11:06

0 Answers0