View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
PARFOR Progress Monitor

4.4 | 8 ratings Rate this file 17 Downloads (last 30 days) File Size: 7.94 KB File ID: #24594 Version:
image thumbnail

PARFOR Progress Monitor


Edric Ellis (view profile)


30 Jun 2009 (Updated )

A Java progress monitor to track progress through a PARFOR loop running MATLABĀ® workers

| Watch this File

File Information

A simple Java progress monitor to show a progress bar on the MATLAB client while Parallel Computing Toolbox workers are executing the iterations of a PARFOR loop. This employs a socket connection from the workers back to the MATLAB client to inform the client when an iteration has been executed.
The MATLAB code must be on the MATLAB path of both the client and the workers; additionally, the java classes must be added to the java class path using javaaddpath.


This file inspired Parfor Progress Monitor V2.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
17 Oct 2013 Darryn

Darryn (view profile)

24 Sep 2013 Arthur Dgn

30 Aug 2013 Peter Li

Peter Li (view profile)

@Alexandra, when `javaaddpath` is called it calls `clear java`, which also appears to clear globals. Try putting the java path into your setup on startup so you don't have to worry about it later?

Comment only
29 Aug 2013 Peter Li

Peter Li (view profile)


I had a little trouble on Linux because my pctconfig hostname was just the machine name and I didn't have anything in /etc/hosts for that. It might be helpful to make the socket connection timeout faster so that in situations like this the thing doesn't just appear to freeze?

It also seems to me that the ProgWorker class isn't strictly necessary. It is sufficient to make the Matlab increment(o) method do something like: s =, o.Port); s.close(); (assuming you also change the private constructor to save the HostName and Port instead of creating a ProgWorker. This seems a bit nicer to me as you don't have to worry about the javaclasspath of the Workers.

Comment only
29 Aug 2013 Peter Li

Peter Li (view profile)

06 Jun 2013 Marius

Marius (view profile)

Great tool! Stephen's tip for OSX saved my day.

15 Oct 2012 Eduard

Eduard (view profile)

18 Jan 2012 Stephen

To get this to work on osx, you need to modify the matlab class to append '.local' to the hostname.

o.HostName = [cfg.hostname '.local'];

Comment only
26 Jan 2011 Alexandra

This is a great tool, but it seems to delete all my global variables which is a bit annoying.
Also, I am of the same opinion as Boris. It is a bit small and I cannot read the full title. A few size options would be nice.

02 Sep 2010 Luke

Luke (view profile)

This is a great little program. However, i also get problems for large loops:

??? No method 'createServer' with matching signature found for class 'ParforProgressMonitor'.

Error in ==> ParforProgMon>ParforProgMon.ParforProgMon at 48
o.JavaBit = ParforProgressMonitor.createServer( s, n );

Comment only
21 Jun 2010 Boris

Boris (view profile)

Thank you, very usefull!
I have a question though: is it possible to edit the progress bar in some way? In my case even the example won't fully display the word "example' in the upper bar.
It would be nice if the bar could adapt to what it should display or if the user could enter a length (character units?).

Best regards,

21 Sep 2009 Stefan

Stefan (view profile)

Thank you for your help, now it works.
However, for large values of N (~50000) my Matlab crashes No buffer space available (maximum connections reached?): connect
at Method)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at<init>(Unknown Source)
at<init>(Unknown Source)
at ParforProgressMonitor$ProgWorker.increment(

Best wishes,

Comment only
21 Sep 2009 Stefan

Stefan (view profile)

21 Sep 2009 Edric Ellis

Edric Ellis (view profile)

Hi Stefan,
Are you sure you've got the java code on the java path of the workers? I do something like this:
matlabpool local 3
addpath /path/to/stuff
pctRunOnAll javaaddpath /path/to/stuff


Comment only
16 Sep 2009 Stefan

Stefan (view profile)

Nice idea, however it does not work for me. It works fine without matlabpool. With matlabpool it gives the following error within the parfor loop:

??? Error using ==> parallel_function at 594
Error in ==>
ParforProgMon>ParforProgMon.increment at 66
Attempt to reference field of non-structure

Any ideas?

Kind regards,

Comment only
01 Sep 2016

Updated license

Contact us