Why is Matlab only using 9% of my CPU power?

Hi there!
I am running Matlab R2016b on a 3.5GHz Xeon processor and Win7 Enterprise 64 bit.
When it is "busy" with a calculation I only see a very small CPU usage. (It was 9%).
I want that to be more like 100%.
Thanks, Alex

11 Commenti

Why? With 100% CPU usage, you'll have to restart your computer as your OS freezes up. Is the code slow? Then you'll have to optimize the code, use parallel processing, etc. Use the profiler to figure out code bottleneck. https://www.mathworks.com/help/matlab/ref/profile.html
Not really. I run chess analysis on my home computer with the CPU pegged.
For the sake of argument let's say i want it to use 95% of the CPU power.
In any case, thanks for the link. I will check it out.
Alex
Are you in power saving mode by any chance? The OS can restrict CPU and slow things down.
Also, the fact it's 9% and not 95% could mean the bottleneck is in memory access and not CPU computation.
I'm not a power saving kind of guy ;)
All of my machines at home overclocked to the max, so I know all the tricks.
I wouldn't OC a work computer, and it probably isn't possible on a Xeon server anyway, but I did everything else including going into the registry to turn off CPU "parking", which can add a minuscule delay.
Matlab is using about 1 GB of ram to run these calculations and there are 29 GB free and another 29 GB on standby out of a total of 64 GB, so I can't imagine that this is caused by a memory bottleneck.
Interesting... I guess we'll wait to see what the profile result is.
Alexander MacFarlane IV
Alexander MacFarlane IV il 26 Lug 2018
Modificato: Image Analyst il 26 Lug 2018
Hi OCDER.
Thanks for sticking with me on this.
I have attached a screenshot of the profile.
Can you explain it to me?
All the profiler tells you is the relative amount of time which function(s) in your code are taking; it doesn't have any bearing on the overall CPU usage fraction.
How many cores does your machine take; ML isn't set up to take advantage of multiple cores by default I don't think so if it were 8 cores and the usage is on a total 9% would be something like 75-80% of one. That's mostly speculation, I'm not doing anything that takes long enough to worry about such any longer...
Hi Alexander,
what happens when you run 'bench' ?
It has 6 "real" cores, that show up as 12 with hyperthreading.
I own the parallel computing toolbox, but I think you have to specifically code for that in order to get it to work.
I think we can stop here and call my question answered, because if Matlab follows a single-threaded execution then the numbers I am seeing seem reasonable.
Thanks for helping out.
Alex
Alexander MacFarlane IV's "Answer" moved here:
Hello David.
I am leaving for home, but will run Bench tomorrow and report back here.
Thanks, Alex
1 core out of 12 pegged would show up as just over 8% used.

Accedi per commentare.

Risposte (1)

Hello Walter.
I believe that to be the correct answer.
A screenshot of the relevant bench result is attached for completeness.

Categorie

Scopri di più su Graphics Performance in Centro assistenza e File Exchange

Prodotti

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by