Parallel computing out of memory

27 views (last 30 days)
Leon
Leon on 18 Sep 2018
Commented: Leon on 18 Sep 2018
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.
  2 Comments
OCDER
OCDER on 18 Sep 2018
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:
Leon
Leon on 18 Sep 2018
Thanks for the information!

Sign in to comment.

Answers (0)

Categories

Find more on Parallel for-Loops (parfor) in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!