Smpd - Slower than Serial
Mostra commenti meno recenti
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 Commenti
Jill Reese
il 8 Mag 2013
What operations are you performing on the Xpos and Ypos variables within myfunction?
Jason Ross
il 8 Mag 2013
Modificato: Jason Ross
il 8 Mag 2013
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?
Risposte (0)
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!