Missing function outputs in some iterations inside parfor
이전 댓글 표시
I have a function which is invoked in a parfor loop. The function in turn calls a couple more functions and outputs structure fields. However, I do not get all my results, although my simulation runs correctly.
parfor i = 1:900
for j = 1:3600
[x(i,j),y(i,j).y,y(i,j).z] = func(a,b,c,d);
end
end
Here, x,y,z,a,b,c,d are a mix of structures and matrices. So lets assume x is an array. I get correct results in x which tells me that my function runs fine. But a few entries in y (which is a structure) are missing. The missing entries are different at different execution of the same program. Eg: all the columns from row 29 to 41 in y have no entries, but x has the corresponding entries.
What could be the cause? This is my first experience with parallel programming. So any help is appreciated!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!