sequential block of code inside parallel section

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 comentario

Anastasios - Which parallel construct are you using? Parfor, spmd?

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 27 de Dic. de 2012

0 votos

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

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 16 de Oct. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by