Matlab 2014a not using all logical cores
3 次查看(过去 30 天)
显示 更早的评论
When looking at the number of cores used the following is produced:
feature('numcores')
MATLAB detected: 32 physical cores.
MATLAB detected: 64 logical cores.
MATLAB was assigned: 64 logical cores by the OS.
MATLAB is using: 32 logical cores.
MATLAB is not using all logical cores because hyper-threading is enabled.
ans =
32')
I have set the NumWorkers value in the Cluster Profile Manager to 64 and parallel preferences are 64 also. Can someone explain why only 32 logical cores are being used instead of all 64?
To clarify, the 64 cores represent 32 physical cores that are hyperthreaded.
Thanks!
0 个评论
回答(2 个)
Thomas Ibbotson
2014-6-11
See Edric's answer to another question about hyperthreading here: http://www.mathworks.com/matlabcentral/answers/80129#answer_89842
2 个评论
Thomas Ibbotson
2014-6-12
As the performance is dependent on the problem, I would recommend measuring the performance of your code using 32 workers, and 64 workers to see if hyperthreading provides any benefit in your case.
Titus Edelhofer
2014-6-11
Hi,
to clarify: "only 32 logical cores are being used" means you see in the task manager only 50% usage instead of the expected 100%? Have you checked that indeed 64 workers are started (64 MATLAB tasks while doing your computations)?
Titus
3 个评论
Thomas Ibbotson
2014-6-12
I think to answer your questions we need to be clear about how MATLAB is being multi-threaded. MATLAB even without PCT is multi-threaded for many of the core math functions, and by default it will only use the non-hyper-threaded cores, which is what that message is saying.
If you are using PCT workers however, each worker will use one core. So by starting 64 workers you are indeed using 64 cores. However, as we said before starting more workers than physical cores is unlikely to provide any benefit and may be detrimental to performance.
Titus Edelhofer
2014-6-12
Hi Arran,
if you are interested in measuring the performance you might play around with using the function maxNumCompThreads. As Thomas wrote, you need to distinguish between explicitly parallelizing (using the Parallel Computing Toolbox with N workers) or implicit parallelization due to multithreading. Here the default MATLAB uses (which in most cases give the best results, there are of course as always exceptions) number of threads = number of physical cores.
Titus
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!