File Exchange

image thumbnail

ParforProgress class

version (3.71 KB) by Daniel Golden
Matlab class to track iterations within a parfor loop


Updated 17 Aug 2015

From GitHub

View Version History

View license on GitHub

Class to monitor progress of parfor loop
The parallel workers write to a common file for each iteration and determine the total number of completed iterations by counting the number of lines in the file.


pp = ParforProgress;
parfor kk = 1:100
iteration_number = step(pp, kk);
fprintf('Finished iteration %d of %d\n', iteration_number, kk);

The numbers may not go exactly in order depending on the order in which the parallel workers finish, but they'll be close enough so you'll get the idea of where you are.

The technique of using a single file to store the iteration information was inspired
by this file exchange utility:

Cite As

Daniel Golden (2021). ParforProgress class (, GitHub. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!