When using parallel computing, why wait?

In the parallel computing toolbox, there is an option "wait", to suspend the local matlab session until the remote job is completed. This option is commonly used in examples. I have a basic confusion regarding this: does this defies the purpose of running job remotely, or in parallel? what would be the advantages of waiting?

 채택된 답변

Matt J
Matt J 2012년 9월 30일
편집: Matt J 2012년 9월 30일

0 개 추천

When coding, you often have a sequence of tasks, some of which are serial and some of which are parallelized. The parallelized tasks shouldn't pass their output forward to a serial task until all parallel workers have finished. Otherwise, they may pass forward partially processed data. Hence, you have wait commands to let all parallel workers catch up.
Does that make sense? Maybe I need to see the example you're thinking of.

댓글 수: 3

Moshe
Moshe 2012년 9월 30일
I am thinking mainly about sending (serial) batch jobs to a cluster, any reason for me to wait, anything I am missing?
Matt J
Matt J 2012년 9월 30일
It depends what you're doing after that. If whatever you're doing afterward relies on all batches being finished, then you should wait until all batches are finished.
Moshe
Moshe 2012년 9월 30일
Thanks, that makes sense.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Parallel Computing Toolbox에 대해 자세히 알아보기

질문:

2012년 9월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by