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!