Borrar filtros
Borrar filtros

2 parfor loops and gathering/distributing cell array

1 visualización (últimos 30 días)
Siva
Siva el 18 de Jun. de 2015
I have a question about timing in the following minimal code. It appears that between the first and second parfor loops, time is spent gathering components of the cell array from the workers and then redistributing them to the workers. Is there any way to avoid this while still using parfor and not spmd/distributed arrays. Also, I need to do this in two stages with two parfor loops, I cannot do it with one parfor loop.
Kcell = cell(numNodes,1);
parfor n = 1:numNodes
Kcell{n} = rand(3,3*numNodes);
end
parfor n = 1:numNodes
Kcell{n}(:,1) = 1; % some other operation on Kcell{n}
end
K = cell2mat(Kcell);
% do something with K like a linear solve

Respuestas (0)

Categorías

Más información sobre Parallel for-Loops (parfor) en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by