Block execution until all workers reach this call
labBarrier
labBarrier
blocks execution
of a parallel algorithm until all workers have reached the call to labBarrier
.
This is useful for coordinating access to shared resources such as
file I/O.
When timing code execution on the workers, use labBarrier
to
ensure all workers are synchronized and start their timed work together.
labBarrier;
tic
A = rand(1,1e7,'codistributed');
distTime = toc;