PARFOR progress monitor (progress bar) v4

버전 2.0.4 (53 KB) 작성자: Frerk Saxen
Progress monitor for matlab parfor (parallel) loops with estimation of the remaining time
다운로드 수: 3.3K
업데이트 날짜: 2019/9/5

A very ressource efficient Matlab class for progress monitoring during a `parfor` loop displaying the remaining time and optional progress of each worker.
It supports distributed worker pools (i.e. doesn't only work on local pools).

Usage:
% 'numIterations' is an integer with the total number of iterations in the loop.
% Feel free to increase this even higher and see other progress monitors fail.
numIterations = 100000;

% Then construct a ParforProgressbar object:
ppm = ParforProgressbar(numIterations);

parfor i = 1:numIterations
% do some parallel computation
pause(100/numIterations);
% increment counter to track progress
ppm.increment();
end

% Delete the progress handle when the parfor loop is done (otherwise the timer that keeps updating the progress might not stop).
delete(ppm);

Optional parameters:
ppm = ParforProgressbar(numIterations) constructs a ParforProgressbar object.
'numIterations' is an integer with the total number of
iterations in the parfor loop.

ppm = ParforProgressbar(___, 'showWorkerProgress', true) will display
the progress of all workers (default: false).

ppm = ParforProgressbar(___, 'progressBarUpdatePeriod', 1.5) will
update the progressbar every 1.5 second (default: 1.0 seconds).

ppm = ParforProgressbar(___, 'title', 'my fancy title') will
show 'my fancy title' on the progressbar.

ppm = ParforProgressbar(___, 'parpool', 'local') will
start the parallel pool (parpool) using the 'local' profile.

ppm = ParforProgressbar(___, 'parpool', {profilename, poolsize, Name, Value})
will start the parallel pool (parpool) using the profilename profile with
poolsize workers and any Name Value pair supported by function parpool.

Benefits:
1. It's the first parfor progress monitor that also displays the remaining time.
2. It's the first parfor progress monitor that also displays each workers progress.
3. It scales from very small number of iterations to arbitrarily high number of iterations with a very small footprint.

Drawbacks:
1. It does slow down the computation. How much? It depends on how often you update the progressbar (on default every 1.0 seconds - but this is a parameter you can adjust).
Updating the progressbar on my computer takes 40ms on average. i.e. one of the x workers updates the progressbar (by default every second) and spends an additional 40ms every second = 4%.
But you have x-1 workers that don't get delayed at all (calling increment has a neglegible effect even for millions of iterations).
2. It requires the Instrument Control Toolbox

Difference to 60135-parfor-progress-monitor-progress-bar-v3:
1. Using [progressbar](https://de.mathworks.com/matlabcentral/fileexchange/6922-progressbar) with it's nice drawing of the remaining time.
2. Complete matlab implementation, no Java.
3. Each increment, Dylan's java based implementation connects via tcp to the server and closes the connection immediately without sending any data.
The server increments the counter just based on an established connection.
This is quite fast but for very short loop cycles (like the above) it results in way too many connections.
The original ParforProgMonv3 solves this by letting the user choose a stepSize manually. However, this is combersome and non-intuitive.
This update calculates the stepsize automatically and thus maintains a very fast execution time even for very short loop cycles.
4. Instead of tcp socket we use a udp socket which is established on construction and not opened/closed at each loop cycle.
5. To track each worker progress, each worker sends its own progress to the server via udp.
6. Small interface changes: I don't really care about the window title of the progress bar. This is now an optional parameter and now also properly monitored by matlab's input parser.

인용 양식

Frerk Saxen (2024). PARFOR progress monitor (progress bar) v4 (https://github.com/fsaxen/ParforProgMon), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2018b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
2.0.4

1. Bugfix: If there is no additional progress, the progressbar is not updated.
2. There is no need to create a parpool object manually.
3. Each worker can now store temporary user data that will not be broadcasted between the workers.

2.0.3

Created with Matlab version 2018b

2.0.2

Requirement added: Instrument Control Toolbox

2.0.1

Just a typo and the image.

2.0.0

Not based on Dylan's Java implementation but on a full matlab implementation with udp sockets.

1.0.3

just the image!

1.0.2

- changed title and picture

1.0.1

connect to gitHub repository, update image

1.0.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.