Parfor loop that was previously working perfectly hanging

6 ビュー (過去 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 Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by