How to distinctly assign job and get the result of each worker using "parfor"?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
I'm using parallel computing toolbox in order to parallelize my computation. there is a need for assigning an identical job with different data to each worker and after the computation of workers is done, I need to distinctly get each woker's result in the client process and use each of them for another purpose. how can I do this?!
thanks
채택된 답변
Edric Ellis
2020년 5월 7일
This sounds more like a job for spmd . Read more about that here: https://www.mathworks.com/help/parallel-computing/spmd.html . Here's an extremely simple example:
spmd
myOutput = 2 * labindex; % labindex has a different value on each worker
end
myOutput{3} % gets the value from the 3rd worker
댓글 수: 4
추가 답변 (0개)
참고 항목
카테고리
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!