When to use spmd and parfor function.
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi. In what situations are those two functions best suited? What's the difference between them? I never know which one to use... Thanks!
댓글 수: 0
채택된 답변
Edric Ellis
2012년 8월 16일
Here's a very brief summary:
PARFOR is much simpler to use than SPMD, and should normally be your first choice when attempting to parallelize a collection of independent calculations. You need to be sure that your calculations are not order-dependent (i.e. they must not rely on the results of preceding calculations).
SPMD is somewhat harder to use, but allows communication between workers using labSend and labReceive. This is also the appropriate choice if you wish to implement new functionality for distributed arrays.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!