필터 지우기
필터 지우기

Parfor loop that was previously working perfectly hanging

조회 수: 7 (최근 30일)
Larissa Perez
Larissa Perez 2020년 10월 13일
댓글: Larissa Perez 2020년 10월 15일
Hi,
I am not very experienced using parallel programming and am having an issue with a parfor loop. I have been using a routine that was originally written by another researcher, made some tests with their input data and it was all working perfectly fine. Then I made some slight changes to the code, to adapt it to my needs and things were still working. I then made some extra changes and changed the input data and the code started hanging... Looking at RAM usage it seems to be fine. To try to pinpoint the issue, I went back to the initial code and it isn't running well anymore. Could be something to do with driver updates? Or any kind of updates in the computer? I'm using MATLAB 2018b.
If I manually kill the job, it appears to be freezing in line 227 of remoteparfor (see below).
I suspect the issue will be something silly but I can't see what it is. I appreciate any help!
  댓글 수: 2
Edric Ellis
Edric Ellis 2020년 10월 14일
That line is part of the internals of parfor, and is where the desktop MATLAB client session sits waiting for results coming back from your workers. I would recommend perhaps adding disp statements to your parfor loop to help you work out where your workers are getting up to. Or perhaps modify your code so that you force your parfor loop to run on your desktop MATLAB by doing this:
parfor (idx = 1:N, 0) % <-- the 0 means "run locally"
... % do stuff
end
Larissa Perez
Larissa Perez 2020년 10월 15일
Thanks!
I have tried that but still can't figure it out. Ends up I believe it's related to a while loop in one of the functions inside the parfor loop. The while loop includes a function to solve an equation using "eps", but it was never converging. By increasing the tolerance I believe it will run... Let's see...

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

답변 (0개)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by