How is memory allocated among parallel workers when using the SPMD setup in the MATLAB 2013b Parallel Toolbox

StackOverflow https://stackoverflow.com/questions/21940322

문제

I am currently running a series of experiments in parallel using the SPMD function in MATLAB 2013b and running into memory issues (here is a rough outline of the script).

I can design a way to avoid these issues, but need to understand how memory is allocated among the labs (workers/cores) when using this setup.

Specifically, I am wondering:

  1. Is there a way to assess the memory usage of variables that exist in the lab workspace?

  2. Is each lab allocated a fixed amount of memory beforehand? If so, how much? Otherwise, is it right to assume that each lab is granted as much memory as they require (so if I have 48 GB of RAM and 8 workers, it's possible that 1 lab uses up 24 GB and the remaining labs use 24 GB split evenly)

  3. Based on the above, what happens when a lab exceeds its allotted memory limit (assuming that it goes unresponsive but that the memory is free'd up). If each lab does not have a fixed memory limit, then what will happen to the lab who sends the "back-breaking" request (i.e. what happens to a lab who asks for 49 GB of memory on a system with 48 GB of total memory).

도움이 되었습니까?

해결책

  1. It's not trivial to work out how large the variables present in an SPMD block are because of the workspace transparency constraint - basically, you cannot call WHOS. More in the doc.
  2. No, the labs are simply mostly normal MATLAB processes. They do not have any pre-allocated memory, and acquire the necessary memory when you create variables.
  3. The labs can hit the normal MATLAB out-of-memory error.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top