Matlab 2014a not using all logical cores

조회 수: 4 (최근 30일)
Arran
Arran 2014년 6월 11일
댓글: Titus Edelhofer 2014년 6월 12일
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!

답변 (2개)

Thomas Ibbotson
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
Arran
Arran 2014년 6월 11일
Hmm, so I would not see any/little difference in computational benchmarks?
Is there a benchmark I could run that would show a difference between Matlab using hyperthreading and no hyperthreading?
Thomas Ibbotson
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
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
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
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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by