How can I degug inside a parfor loop?
이전 댓글 표시
When I insert breakpoints inside a parfor loop it is never stopped. In this case how can I debug inside a parfor loop?
댓글 수: 2
KALYAN ACHARJYA
2017년 10월 26일
Please show your code, have you use break statement within parfor loop with a condition?
Check it out, it may be helpful
https://in.mathworks.com/matlabcentral/answers/4942-break-in-a-parfor-loop-processing-time-example-to-compare-it-with-a-for-loop
채택된 답변
추가 답변 (2개)
NAGAVARSHINI MAYAKKANNAN
2020년 6월 21일
1 개 추천
Change the parfor to for debug it and then change for to parfor
zhehao.nkd
2022년 8월 5일
For those who are seeking for the solution, there is another possible option by using parfor and try-catch:
parfor k = 1: len
try
% your code
catch ME
% record the iteration index,k
end
end
% Then youy know which iteration caused a bug alert
카테고리
도움말 센터 및 File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!