When does it happens the data-copy, when executing a parallel job?

1 view (last 30 days)
Giovanni De Luca
Giovanni De Luca on 12 Dec 2013
Commented: Matt J on 13 Dec 2013
Hello,
when I call a function that I want to run in parallel (for example, inside a parfor statement), and this function receives some data as inputs, are these data copied to each (RAM-memory partition of the) worker just after calling the matlabpool open command, or each time, e.g., a parfor block is executed? Thank you in advance.

Accepted Answer

Matt J
Matt J on 12 Dec 2013
Edited: Matt J on 12 Dec 2013
Normally data copies are broadcast each time a parfor block is executed, but this FEX file offers a way to make data persist from one parfor block to subsequent ones,
  3 Comments
Matt J
Matt J on 13 Dec 2013
I think this function could be useful also for DISTRIBUTED-MEMORY LOCAL desktops, where each processor has its own RAM. What do you think about it?
I'm by no means an expert, but avoiding unnecessary rebroadcasting of data seems like it should be a good idea independently of the architecture.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!