Parfor loop that was previously working perfectly hanging
5 次查看(过去 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!