Code covered by the BSD License  

Highlights from
PARFOR Progress Monitor

4.375

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

PARFOR Progress Monitor

by

 

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

| Watch this File

File Information
Description

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.

Acknowledgements

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  
24 Sep 2013 Arthur Dgn  
30 Aug 2013 Peter Li

@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?

29 Aug 2013 Peter Li

Thanks!

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 = java.net.Socket(o.HostName, 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.

29 Aug 2013 Peter Li  
06 Jun 2013 Marius

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

15 Oct 2012 Eduard  
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'];

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

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 );

21 Jun 2010 Boris

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,
Boris

21 Sep 2009 Stefan

Thank you for your help, now it works.
However, for large values of N (~50000) my Matlab crashes

java.net.SocketException: No buffer space available (maximum connections reached?): connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at ParforProgressMonitor$ProgWorker.increment(ParforProgressMonitor.java:30)

Best wishes,
Stefan

21 Sep 2009 Stefan  
21 Sep 2009 Edric Ellis

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

Cheers,
Edric.

16 Sep 2009 Stefan

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
array.

Any ideas?

Kind regards,
Stefan

Contact us