필터 지우기
필터 지우기

MATLAB2020b Parallel Computing Number of Workers

조회 수: 39 (최근 30일)
Wenjie Wu
Wenjie Wu 2020년 10월 16일
댓글: Walter Roberson 2020년 10월 19일
Hi,
My CPU is Ryzen 3600x 6 Core / 12 Threads, Win10 1909
I used to be able to use 12 workers with 2020a.
All 12 logical processor (i.e. threads) in task manager can acheieve nearlly 100% usage
maxNumCompThreads returns 12.
Now I installed 2020b
maxNumCompThreads returns 6. and same code only run with 6 workders.
The task manager has oddly 7 logical processor at nearly 100% usage and the rest 5 sits at near idle (15% ish).
I don't remember exactally the time of the previous run with 2020a (and I already uninstalled it), but seems to be faster than 2020b.
Could anyone have any suggestion? maybe ways to force 12 threads as a comparasion?
Thanks!
  댓글 수: 6
Wenjie Wu
Wenjie Wu 2020년 10월 19일
Hi Gian,
Thanks for confirming that.
Walter Roberson
Walter Roberson 2020년 10월 19일
With elapsed time that low, you are spending most of your time setting up the workers and communicating data back and forth.

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

답변 (1개)

Walter Roberson
Walter Roberson 2020년 10월 17일
Hyperthreading does not provide additional computation capacity.
What hyperthreading is, is some extra state registers that permit fast switching of process context, instead of the operating system having to specifically go in and save state and load the old state. It makes better use of resources, keeping the CPUs more evenly loaded, less time switching tasks.
However, hyperthreading is not pre-emptive and not scheduled. As far as the technology itself is concerned, hyperthreading is ready to go when a thread voluntarily gives up control of a core, such as if the thread needs to wait for a resource to become available (read from disk), or wait for user interaction.
In the case of heavy mathematical calculations, MATLAB is not voluntarily giving up the core -- so hyperthreading kicks in during the phase where MATLAB is transfering data into a worker thread, and during the phase where MATLAB is transfering results out of the worker thread... and nothing in-between.
Meanwhile, the heat budget of CPUs is based in part around the assumption that cores will be given up to wait for events, giving a bit of time for the cores to cool. When hyperthreading is in effect and there are active threads waiting, then those pauses with cooling do not occur (as much), so the cores do not cool as much. In order to account for that, cores will down-clock when they are using hyperthreading actively.
Putting this all together: using hyperthreading for active mathematical calculation can slow the calculations down instead of speeding them up.
But anyhow... You can control the maximum number of threads by editing your cluster profile. The default maximum is the number of cores, so you would have had to have changed it before, and possibly when you installed R2020b that cluster profile did not get copied from your R2020a directories.
  댓글 수: 2
Wenjie Wu
Wenjie Wu 2020년 10월 18일
편집: Wenjie Wu 2020년 10월 18일
Thanks for the detailed explanation.
I am aware some of that.
My CPU has water cooling, so thermal is gereally good.
My code is doing imaging processing, so it is highy scalable with parallel.
I included my performace testing in the ablove reply to Raymond
Walter Roberson
Walter Roberson 2020년 10월 18일
편집: Walter Roberson 2020년 10월 19일
edit the cluster profile
You did not include performance measurements in your reply to Raymond.
Your original post about 7 logical cores does not show that the physical cores are being underused. You would need to time with both cases, one worker per physical core and one worker per logical core.

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

카테고리

Help CenterFile Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by