File Exchange

image thumbnail

PARFOR progress monitor (progress bar) v3

version 1.0.0.0 (26.6 KB) by Dylan Muir
Progress monitor bar for matlab parfor loops, supports distributed pools

6 Downloads

Updated 22 Dec 2017

GitHub view license on GitHub

This progress bar (progress monitor) is designed to monitor progress during the execution of long parfor loops. It works using a Java-based client/server architecture, which means that it supports distributed worker pools (i.e. doesn't only work on local pools).
Usage:
Begin by creating a parallel pool.
Then construct a ParforProgMon object:
ppm = ParforProgMon(strWindowTitle, nNumIterations <, nProgressStepSize, nWidth, nHeight>);

'strWindowTitle' is a string containing the title of the progress bar window. 'nNumIterations' is an integer with the total number of iterations in the loop.

Optional arguments:
'nProgressStepSize' specifies to update the progress bar every time this number of steps passes. 'nWidth' and 'nHeight' specify the size of the progress window.

Within the parfor loop:
parfor (nIndex = 1:nNumIterations)
ppm.increment();
end

Updates over v2:
The class now automatically handles distributing the required code to the workers.

Cite As

Dylan Muir (2020). PARFOR progress monitor (progress bar) v3 (https://github.com/DylanMuir/ParforProgMon), GitHub. Retrieved .

Comments and Ratings (14)

Frerk Saxen

Based on this very nice implementation I implemented my own parfor progress monitor that can show the remaining time and progress of each worker -> https://de.mathworks.com/matlabcentral/fileexchange/71436-parfor-progress-monitor-progress-bar-v4

Thank you so much

This is a very nice submission and I use it regularly.

Is there a way to tell when the bar has been deleted? Sometimes in the middle of an operation, I would like to quick processing a parfor loop if something is wrong. I know I could do this violently with a CTRL+C in the window and then delete ppm, but it would be nice to do this more cleanly.

I'm thinking something like:
parfor idx = 1:10
success = ppm.increment;
if not(success)
continue % Effectively skips all remaining iterations and drops out of PARFOR loop.
end
% Do stuff
end
success = ppm.delete;
if not(success)
% Clean up stuff and prepare any outputs
return
end

Dylan Muir

@zzzhhh Yes, you should create a ParforProgMon object before a parfor loop, and delete it afterwards

zzzhhh

If I have multiple parfors, do I need to create a ParforProgMon object for each parfor?

Phil Earp

tcnan

great application, it is working very well

Tim West

I have switched up to MATLAB 2017a and everything working fine now - if helpful I can try and track down the error for 2014a?

Thanks for the code!

Tim

Dylan Muir

Hi Tim, could you please open an issue at https://github.com/DylanMuir/ParforProgMon/issues, and provide a bit of detail about what goes wrong when you use ParforProgMon? Are you running a local or remote pool? Thanks, Dylan.

Tim

Can't get this working on MATLAB 2014a.

I have implemented as:

%%%
if isempty(gcp)
parpool
end
ppm = ParforProgMon('Model Probability Calculation',N);

parfor i = 1:N
## FX ##
ppm.increment();
end

%%%

Any ideas?

Qiang

Very easy to use. Good job!

grega

Updates

1.0.0.0

Updated description

1.0.0.0

Updated description

1.0.0.0

Updated description

1.0.0.0

Updated description

1.0.0.0

Updated description

1.0.0.0

Updated description

1.0.0.0

Trying to include references to v1 and v2

1.0.0.0

Included an image

1.0.0.0

Updated description

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: PARFOR progress monitor (progress bar) v4