Can I have 8 workers on a quad-core processor?

1 回表示 (過去 30 日間)
Degang
Degang 2014 年 8 月 15 日
回答済み: Jill Reese 2014 年 8 月 15 日
I use PCT to create a "local cluster":
parallel.defaultClusterProfile('local');
c = parcluster();
and create and submit a job in the following way:
j=createJob(c);
createTask(j,...);
createTask(j,...);
...
submit(j);
This was done on a PC desktop with a i7 quad-core processor (Matlab2013b). I noticed that even after I created 20 tasks, after the job was submitted, only 4 workers were working simultaneously. Correct me if I'm wrong, I expect 8 workers working simultaneously. Can I have more than 4 workers working simultaneously?

採用された回答

Jill Reese
Jill Reese 2014 年 8 月 15 日
When determining the default size of the local cluster, MATLAB uses the number of true cores you have (hyperthreading is ignored). You can modify the size of the local cluster yourself.
1. On the Home tab, open the Parallel menu.
2. Choose "Manage Cluster Profiles...".
3. Select the local Cluster Profile and click the Edit button. At that point you can set the NumWorkers field to whatever you like (8 or even more).
It is generally best practice to have the same number of workers as true cores on your machine. Opening more workers than cores doesn't usually improve performance.

その他の回答 (1 件)

Matt J
Matt J 2014 年 8 月 15 日
Maybe, if you have hyperthreading enabled.
  1 件のコメント
Degang
Degang 2014 年 8 月 15 日
I guess hyperthreading has been enabled on my PC. The Ubuntu system monitor shows that there are 8 CPUs. Also, C++ program with openmp can use up to 78% CPU while a single Matlab worker can take only 12%.

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

カテゴリ

Help Center および File ExchangeCluster Configuration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by