Documentation

labBarrier

Block execution until all workers reach this call

Syntax

labBarrier

Description

labBarrierblocks execution of a parallel algorithm until all workers have reached the call tolabBarrier. This is useful for coordinating access to shared resources such as file I/O.

Examples

Synchronize Workers for Timing

When timing code execution on the workers, uselabBarrierto ensure all workers are synchronized and start their timed work together.

labBarrier; tic A = rand(1,1e7,'codistributed'); distTime = toc;

Introduced before R2006a

Was this topic helpful?