Run-Time of Parfor becomes unbelievably lengthy sometimes
10 次查看(过去 30 天)
显示 更早的评论
I have run my program multiple times using Parfor with profiling in Matlab-R2018a and there is no run-time error of the program. In most of times, the run-time is around 3000 seconds with the majority of run-time spent in "java.util.concurrent.LinkedBlockingQueue(Java method)".
But sometimes, the run-time became unbelievably lengthy up to 44370 seconds while the majority of which is also spent in "java.util.concurrent.LinkedBlockingQueue(Java method)".
As I have read a relevant MATLAB Answer in https://uk.mathworks.com/matlabcentral/answers/41353-parfor-takes-a-lot-of-time-to-run, the item "java.util.concurrent.LinkedBlockingQueue(Java method)" in profiler does not give any clue about where the workers are spending time, hence I guess there might be some unexpected internal run-time behaviours of Parfor (parallel computing toolbox) in Matlab-R2018a that could happen sometimes depending on the state of device.
I got such guess based on the thread posted by Meng-Yuan Huang in https://groups.google.com/forum/#!topic/comp.soft-sys.matlab/HYqR91wiWyk to the above MATLAB Answer in the first hyperlink, where it said a specific strange behaviour of Parfor it had encountered in Matlab-R2016b was solved by restarting Matlab.
7 个评论
OCDER
2018-7-16
To resolve yours or Yijun's slow parfor issue, someone has to provide EVERY code required to recreate the stalling behavior. So if someone in the forum downloads the .m files (or zip file) and runs your main function, it should repeat exactly what you do right before the program stalls.
>> myMainFcn %your main function that'll replicate EXACTLY what you do to get it stall
We need something to work with other than pseudocodes. Even better is if you can provide a simple example script that still replicates the stalling problem without all the extra lines of codes.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!