Parallel processing is not able to use all my cores

I have the same problem.
The SuperMicro MBD-H12DSI-N6-B motherboard has 2 x 48-core AMD EPYC 7K62 processors.
But MATLAB (R2024a) sees only one of them and opens a pool with 48 workers.
When multiplying and inverting matrices, the dual-processor system load is 50...65%.
The operating system is Microsoft Windows 10 Pro for Workstations 22H2.
The maxNumCompThreads command produces the following result:
>> N = maxNumCompThreads
N =
48
An attempt to set the maximum number of workers to 96 succeeds:
>> LASTN = maxNumCompThreads(96)
LASTN =
48
>> N = maxNumCompThreads
N =
96
But after that, a pool is opened with 48 workers as well:
>> parpool
Starting parallel pool (parpool) using the 'Processes' profile ...
Connected to parallel pool with 48 workers.
ans =
ProcessPool with properties:
Connected: true
NumWorkers: 48
However, I did not find in the settings where I can set the maximum number of workers.
The feature('numcores') command produces the following result:
>> feature('numcores')
MATLAB detected: 96 physical cores.
MATLAB detected: 96 logical cores.
MATLAB was assigned: 48 logical cores by the OS.
MATLAB is using: 48 logical cores.
MATLAB is not using all logical cores because Operating System restricted the number of cores to: 48.
ans =
48
That is, MATLAB complains about the Windows operating system
What to do?
Is it possible to run all 96 cores?

6 Comments

This feels to me like a problem where it is the OS which acts as the gatekeeper. That means MATLAB will not be able to override that constraint, and so you need to ask this question on a forum where you will find individuals who understand both the OS and the system it is running on.
You might get lucky after a while and find someone on Answers with the necessary knowledge, but any good, timely answer will most likely arise from a different source than Answers.
Google recommends setting the operating system to the maximum number of cores used. However, in the Windows settings (msconfig) only one processor is visible and a maximum of 48 cores can be set.
Why "Operating System restricted the number of cores to: 48" ???
How to lift this restriction?
Again, this is not a question about MATLAB in any way. You need to find someone who actually knows something about both the OS, and that processor configuration. And the place you will find that expertise is probably not MATLAB Answers.

Sign in to comment.

 Accepted Answer

This is tied to the way that older versions of Windows handled CPUs with more than 64 cores. Versions prior to 11 would create "processor groups" of up to 64 cores each, where "by default, an application is constrained to a single group".
EDIT:
After speaking with a colleague, you should be able to set NumWorkers in the Local/Processes profile to 96, save it, and MATLAB should then be able to use the entire pool. The maxNumCompThreads value is not directly related to process pools.
% Get a handle to the local profile
c = parcluster('Processes');
% Set worker count to 96
c.NumWorkers = 96;
% Save the profile
c.saveProfile;
% Start a local parallel pool with 96 workers
p = parpool('Processes', 96);

4 Comments

My understanding is that up through Windows 10, the assignment to processor groups was a fairly hard limit, involving the operating system using a 64 bit integer as a bit-map for which processors are grouped together.
I do not have any information about how the situation is handled in Windows 11.
Dear Damian!
Your solution worked!
Thank you very much!
You don't wear your "epaulettes" for nothing.
After running your commands:
c = parcluster('Processes')
c.NumWorkers = 96
c.saveProfile
p = parpool('Processes', 96);
parallel pool started with 96 cores:
p =
ProcessPool with properties:
Connected: true
NumWorkers: 96
Busy: false
Cluster: Processes (Local Cluster)
AttachedFiles: {}
AutoAddClientPath: true
FileStore: [1x1 parallel.FileStore]
ValueStore: [1x1 parallel.ValueStore]
IdleTimeout: 120 minutes (120 minutes remaining)
SpmdEnabled: true
After rebooting the computer, c.NumWorkers remained equal to 96:
c =
Local Cluster
Properties:
Profile: Processes
Modified: false
Host: desktop-e5o02cm
NumWorkers: 96
NumThreads: 1
JobStorageLocation: C:\Users\User\AppData\Roaming\MathWorks\MATLAB\local_cluster_jobs\R2024a
RequiresOnlineLicensing: false
PreferredPoolNumWorkers: 96
Associated Jobs:
Number Pending: 0
Number Queued: 0
Number Running: 1
Number Finished: 0
The only thing I added was to manually set maxNumCompThreads to 96, since it was still 48:
>> N = maxNumCompThreads
N =
48
LASTN = maxNumCompThreads(96)
LASTN =
48
>> N = maxNumCompThreads
N =
96
There are some caveats, though.
If I use user functions in the spmd loop, the dual-processor system load is 100% (screenshot 1). That is, all 96 cores are used. But if I use built-in MATLAB functions, such as matrix inversion (screenshot 2) or matrix multiplication and inverse division (screenshot 3), the dual-processor system load remains the same, at about 50%. That is, built-in MATLAB functions, as before, use only 1 processor.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2024a

Community Treasure Hunt

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

Start Hunting!