File Exchange

image thumbnail

matlab-ParforProgress2

version 1.16 (272 KB) by

A PARFOR progress monitor for Matlab GUIs and the command line (works with normal for-loops)

4 Downloads

Updated

This progress monitor comes with a nice wrapper `ParforProgressStarter2.m` which will take care of adding the classes to the java class path, depending on whether matlabpool is enabled or not.
For instructions on how to use with global variables, please see https://github.com/kotowicz/matlab-ParforProgress2#c2-with-globals
You can fork the code @ https://github.com/kotowicz/matlab-ParforProgress2

Comments and Ratings (21)

Mehmet Seker

is it possible to convert your gui into like this?http://image.prntscr.com/image/6553e7401ef74fc5b11c196b8a78ddec.jpg
ETA: elapsed time
RTA: remaining time

Thank you for your great code. I have a slider on my GUI. How can I use your code to update the slider progress in parfor loop?

Eduard

Eduard (view profile)

Elizabeth Jones

I have been using your parfor progress bar for a couple of years, and it's been working great. I recently upgraded from R2012b to R2014b, and I was so glad to see that you had already updated the progress bar! It made switching all my code to the newest version of Matlab so much easier. Thanks!

Rudi

Rudi (view profile)

Andreas, thanks for the update, seems to work. I now have another more difficult question: do you have any idea how I might use your code, or something similar, within a mexed parfor loop (mexed to C++ with OpenMP)? I tried using coder.extrinsic for your functions, but apparently calls to extrinsic functions inside mexed parfor loops are unsupported...

Andreas

Andreas (view profile)

@Rudi: please use version 0.2.7 with Matlab 2014a.

Rudi

Rudi (view profile)

I have used this great tool for some time but it appears to not work in 2014a with the following error. Works on same exact code in 2013b. Please update, this is the nicest parfor progress meter I have found!

Warning: While loading an object of class 'ParforProgress2': Undefined variable "ParforProgressClient2" or class "ParforProgressClient2.createClient".
Warning: The following error was caught while executing 'ParforProgress2' class destructor:
Attempt to reference field of non-structure array.
Error using ParforProgress2/increment (line 121)
Attempt to reference field of non-structure array.

Nice tool. But it clears my global variables !!

Jerome

Jerome (view profile)

@Andreas: Thanks for looking into this.
Are you sure it does not clear globals?
I see that you added a "server_class_loaded" boolean to make sure that javaaddpath is only called once but I discovered the clear global was due to the first call to javaaddpath.
Since you need to do that call, it seems like global will be cleared then, correct?

Andreas

Andreas (view profile)

@Jerome: please try the v0.2 release, which should appear shortly here and is also available on github:
https://github.com/kotowicz/matlab-ParforProgress2/archive/v0.2.zip

Jerome

Jerome (view profile)

Do you have any idea why this clear all global variables?
Without this waitbar my globals stay fine.

Adam

Adam (view profile)

Does anyone know why this progress monitor would conflict with the Matlab 2013 unit testing framework? I have a test covering a function that uses it - when I create the test instance on its own I can run it fine. When I run it within a test suite though it appears to run fine first time, but then if I run the tests a second time I get a segmentation dump when it tries to build the test suite (this does not happen if I remove the progress monitor). It also seems to work fine when used with the older xUnit framework from Matlab Central.

I like it in general though.

Jens

Jens (view profile)

Bart Boesman

Thanks for this file, works perfect!

Regards,

Bart

Eduard

Eduard (view profile)

FYI, I did the changes to ParforProgress2 myself and it actually works perfectly.

Only pit I fell into was compiling the Java code with JDK 7 instead of JDK 6 first, therefore not beeing compatible to MATLAB R20012a's integrated JRE 6.

Eduard

Eduard (view profile)

Hi Andreas,

two questions:

1 - Could you add a possibility to "break" the parfor-loop from within ParforProgress2? I was thinking about something quite simple like polling for the existence of a file at the start of the parfor-loop and just "continue" when it exists. The file could be created by ParforProgress2 as soon as the progress window is closed replacing the current warning message (or even add a cancel-button to it).
Probably you can come up with an even better solution yourself!

2 - It would be nice if the output "execution time was XXXs." would only be displayed if do_debug=1, so bascally no output at all is produced when do_debug=0.

Regards
Eduard

Matt Smith

Updates

1.16

Version 0.2.8 gives the user the option enable / disable the display of the execution time.

1.14

registered download link with GitHub

1.13

documentation update regarding usage of global variables.

1.12

added workaround and instructions for use with global variables. See https://github.com/kotowicz/matlab-ParforProgress2#c2-with-globals

1.10

Updated docs to reflect replacement of 'matlabpool' by 'parpool' in R2013b.

1.8

v0.2 Does not clear global variables anymore.

1.7

updated version fixes matlab 2013a problem.

1.6

ETA & running time update now works with parfor loops on the console.

1.5

show runtime & eta in console non-worker mode.
little fixes & improvements.

1.4

rewrite awt and java checks in 'ParforProgressStarter2'
basic support for non-GUI output in 'ParforProgressServer2.java':
 - works fine if matlabpool == 0
 - no output if matlabpool == 1

1.3

added missing functions.

1.1

more detailed description of program added.

MATLAB Release
MATLAB 7.6 (R2008a)

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

» Watch video