sequential block of code inside parallel section

조회 수: 12 (최근 30일)
Anastasios
Anastasios 2012년 10월 16일
Hello,
I am trying to do some operations inside a parallel section sequentially.
In every parallel framework that I have worked with, there is something like mutexes, semaphores, critical etc which allow you to do this.
Matlab lacks this features and a relevant submission that I found in the file exchange, which was also suggested by a mathworks engineer in another question, was full of persistent variables which could possibly lead to bugs.
Any ideas?
thanks
  댓글 수: 1
Sarah Wait Zaranek
Sarah Wait Zaranek 2012년 12월 27일
Anastasios - Which parallel construct are you using? Parfor, spmd?

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

답변 (1개)

Walter Roberson
Walter Roberson 2012년 12월 27일
spmd has some tools for this. See labbarrier and the lab send and receive functions.
Unfortunately mutexes over networks are difficult. See e.g., the discussion http://www.mathworks.com/matlabcentral/newsreader/view_thread/279510

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by