Slow indexing into local parts of distributed cell arrays in parallel computing toolbox
Mostrar comentarios más antiguos
I have a code similar in structure to the following example:
p = 3;
N = p*10000;
if ~matlabpool('size'),matlabpool('open','local',p);end
spmd,
dist = codistributor('1d',1);
XX = codistributed.cell(N,1,dist);
g_indices = globalIndices(XX,1);
end
tic
spmd,
for k=drange(1:N),
% perform some work
XX(k,1) = {1};
end
end
toc
tic
spmd,
for k = g_indices,
% work
XX(k,1) = {1};
end
end
toc
on my computer i get the following output:
Elapsed time is 26.234271 seconds.
Elapsed time is 30.065625 seconds.
I am aware that there is significant overhead associated with spmd, and distributed arrays, but this performance is far worse than I personally expected. Am I doing this indexing wrong, or is there some reason why this is so slow? The reason I expected this to be faster is that I am only indexing the local parts of each array. (Unless I there is an error somewhere?)
I would greatly appreciate all input, or any suggestions on this.
Regards, Anders
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Dates and Time en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!