Borrar filtros
Borrar filtros

parallelization extremely slow on i7

2 visualizaciones (últimos 30 días)
Christoph
Christoph el 2 de Mzo. de 2013
Good Morning/Afernoon/Evening depending where you are ;)
I am just checking out the parallelization features of ML (R2012b) and I don't really see any advantages so far, though I am only executing sample code to be honest.
I have 4 cores on an Intel Core i7 and I use 4 workers to run the simple magic-square sample code. A run takes approximately 40 seconds while simply looping it without parallel code takes about 0.24s .
Can someone briefly comment on the matlabpool features and traps, most likely I am just in a regime of work where parallelization is useless.
code 1
matlabpool(4)
spmd
q = magic(labindex + 2);
end
for ii=1:length(q)
figure, imagesc(q{ii});
end
matlabpool close
code 2
for i=1:1:4
q=magic(i+2);
figure, imagesc(q);
end

Respuestas (1)

Matt J
Matt J el 2 de Mzo. de 2013
Editada: Matt J el 2 de Mzo. de 2013
Where is this "sample" to be found? The computation looks way too small for parallelization to be fruitful. Try something like,
q = magic(labindex+2000);

Categorías

Más información sobre Parallel Computing Fundamentals en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by