parallel processing fine balance

5 ビュー (過去 30 日間)
Raphael Alhadef
Raphael Alhadef 2020 年 4 月 16 日
コメント済み: Raphael Alhadef 2020 年 4 月 17 日
I am running a fairly straightforward loop on a single machine, and want to take advantage of parallel processing (parfor on heaps).
Each iteration of the loop is supposed to take about the same time.
I am splitting between each worker equally, but I am unsure on how to treat the remainer, and am unsure whether this even makes a diffence.
Let's assume I have 3 workers and 19 iterations. I could do 7,7,5 or 7,6,6. Theoretically, they are both limited by the slower worker (on average either one with 7 iterations), so it wouldn't seem like it makes much of a difference.
Any insight on this would be helpful - namely which approach should I use.
thanks!

採用された回答

Edric Ellis
Edric Ellis 2020 年 4 月 17 日
編集済み: Edric Ellis 2020 年 4 月 17 日
You're quite right that in this case, you're always inevitably going to be held up by the slowest worker. It's almost impossible to predict which of your two approaches would be faster - I'd suggest simply measuring the execution time for each case.
  1 件のコメント
Raphael Alhadef
Raphael Alhadef 2020 年 4 月 17 日
Thanks, I did some preliminary testing but got mixed results, and was wondering if there are best practices that could be applied to my case.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by