how many workers can I use in parallelization?

Hello, I am trying to use parallelization and I have one quick question.
I saw another post saying that 'I saw from another post saying that 'All releases newer than R2013b can utilize up to 512 workers (CPU cores) on a local machine through the Parallel Computing Toolbox'
However, I am not sure how many workers I can use with my computer.
I have 32 cores(64 logical cores) and 128 GB of memory.
Does this mean I can use 32 number of workers? or can I use 64 number of workers since I have 64 logical cores?
Or is 'number of workers' something independent from the number of cores?
In the Parallel preferences, I think I can write any number I want as a number of workers so I am bit confused....
Thanks in advance.
Edit. I put 36 as a number of workers in 'Parallel preferences' but when I run the code, it says the number of workers are 32. So I guess Matlab automatically choose the maximum number of workers....?

 採用された回答

Kojiro Saito
Kojiro Saito 2021 年 11 月 24 日

0 投票

You need to change the NumWokers property from Cluster Profile.
From "Parallel" -> "Create and Manage Clusters",
change the NumWorkers value to 64 because by default, it is the number of physical CPU cores.
Or, you can change from command line.
First, create a cluster object by parcluster, then change the NumWorkers to 64.
c = parcluster;
c.NumWorkers = 64;
% Do parpool or parfor etc.

1 件のコメント

Fabio
Fabio 2024 年 5 月 3 日
Thanks for the clear explanation. I hjave a follow up question. Lets say that when I launch my Matlab code 10/32 cores are already used by the program A. Matlab will distribute the calculations on the remaining 22 cores. After 1h the program A is closed. Will Matlab increase the number of cores to 32 to complete the calculation ?
Thanks in advance for your reply.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeParallel Computing Fundamentals についてさらに検索

質問済み:

2021 年 11 月 23 日

コメント済み:

2024 年 5 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by