Parallel computing out of memory

10 visualizaciones (últimos 30 días)
Leon
Leon el 18 de Sept. de 2018
Movida: Edric Ellis el 11 de Ag. de 2025
I just started my trial of Parallel Computing Toolbox, unfortunately, with little success. Now I can see that my program is utilizing the full extent of my CPU (duo Core i7) and RAM (16 GB), but it keeps crashing on me for errors of "out of memory".
Why can't Parallel Computing automatically detect the capacity of my RAM and run it accordingly? How can I specify that parloop so that it will run at the limit of my computer but without crashing?
This is my first time to use Parallel Computing. Many thanks in advance for your help.
  1 comentario
Leon
Leon el 18 de Sept. de 2018
Thanks for the information!

Iniciar sesión para comentar.

Respuestas (1)

OCDER
OCDER el 18 de Sept. de 2018
Movida: Edric Ellis el 11 de Ag. de 2025
It's possible you have a lot of broadcast variables, which are sent to individual workers for processing despite being unused, and thus they take up memory. There could also be another issue with the code itself generating a large matrix. Does it work okay without parfor? Do you know where this memory error occurs in your code? If so, provide that code for us so we can help.
Data.A = rand(4000); %This becomes a broadcast variable
parfor j = 1:4000
Sum(j) = sum(Data.A(:, j)); %Data is sent to ALL workers, 2 extra copies
end
Data = rand(4000) %This becomes a sliced variable. Okay!
parfor j = 1:4000
Sum(j) = sum(Data(:, j)); %Okay! Only minimum data is sent to workers.
end
Read these:

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