Can I avoid this broadcast variable?
古いコメントを表示
Hello,
I had two nested for loops that I would like to parallelise. It looked like this
for k = 1:size(S,2)
for j = 1:length(b)
fun(S(:,k),b(j));
end
end
Here S is large (10^5 x 10^2), and b is not large (1 x 10).
Since all of the loops are independent I found the following solution
parfor i = 1:size(S,2)*length(b)
k = ceil(i/length(b)); %S
j = i-(k-1)*length(b); %b
fun(S(:,k),b(j));
end
The problem is that S and b are broadcast variables.
Is there a way to eliminate S as a broadcast variable (b does not matter much)?
Thank you!
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Parallel Computing Fundamentals についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!