Code covered by the BSD License  

Highlights from
PARFOR Progress Monitor

4.0

4.0 | 3 ratings Rate this file 21 Downloads (last 30 days) File Size: 7.94 KB File ID: #24594
image thumbnail

PARFOR Progress Monitor

by Edric Ellis

 

30 Jun 2009

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.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (8)
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

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.

21 Sep 2009 Stefan  
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 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

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

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.

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'];

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
parallel Edric Ellis 21 Sep 2009 04:30:40
parfor Edric Ellis 21 Sep 2009 04:30:40
parallel Federico 29 Jan 2010 11:58:05
parallel Ralf 09 Aug 2010 11:43:06
parfor roberto madia 25 Mar 2011 10:30:31

Contact us at files@mathworks.com