Parfor loop that was previously working perfectly hanging
6 ビュー (過去 30 日間)
古いコメントを表示
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
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
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!