Thread Subject: Force 100% CPU usage

Subject: Force 100% CPU usage

From: Richard Underwood

Date: 3 Jun, 2009 18:01:03

Message: 1 of 9

I have some engineers running batch files on Windows XP 32bit, but they are only taking up 25% of the Quad core processor. Is there a way to force MatLAB to use up 100% of the CPU?

Could this be a code problem within the batch files?

Subject: Force 100% CPU usage

From: Chaos

Date: 3 Jun, 2009 19:00:18

Message: 2 of 9

"Richard Underwood" <Richard.Underwood@hotmail.com> wrote in message <h06dov$egu$1@fred.mathworks.com>...
> I have some engineers running batch files on Windows XP 32bit, but they are only taking up 25% of the Quad core processor. Is there a way to force MatLAB to use up 100% of the CPU?
>
> Could this be a code problem within the batch files?

"engineers" who don't know how to parallel process? wtf?

"real" engineers don't need help in RTFM or parfor.

Subject: Force 100% CPU usage

From: Adam Chapman

Date: 3 Jun, 2009 19:50:08

Message: 3 of 9

On Jun 3, 8:00 pm, "Chaos" <rothko....@gmail.com> wrote:
> "Richard Underwood" <Richard.Underw...@hotmail.com> wrote in message <h06dov$eg...@fred.mathworks.com>...
> > I have some engineers running batch files on Windows XP 32bit, but they are only taking up 25% of the Quad core processor.  Is there a way to force MatLAB to use up 100% of the CPU?
>
> > Could this be a code problem within the batch files?
>
> "engineers" who don't know how to parallel process? wtf?
>
> "real" engineers don't need help in RTFM or parfor.

I think the problem is that you don't have a version of matlab
supporting multiple core , or you don't have the parallel computing
toolbox.

Subject: Force 100% CPU usage

From: Bobby Cheng

Date: 6 Jun, 2009 02:33:13

Message: 4 of 9

That depends on what your application is doing. I sincerely hope that
spinning the cores 100% is not the only goal here. I hope you just want the
MATLAB program runs faster.

Have you profile your code? Do you know where the bottle neck is?

If the bottleneck happens to be parallelizedable, or you expect it to be
able to be parallelized, please contact our supoort and let us know. These
are invaluable feedback we like to hear everyday.

Asking a general statement like your post makes this very difficult to give
any useful answer. Without knowing specific problems, I cannot say if the
problem would benefit from using multicore.

Do you have any particular set of functions in mind?

---Bob.

"Richard Underwood" <Richard.Underwood@hotmail.com> wrote in message
news:h06dov$egu$1@fred.mathworks.com...
>I have some engineers running batch files on Windows XP 32bit, but they are
>only taking up 25% of the Quad core processor. Is there a way to force
>MatLAB to use up 100% of the CPU?
>
> Could this be a code problem within the batch files?

Subject: Force 100% CPU usage

From: Drago Zarkovic

Date: 6 Jun, 2009 05:32:01

Message: 5 of 9

I also have a similar problem.

I have a program which does some iterations in two while loops and I have a double core processor and get 50% cpu usage. Profiler says that a loss of time is hapenning mostly on if statements... Program is extremely slow. Is this enough info?

Thank you

Subject: Force 100% CPU usage

From: John D'Errico

Date: 6 Jun, 2009 10:48:01

Message: 6 of 9

"Drago Zarkovic" <dragozarkovic@yahoo.com> wrote in message <h0cv0h$lmb$1@fred.mathworks.com>...
> I also have a similar problem.
>
> I have a program which does some iterations in two while loops and I have a double core processor and get 50% cpu usage. Profiler says that a loss of time is hapenning mostly on if statements... Program is extremely slow. Is this enough info?
>
> Thank you

These are branches. You will not be able to use both
processors for this.

What it means is that you ned to investigate whether
the use of the branches is appropriate. Very often
such heavily looped/branched code can be vectorized,
i.e., written in a way that does not involve the explicit
loops and branches. If so, then the speed will go up
dramatically.

Loops like this are often the result of coding as if you
were writing in C or Fortran. They might be correct in
the lower level language that you used in the past.
However they are often a poor choice for use in
MATLAB.

John

Subject: Force 100% CPU usage

From: Drago Zarkovic

Date: 6 Jun, 2009 15:27:01

Message: 7 of 9

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <h0dhh1$fne$1@fred.mathworks.com>...
> "Drago Zarkovic" <dragozarkovic@yahoo.com> wrote in message <h0cv0h$lmb$1@fred.mathworks.com>...
> > I also have a similar problem.
> >
> > I have a program which does some iterations in two while loops and I have a double core processor and get 50% cpu usage. Profiler says that a loss of time is hapenning mostly on if statements... Program is extremely slow. Is this enough info?
> >
> > Thank you
>
> These are branches. You will not be able to use both
> processors for this.
>
> What it means is that you ned to investigate whether
> the use of the branches is appropriate. Very often
> such heavily looped/branched code can be vectorized,
> i.e., written in a way that does not involve the explicit
> loops and branches. If so, then the speed will go up
> dramatically.
>
> Loops like this are often the result of coding as if you
> were writing in C or Fortran. They might be correct in
> the lower level language that you used in the past.
> However they are often a poor choice for use in
> MATLAB.
>
> John

Thank you for answer

But I have dicussed this on some other topic and we concluded that my code can't be vectorised. Is there some other solution?

Thanks

Subject: Force 100% CPU usage

From: Prashanth Kumar

Date: 3 Nov, 2009 18:36:02

Message: 8 of 9

"Bobby Cheng" <bcheng@mathworks.com> wrote in message <h0ckgo$1mn$1@fred.mathworks.com>...
> That depends on what your application is doing. I sincerely hope that
> spinning the cores 100% is not the only goal here. I hope you just want the
> MATLAB program runs faster.
>
> Have you profile your code? Do you know where the bottle neck is?
>
> If the bottleneck happens to be parallelizedable, or you expect it to be
> able to be parallelized, please contact our supoort and let us know. These
> are invaluable feedback we like to hear everyday.
>
> Asking a general statement like your post makes this very difficult to give
> any useful answer. Without knowing specific problems, I cannot say if the
> problem would benefit from using multicore.
>
> Do you have any particular set of functions in mind?
>
> ---Bob.
>
> "Richard Underwood" <Richard.Underwood@hotmail.com> wrote in message
> news:h06dov$egu$1@fred.mathworks.com...
> >I have some engineers running batch files on Windows XP 32bit, but they are
> >only taking up 25% of the Quad core processor. Is there a way to force
> >MatLAB to use up 100% of the CPU?
> >
> > Could this be a code problem within the batch files?
>

Dear Bobby Cheng,
I have the similar problem. I first invoked(on intel xeon quadcore processor) 'matlabpool 4' than it showed that it has connected to 4 labs on a default 'local' config. Than i run simple program where i used 'parfor' loop. But the cpu's are not utilized at their full strength. Only 50% to 60% of cpu strength has been utilized? Why's this so? Is this a problem of licenses? How can we get 100% cpu usage for faster computation.

Thank you
Prashanth

Subject: Force 100% CPU usage

From: Ashish Uthama

Date: 3 Nov, 2009 18:42:38

Message: 9 of 9

On Tue, 03 Nov 2009 13:36:02 -0500, Prashanth Kumar
<prashanth.chinta@gmail.com> wrote:

> "Bobby Cheng" <bcheng@mathworks.com> wrote in message
> <h0ckgo$1mn$1@fred.mathworks.com>...
>> That depends on what your application is doing. I sincerely hope that
>> spinning the cores 100% is not the only goal here. I hope you just want
>> the
>> MATLAB program runs faster.
>>
>> Have you profile your code? Do you know where the bottle neck is?
>>
>> If the bottleneck happens to be parallelizedable, or you expect it to be
>> able to be parallelized, please contact our supoort and let us know.
>> These
>> are invaluable feedback we like to hear everyday.
>>
>> Asking a general statement like your post makes this very difficult to
>> give
>> any useful answer. Without knowing specific problems, I cannot say if
>> the
>> problem would benefit from using multicore.
>>
>> Do you have any particular set of functions in mind?
>>
>> ---Bob.
>>
>> "Richard Underwood" <Richard.Underwood@hotmail.com> wrote in message
>> news:h06dov$egu$1@fred.mathworks.com...
>> >I have some engineers running batch files on Windows XP 32bit, but
>> they are
>> >only taking up 25% of the Quad core processor. Is there a way to force
>> >MatLAB to use up 100% of the CPU?
>> >
>> > Could this be a code problem within the batch files?
>>
>
> Dear Bobby Cheng,
> I have the similar problem. I first invoked(on intel xeon quadcore
> processor) 'matlabpool 4' than it showed that it has connected to 4 labs
> on a default 'local' config. Than i run simple program where i used
> 'parfor' loop. But the cpu's are not utilized at their full strength.
> Only 50% to 60% of cpu strength has been utilized? Why's this so? Is
> this a problem of licenses? How can we get 100% cpu usage for faster
> computation.
>
> Thank you
> Prashanth

Prashanth,

Maybe the code you are running is not CPU bound. Though you have four
process running, they might not each need 100% of the CPU computing power
at the same time. Quite a bit of time goes in IO and waiting on other
resources.

You could try using MicroSofts's 'process explorer' tool to study the CPU
utilization of each of your MATLAb worker individually. I have a feeling
you would notice that it doesnt need the amount of CPU power you are
expecting.

You could try increasing the number of Workers, you might see a better
utlization. BUT ..this might not correspond to a better overall
performance (there would be point of diminishing returns with increasing
workers dependent on machine configuration, memory, swap, the type of code
you are running,etc..etc)


Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
cpu usage Prashanth Kumar 3 Nov, 2009 13:39:05
parallel proces... Prashanth Kumar 3 Nov, 2009 13:39:05
clueless Chaos 3 Jun, 2009 15:04:05
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com