MATLAB Answers

Progress bar with parfor and nohup

조회 수: 9(최근 30일)
CaG
CaG 16 Jun 2020
답변: Edric Ellis 18 Jun 2020
I'd like to monitor the progress of a script making use of parfor. Unfortunately, since it requires a large amount of computational power and time, I have to launch it on a remote multiprocessor computer, using nohup.
As first attempt, I used fprintf in order to have an output from each of the parallel instances, i.e.
parfor i = 1:N
fprintf('Computing istance %i out of %i\n', i, N)
% Other code
end
and counting the occurences of the word "instance" in the nohup output file, using grep. However, since N is in the order of some hundreds of millions, the output file become huge and so I'd like to avoid it.
Then, I start trying some parfor progress bar I can find on MATLAB Central. However, most of them are made to use a graphic output and the few other ones have some drawbacks if used togheter with nohup (e.g. in the output file I found every single update of the progress bar, so again the output file will be huge).
How can I effectively monitor a parfor, while using nohup?

  댓글 수: 0

댓글을 달려면 로그인하십시오.

답변(1개)

Edric Ellis
Edric Ellis 18 Jun 2020
A really simple approach would be just to print out every 1000 iterations. In other words
parfor i = 1:N
if mod(i, 1000) == 0
fprintf('Computing istance %i out of %i\n', i, N);
end
% Other code
end

  댓글 수: 0

댓글을 달려면 로그인하십시오.

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by