Qustions about number of workers in parpool

53 ビュー (過去 30 日間)
Sandra Martinez
Sandra Martinez 2021 年 6 月 9 日
回答済み: Jason Ross 2021 年 6 月 9 日
I'm trying to extend the number of workers when using parpool (my computer has a total of 16 cores and 32 threads)
If I do:
parpool(17)
I recived an error message
If I change by;
myCluster = parcluster('local');
myCluster.NumWorkers=30;
myCluster.NumThreads=1;
parpool('local',30)
I can use now 30 workers. It is correct the way I'm changing the number of workers? Is there any danger doing in this form?

採用された回答

Jason Ross
Jason Ross 2021 年 6 月 9 日
The default for number of workers is set to the number of actual cores you have in the system, not threads. As you have found, it is overridable. This is one way to do it, the other ways are to set is as the default in Settings, or in the Local cluster profile.
Risks from doing this:
  • You are oversubscribing the number of actual compute cores in your machine. Each one of the extra workers is now consuming additional RAM, which still being bottlenecked by the number of compute cores for compute operations. So you may be consuming more resources than you really need to, and not getting any additional performance from doing so.
  • You may actually make performance worse if your system has to use things like virtual memory/swap to support the extra workers, which can slow down system performance overall.
The default was set as a default based on the anticipation that most operations people would be doing with MATLAB were math-heavy and using the compute cores, and threads were not of much use.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel Computing Fundamentals についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by