Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Force 100% CPU usage

295 views
Skip to first unread message

Richard Underwood

unread,
Jun 3, 2009, 2:01:03 PM6/3/09
to
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?

Chaos

unread,
Jun 3, 2009, 3:00:18 PM6/3/09
to
"Richard Underwood" <Richard....@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.

Adam Chapman

unread,
Jun 3, 2009, 3:50:08 PM6/3/09
to
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.

Bobby Cheng

unread,
Jun 5, 2009, 10:33:13 PM6/5/09
to
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....@hotmail.com> wrote in message

news:h06dov$egu$1...@fred.mathworks.com...

Drago Zarkovic

unread,
Jun 6, 2009, 1:32:01 AM6/6/09
to
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

John D'Errico

unread,
Jun 6, 2009, 6:48:01 AM6/6/09
to
"Drago Zarkovic" <dragoz...@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

Drago Zarkovic

unread,
Jun 6, 2009, 11:27:01 AM6/6/09
to
"John D'Errico" <wood...@rochester.rr.com> wrote in message <h0dhh1$fne$1...@fred.mathworks.com>...

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

Prashanth Kumar

unread,
Nov 3, 2009, 1:36:02 PM11/3/09
to
"Bobby Cheng" <bch...@mathworks.com> wrote in message <h0ckgo$1mn$1...@fred.mathworks.com>...

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

Ashish Uthama

unread,
Nov 3, 2009, 1:42:38 PM11/3/09
to

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)

cuddlyca...@gmail.com

unread,
Oct 27, 2013, 1:35:37 PM10/27/13
to
If you are using a quad core cpu you have four cores, and if the batch files you are running are all on the same thread then they are all running on the same core an the other three are unaffected. My suggestion is, open four batch files, go to task manager (ctrl+shift+esc) go to processes tab find the four cmd.exe processes, then right click and click affinity, give each processes a different core.
0 new messages