- Have no spmd block inside your function, or
- Call the function from outside the spmd block? You can still pass it the composite objects generated from your first spmd call, and have it access them correctly within the spmd block inside your function.
In a spmd statement ,How to call a function that contains another spmd statement.
조회 수: 1 (최근 30일)
이전 댓글 표시
I am sure that my PC can open at least 12 workers by using local profile. if I use another spmd statement in the function, the error is" Could not create an SPMD block to match the requested size: 2. The matlabpool size is: 0." Also I can not execute matlabpool open on the labs.
it seems like:
...
spmd
...
function
end
function()
spmd
...
end
end
댓글 수: 0
답변 (2개)
Richard Brown
2012년 7월 2일
편집: Richard Brown
2012년 7월 2일
It's because you're calling spmd within another spmd block (I'm not sure you can do this). Your initial spmd call will take up all of the labs from your pool. Perhaps what you actually want to do is either
댓글 수: 0
yu xu
2012년 7월 2일
댓글 수: 1
Richard Brown
2012년 7월 2일
Well there you go then :) If your outer spmd has, e.g., 2 labs then your inner one can request at most 5 (2 + 2*5 = 12)
참고 항목
카테고리
Help Center 및 File Exchange에서 Distributed Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!