processor use only 13% when excuting function/script

조회 수: 4 (최근 30일)
Jürgen
Jürgen 2012년 8월 14일
Hello,
I am calculating spread pattern of quite a large amount of projectiles. When I run the full model it take more than 1600 sec cpu time ( profiler info) This is actually quite long since I need to test a lot different setting.
I am using R2012a win 64 version and I have a 8GB ram with Intel® Core™i7QM CPU @2.2Ghz with window 7 professional.(HP Elitebook 8560w)
Now I don't know much about 'using different cores of the CPU' but I can see that there are 8 cores and the total CPU use does not exceed 12-13%, since 100%/8 is 13% it seems like only 1 core is used? Is that correct and if yes, can I do something to make all cores working? or any other action? It seems lile only 1/8 of my computer is used
thanks for any help regards,Jürgen

채택된 답변

Walter Roberson
Walter Roberson 2012년 8월 15일
Some call patterns, when operating on "large enough" data (size can depend on the exact pattern), will call LAPACK or BLAS to do the work. Both of those libraries are highly optimized and multithreaded even without the Parallel Processing Toolbox.
Call patterns that do not happen to match the ones handled by the libraries, or if the data is not "big enough", are handled single processor unless the Parallel Processing Toolbox is used (and parallel processing is requested.)
The Parallel Processing Toolbox allows explicit requests for parallelization; code (at some level!) has to be written specially to use it. There are several facilities in the PCT, to allow the code to be broken up in different ways. But MATLAB will not just "figure out for itself" which parallel processing to use: it has to be coded in. Sometimes the changes might be quite small, but sometimes the code changes might be extensive.
  댓글 수: 8
Walter Roberson
Walter Roberson 2012년 8월 17일
In such a case, you should be able to use parfor() or distributed arrays, I suspect.
Jürgen
Jürgen 2012년 8월 17일
okay thanks, I'll take a look at the price :-) but anyway for the coming period all except that I will have to wait while the programm is executing, one way I tried is to open a second time matlab and write new code and testing while the other application is do his thing.

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

추가 답변 (1개)

per isakson
per isakson 2012년 8월 15일
Basically, Matlab uses one core, which explains 12-13%. (Single threaded.)
Some Matlab functions use several cores.
Parallel Toolbox is needed to use all 8 cores.
  댓글 수: 3
Friedrich
Friedrich 2012년 8월 16일
No it isn’t. It’s the same.
Consider I am offer you:
a.) 10% of 100 dollar
b.) 25% of 40 dollar
Which one would you choose? It doesn’t matter because it’s the same(10 dollar in both cases)
It doesn’t matter if you use 25% of 4 Cores (which is basically one core) or if you use 12-13% of 8 cores (which is also one core)
If one would follow your logic, the best would be using 1 Core CPU because then you use 100% of your capacity. But thats not what you want.
Jürgen
Jürgen 2012년 8월 17일
interesting, okay that way you are right but I saw it different: I know have a quite new laptop with a good processor, let's say a 100 dollar processor to stay in your example, but I can use only 12.5% so 12.5 dollar is used, but my older computer with a 50 dollar processor and only dual core will use 50% or 25 dollar, I mean, habing a super processor that has only 1/8 use, can by less effective than a poor pr0cessor used on 50%, no??

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

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by