Parfor iterations and number of cores
8 ビュー (過去 30 日間)
古いコメントを表示
I am using parfor for the first time. I run a piece of code 'multiple' times and get an output y each time. Finally, I take average of all such y to get the avg_y. So, I decided to use parfor for the 'multiple' times.
My laptop is quad core and my question is that can't I run the parfor more than 4 times? As I want to run the parfor loop code 10 times and then average the y values....
0 件のコメント
採用された回答
Matt J
2021 年 11 月 8 日
編集済み: Matt J
2021 年 11 月 8 日
The number of loop iterations isn't limited by the number of cores you have. However, if you have 4 cores, the loop iterations cannot be split into more than 4 parallel groups. So, for example, if you have 40 loop iterations, each core must do 10 of them.
3 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Parallel for-Loops (parfor) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!