MATLAB Answers


Minimize MDCS Data Transfer

Asked by Philip
on 27 Oct 2014
Latest activity Commented on by Philip
on 31 Oct 2014
I am using MDCS on a Linux cluster. I repeatedly for a parfor loop in the following spirit:
parfor i=1:n
x(i) = a(i,:)*b;
Here the vector b is used on all cores, every time I call parfor. However, I believe each time I call parfor, b is being sent to all the cores, which slows down the code. How can I repeatedly use parfor with constant data such that I do not have to keep resending the same data each time I call a parfor loop? Thank you.


Sign in to comment.

1 Answer

Answer by Edric Ellis
on 29 Oct 2014
 Accepted Answer

You could use the Worker Object Wrapper which is designed for this sort of situation.

  1 Comment

on 31 Oct 2014
Thank you! This is exactly what I needed- it really sped up my code.

Sign in to comment.