Parfor hangs during execution

조회 수: 22 (최근 30일)
Andrea Stevanato
Andrea Stevanato 2018년 7월 13일
답변: DeepSea 2021년 8월 15일
How i can solve this problem that freeze parfor during execution?
Operation terminated by user during distcomp.remoteparfor/getCompleteIntervals (line 225)
In parallel_function>distributed_execution (line 823)
[tags, out] = P.getCompleteIntervals(chunkSize);
In parallel_function (line 590)
R = distributed_execution(...
  댓글 수: 11
Andrea Stevanato
Andrea Stevanato 2018년 7월 14일
I know what is deadlook but there aren't. My code works fine for first 10 iteration and after this hangs execution. Two days ago all works fine, yesterday no. Now I'm looking what are the situation for today.
Andrea Stevanato
Andrea Stevanato 2018년 7월 14일
I'm trying to install previous version of matlab, maybe 2017a/b. I am really disappointed of MATLAB's behavior

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

답변 (6개)

Muhammad Adil Raja
Muhammad Adil Raja 2019년 1월 27일
I am having this same issue for the last couple of days.

Gergely Papp
Gergely Papp 2019년 7월 2일
I have encountered the same issue, both with 2017/b and 2019/a. The calculations launch in the parallel workers, but along the way they hang 1-by-1. They would hang for days if I don't kill them manually.

Andrea Stevanato
Andrea Stevanato 2018년 7월 16일
It's possible to restart all workers without delete(gcp)?

Jayaram Theegala
Jayaram Theegala 2018년 7월 16일
편집: Jayaram Theegala 2018년 7월 16일
Hello Andrea,
In order to understand the issue better, can you try reducing the number of iterations on your first loop, by setting "it" variable used in your first "for" loop to 1. Also, it may be helpful to just start your pool with 1 worker, and see if the issue still persists.
If the issue continues to happen even after the above changes, provide the following information:
1) Brief information about the function used within the parfor loop: Algorithms.TeMA.evolution
2) Does the issue happen without the above function?
3) Finally, it is generally advisable for outer-most loop to be parfor and the inner loops being for loops. https://in.mathworks.com/help/distcomp/nested-parfor-loops-and-for-loops.html

Zachary Eilon
Zachary Eilon 2019년 6월 26일
I am having a similar problem. A simple demo code is shown below, which enters an infinite loop within the parfor. This is on a 2-core MacBook Pro with 3.3 GHz Intel i7 processor. Running Matlab R2017b, but the same code seems to cause problems on a machine running R2019a.
k = 1e10;
tic
for i = 1:k
tan(i);
end
toc
parpool(2);
tic
parfor i = 1:k
tan(i);
end
toc
  댓글 수: 2
lingyan yang
lingyan yang 2021년 1월 3일
is ther any updates I am encountering same issue with both matlab2019a and matlab 2020b. I am using particle swarm parallel setting, the optimization hangs in the middle of optimization, and won't continue untill i restart the system, very annoying
Nick
Nick 2021년 5월 25일
Same with me. Particle swarm function on Matlab 2020b in parallel macbook with 6 cores.

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


DeepSea
DeepSea 2021년 8월 15일
I've been stucked in this problem for couples of weeks, and fixed it by removing "continue" in an if-judgement and a for-loop.
for CondA
...
if CondB
continue; % Avoid using "continue"
end
...
end

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by