Smpd - Slower than Serial
古いコメントを表示
Hi everybody,
I am new to parallel computing. Therefore the solution to the problem might be easy.
I have a grid and I need to evaluate a function at each grid point. Therefore I wanted to assign some part of the grid to different workers in order to have speedup. However when I run the code in parallel I cannot see a difference in the computation time compared to serial computation. I also tested the case while changing the number of workers. In order to avoid overhead computations I run the code long enough. So what is my mistake?
My code is like this:
matlabpool ( 'open' , 4 )
Xpos = 10:0.1:25;
Ypos = 1:0.1:10;
n_x = length(Xpos);
n_y = length(Ypos);
spmd
i_x=codistributed(1:n_x);
i_y=codistributed(1:n_y);
end
tic;
for i_x = 1:n_x
for i_y = 1:n_y
output = myfunction(Xpos(i_x),Ypos(i_y));
end
end
Time=toc;
matlabpool('close')
2 件のコメント
Jill Reese
2013 年 5 月 8 日
What operations are you performing on the Xpos and Ypos variables within myfunction?
Jason Ross
2013 年 5 月 8 日
編集済み: Jason Ross
2013 年 5 月 8 日
Which scheduler are you using? (I assume "local")
How many compute cores (not hyperthreaded cores) does your machine have? (I assume 4)
How much RAM does your machine have? Do you use it all up and go to swap?
What is "long enough"? Seconds? Minutes? Hours? Days?
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!