Running two functions in parallel of which one would like to use parfor

2 ビュー (過去 30 日間)
Michael Krauß
Michael Krauß 2015 年 12 月 23 日
コメント済み: Mohammad Abouali 2015 年 12 月 23 日
Challenge: I repetitively read external data needing 250ms per data set. Then I process the data which takes 300ms on 20 phyical cores.
Now, it would of course be good to read data, and while the processing is in action, already read the next set. But, since I already use "parfor" in data processing, I cannot put both functions (reading and processing) in an smpd environment.
Ok, I think I know the long answer to this question: Put everything in smpd, send one of the workers in the data reading function and 20 of them to data processing and "rebuild" parfor functionality (means distribute loop indices and accumulate results on a master worker).
Maybe there is a shortcut I don't know? This problem should not be so unusual that there is no chance for an easy solution
Thanks,
Michael

採用された回答

Mohammad Abouali
Mohammad Abouali 2015 年 12 月 23 日
Use non-blocking parfeval().
  2 件のコメント
Michael Krauß
Michael Krauß 2015 年 12 月 23 日
Thank you!
Mohammad Abouali
Mohammad Abouali 2015 年 12 月 23 日
you are welcome

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel for-Loops (parfor) についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by