I am using MDCS on a Linux cluster. I repeatedly for a parfor loop in the following spirit:
while
parfor i=1:n
x(i) = a(i,:)*b;
end
end
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.

 採用された回答

Edric Ellis
Edric Ellis 2014 年 10 月 29 日

0 投票

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

1 件のコメント

Philip
Philip 2014 年 10 月 31 日
Thank you! This is exactly what I needed- it really sped up my code.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Parallel Server についてさらに検索

質問済み:

2014 年 10 月 27 日

コメント済み:

2014 年 10 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by