spmd for drange extremely slow
1 回表示 (過去 30 日間)
古いコメントを表示
i try to run spmd with a for drange loop even if i try the example from the mathlab documentation i'll take 1000x more than using a normal for loop
i'am using a Matlab 2010b May system is a Q9000 quad core 2x 2GHz using a matlabpool of 4 workers
spmd
PP = codistributed.zeros(6,8,12);
RR = rand(6,8,12,codistributor())
% Default distribution:
% by third dimension, evenly across 4 labs.
for ii = 1:6
for jj = 1:8
for kk = drange(1:12)
PP(ii,jj,kk) = RR(ii,jj,kk) + labindex;
end
end
end
end
most time takes the function SpmDControllerImpl (Java maethod)
why is it so extremely slow??
thanks Christoph
0 件のコメント
回答 (2 件)
Dmitry
2011 年 2 月 24 日
Hi, Cristoph!
To my mind, parallel compuing starts to make sense if the number of loop iterations is rather high (which is not the case -- you have "only" 576). You may want to perform a simple test by increasing the number of drange() iterations to, say, 1e4 or more if you have time. It is only my oppinion and, of course, you may have something constraining the speed in matlab settings.
Dmitry.
0 件のコメント
Jill Reese
2011 年 3 月 4 日
For this simple example there really is no need for the nested for loops. This documentation example provides a simple illustration of the drange concept, but it is not suggesting that drange is the best tool for this type of problem.
spmd
PP = codistributed.zeros(6,8,12);
RR = codistributed.rand(6,8,12);
PP = RR + labindex;
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Time-Frequency Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!