# How does the client send data to the workes, when calling parfor?

2 views (last 30 days)

Show older comments

Hi, let assume I want to use the parfor with my function (in this case, it just computes the routine without retrieving data from the workers, except for the last operation), i.e.:

parfor i=1:n

err = my_fnc(A,B,exp_pts(i));

end

where my_fnc is a time-expensive routine, exp_pts is a vector of n different numbers, A and B are always the same, very large matrices. I would know how the client transfers these data to all the available workers, that's to say: does it transfer data first to the worker 1, after to the worker 2, and so on? If it does, it means that, when working with very large (and dense) data, worker 1 starts working first and it could becomes idle when worker 2 is working, and so on.. (it's like an unbalanced load). Also, with matrices of this type, it's hard for the "true" operational time to overcome the time needed for the transfer of data, then the parfor is not so useful for these data. Do you agree? Thank you in advance.

##### 0 Comments

### Accepted Answer

Edric Ellis
on 20 Aug 2013

### More Answers (0)

### See Also

### Community Treasure Hunt

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

Start Hunting!