parallel computing: matlab only uses half the cores available. Help?

Hello,
I have a machine with 40 cores and I'm trying to use them all for a job. I have set the preferred number of workers to 40 in the Preferences, but I can see that matlab is only using 20 workers. Any suggestions about how to fix this? Thanks a lot
-L

댓글 수: 2

Does it have 40 actual cores or is it 20 with hyper-threading? I know next to nothing about hyper-threading, but I know my machine has 28 physical cores, but 56 show up in my task manager due to hyper threading. Matlab only uses the 28 though.
Mujahid Sultan
Mujahid Sultan 2017년 8월 13일
편집: Mujahid Sultan 2017년 8월 14일
I have the same issue, "nproc" shows 56 where as Matlab only uses 28 cpus, features('nucores') shows 28 cores. Interestingly the map-reduce function of Matlab uses all 56 cores and returns only results for 28. I am loosing half of my computations somewhere.

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

 채택된 답변

Kojiro Saito
Kojiro Saito 2016년 11월 2일

0 개 추천

On MATLAB,
  1. Go to Parallel Menu -> Manage Cluster Profiles
  2. Edit your cluster profile (name is 'local')
  3. Input 40 (the number of your cores) in "NumWorkers" column and click "Done"
Thanks

추가 답변 (1개)

Luis Hernandez
Luis Hernandez 2016년 11월 2일

0 개 추천

I'm afraid I already did what Kojiro suggested- it didn't work and that is why I'm asking on this forum.
@Adam: The machine has 40 actual cores.
thanks again.
-Luis

댓글 수: 5

Could you let us know how many cores does MATLAB detect?
Type the following command,
feature('numCores')
Luis Hernandez
Luis Hernandez 2016년 11월 3일
편집: Luis Hernandez 2016년 11월 3일
interesting clue ...
>> feature('numCores')
MATLAB detected: 20 physical cores.
MATLAB detected: 40 logical cores.
MATLAB was assigned: 40 logical cores by the OS.
MATLAB is using: 20 logical cores.
MATLAB is not using all logical cores because hyper-threading is enabled.
ans = 20 >>
Another interesting bit is that another user account on the same machine has no problem setting the nummer of workers to 40 and taking full advantage of the system. We've been comparing notes and I can't figure out what's different between our settings...
That looks exactly the same as my setup (albeit 28/56) which is odd if you do actually have 40 physical cores.
@Luis, could you provide me the version of your MATLAB?
Also, if you can figure out the difference between your settings, please let us know.
Thanks,
I thought I was having the same issue with MATLAB R2021a, but it turned out that I only actually have 6 physical cores, when I thought I had 12.
>> feature('numCores')
%
% MATLAB detected: 6 physical cores.
% MATLAB detected: 12 logical cores.
% MATLAB was assigned: 12 logical cores by the OS.
% MATLAB is using: 6 logical cores.
% MATLAB is not using all logical cores because hyper-threading is enabled.

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

카테고리

도움말 센터File Exchange에서 MATLAB Parallel Server에 대해 자세히 알아보기

질문:

2016년 11월 2일

편집:

2023년 3월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by