rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
Functions
parfor_progress.m File Reference

PARFOR_PROGRESS Progress monitor (progress bar) that works with parfor. PARFOR_PROGRESS works by creating a file called parfor_progress.txt in your working directory, and then keeping track of the parfor loop's progress within that file. This workaround is necessary because parfor workers cannot communicate with one another so there is no simple way to know which iterations have finished and which haven't. More...

Go to the source code of this file.

Functions

function
percent = 
parfor_progress (N)
 PARFOR_PROGRESS Progress monitor (progress bar) that works with parfor. PARFOR_PROGRESS works by creating a file called parfor_progress.txt in your working directory, and then keeping track of the parfor loop's progress within that file. This workaround is necessary because parfor workers cannot communicate with one another so there is no simple way to know which iterations have finished and which haven't. More...
 

Detailed Description

PARFOR_PROGRESS Progress monitor (progress bar) that works with parfor. PARFOR_PROGRESS works by creating a file called parfor_progress.txt in your working directory, and then keeping track of the parfor loop's progress within that file. This workaround is necessary because parfor workers cannot communicate with one another so there is no simple way to know which iterations have finished and which haven't.

Definition in file parfor_progress.m.

Function Documentation

function percent = parfor_progress (   N)

PARFOR_PROGRESS Progress monitor (progress bar) that works with parfor. PARFOR_PROGRESS works by creating a file called parfor_progress.txt in your working directory, and then keeping track of the parfor loop's progress within that file. This workaround is necessary because parfor workers cannot communicate with one another so there is no simple way to know which iterations have finished and which haven't.

PARFOR_PROGRESS(N) initializes the progress monitor for a set of N upcoming calculations.

PARFOR_PROGRESS updates the progress inside your parfor loop and displays an updated progress bar.

PARFOR_PROGRESS(0) deletes parfor_progress.txt and finalizes progress bar.

To suppress output from any of these functions, just ask for a return variable from the function calls, like PERCENT = PARFOR_PROGRESS which returns the percentage of completion.

Example
  N = 100;
  parfor_progress(N);
  parfor i=1:N
     pause(rand); % Replace with real code
     parfor_progress;
  end
  parfor_progress(0);
See also
PARFOR.
Parameters
NN
Return values
percentpercent

Definition at line 17 of file parfor_progress.m.

Here is the caller graph for this function: