<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833</link>
    <title>MATLAB Central Newsreader - Force 100% CPU usage</title>
    <description>Feed for thread: Force 100% CPU usage</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 03 Jun 2009 18:01:03 -0400</pubDate>
      <title>Force 100% CPU usage</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833#654457</link>
      <author>Richard Underwood</author>
      <description>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?&lt;br&gt;
&lt;br&gt;
Could this be a code problem within the batch files?</description>
    </item>
    <item>
      <pubDate>Wed, 03 Jun 2009 19:00:18 -0400</pubDate>
      <title>Re: Force 100% CPU usage</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833#654472</link>
      <author>Chaos </author>
      <description>&quot;Richard Underwood&quot; &amp;lt;Richard.Underwood@hotmail.com&amp;gt; wrote in message &amp;lt;h06dov$egu$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; 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?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Could this be a code problem within the batch files?&lt;br&gt;
&lt;br&gt;
&quot;engineers&quot; who don't know how to parallel process? wtf? &lt;br&gt;
&lt;br&gt;
&quot;real&quot; engineers don't need help in RTFM or parfor.</description>
    </item>
    <item>
      <pubDate>Wed, 03 Jun 2009 19:50:08 -0400</pubDate>
      <title>Re: Force 100% CPU usage</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833#654490</link>
      <author>Adam Chapman</author>
      <description>On Jun 3, 8:00&#160;pm, &quot;Chaos&quot; &amp;lt;rothko....@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &quot;Richard Underwood&quot; &amp;lt;Richard.Underw...@hotmail.com&amp;gt; wrote in message &amp;lt;h06dov$eg...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have some engineers running batch files on Windows XP 32bit, but they are only taking up 25% of the Quad core processor. &#160;Is there a way to force MatLAB to use up 100% of the CPU?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Could this be a code problem within the batch files?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &quot;engineers&quot; who don't know how to parallel process? wtf?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &quot;real&quot; engineers don't need help in RTFM or parfor.&lt;br&gt;
&lt;br&gt;
I think the problem is that you don't have a version of matlab&lt;br&gt;
supporting multiple core ,  or you don't have the parallel computing&lt;br&gt;
toolbox.</description>
    </item>
    <item>
      <pubDate>Sat, 06 Jun 2009 02:33:13 -0400</pubDate>
      <title>Re: Force 100% CPU usage</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833#655000</link>
      <author>Bobby Cheng</author>
      <description>That depends on what your application is doing. I sincerely hope that &lt;br&gt;
spinning the cores 100% is not the only goal here. I hope you just want the &lt;br&gt;
MATLAB program runs faster.&lt;br&gt;
&lt;br&gt;
Have you profile your code? Do you know where the bottle neck is?&lt;br&gt;
&lt;br&gt;
If the bottleneck happens to be parallelizedable, or you expect it to be &lt;br&gt;
able to be parallelized, please contact our supoort and let us know. These &lt;br&gt;
are invaluable feedback we like to hear everyday.&lt;br&gt;
&lt;br&gt;
Asking a general statement like your post makes this very difficult to give &lt;br&gt;
any useful answer. Without knowing specific problems, I cannot say if the &lt;br&gt;
problem would benefit from using multicore.&lt;br&gt;
&lt;br&gt;
Do you have any particular set of functions in mind?&lt;br&gt;
&lt;br&gt;
---Bob.&lt;br&gt;
&lt;br&gt;
&quot;Richard Underwood&quot; &amp;lt;Richard.Underwood@hotmail.com&amp;gt; wrote in message &lt;br&gt;
news:h06dov$egu$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;I have some engineers running batch files on Windows XP 32bit, but they are &lt;br&gt;
&amp;gt;only taking up 25% of the Quad core processor.  Is there a way to force &lt;br&gt;
&amp;gt;MatLAB to use up 100% of the CPU?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Could this be a code problem within the batch files? </description>
    </item>
    <item>
      <pubDate>Sat, 06 Jun 2009 05:32:01 -0400</pubDate>
      <title>Re: Force 100% CPU usage</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833#655010</link>
      <author>Drago Zarkovic</author>
      <description>I also have a similar problem.&lt;br&gt;
&lt;br&gt;
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?&lt;br&gt;
&lt;br&gt;
Thank you</description>
    </item>
    <item>
      <pubDate>Sat, 06 Jun 2009 10:48:01 -0400</pubDate>
      <title>Re: Force 100% CPU usage</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833#655049</link>
      <author>John D'Errico</author>
      <description>&quot;Drago Zarkovic&quot; &amp;lt;dragozarkovic@yahoo.com&amp;gt; wrote in message &amp;lt;h0cv0h$lmb$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I also have a similar problem.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thank you&lt;br&gt;
&lt;br&gt;
These are branches. You will not be able to use both&lt;br&gt;
processors for this. &lt;br&gt;
&lt;br&gt;
What it means is that you ned to investigate whether&lt;br&gt;
the use of the branches is appropriate. Very often&lt;br&gt;
such heavily looped/branched code can be vectorized,&lt;br&gt;
i.e., written in a way that does not involve the explicit&lt;br&gt;
loops and branches. If so, then the speed will go up&lt;br&gt;
dramatically.&lt;br&gt;
&lt;br&gt;
Loops like this are often the result of coding as if you&lt;br&gt;
were writing in C or Fortran. They might be correct in&lt;br&gt;
the lower level language that you used in the past.&lt;br&gt;
However they are often a poor choice for use in&lt;br&gt;
MATLAB.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Sat, 06 Jun 2009 15:27:01 -0400</pubDate>
      <title>Re: Force 100% CPU usage</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833#655072</link>
      <author>Drago Zarkovic</author>
      <description>&quot;John D'Errico&quot; &amp;lt;woodchips@rochester.rr.com&amp;gt; wrote in message &amp;lt;h0dhh1$fne$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Drago Zarkovic&quot; &amp;lt;dragozarkovic@yahoo.com&amp;gt; wrote in message &amp;lt;h0cv0h$lmb$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I also have a similar problem.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 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?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thank you&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; These are branches. You will not be able to use both&lt;br&gt;
&amp;gt; processors for this. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What it means is that you ned to investigate whether&lt;br&gt;
&amp;gt; the use of the branches is appropriate. Very often&lt;br&gt;
&amp;gt; such heavily looped/branched code can be vectorized,&lt;br&gt;
&amp;gt; i.e., written in a way that does not involve the explicit&lt;br&gt;
&amp;gt; loops and branches. If so, then the speed will go up&lt;br&gt;
&amp;gt; dramatically.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Loops like this are often the result of coding as if you&lt;br&gt;
&amp;gt; were writing in C or Fortran. They might be correct in&lt;br&gt;
&amp;gt; the lower level language that you used in the past.&lt;br&gt;
&amp;gt; However they are often a poor choice for use in&lt;br&gt;
&amp;gt; MATLAB.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; John&lt;br&gt;
&lt;br&gt;
Thank you for answer&lt;br&gt;
&lt;br&gt;
But I have dicussed this on some other topic and we concluded that my code can't be vectorised. Is there some other solution?&lt;br&gt;
&lt;br&gt;
Thanks</description>
    </item>
    <item>
      <pubDate>Tue, 03 Nov 2009 18:36:02 -0500</pubDate>
      <title>Re: Force 100% CPU usage</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833#691796</link>
      <author>Prashanth Kumar </author>
      <description>&quot;Bobby Cheng&quot; &amp;lt;bcheng@mathworks.com&amp;gt; wrote in message &amp;lt;h0ckgo$1mn$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; That depends on what your application is doing. I sincerely hope that &lt;br&gt;
&amp;gt; spinning the cores 100% is not the only goal here. I hope you just want the &lt;br&gt;
&amp;gt; MATLAB program runs faster.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Have you profile your code? Do you know where the bottle neck is?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If the bottleneck happens to be parallelizedable, or you expect it to be &lt;br&gt;
&amp;gt; able to be parallelized, please contact our supoort and let us know. These &lt;br&gt;
&amp;gt; are invaluable feedback we like to hear everyday.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Asking a general statement like your post makes this very difficult to give &lt;br&gt;
&amp;gt; any useful answer. Without knowing specific problems, I cannot say if the &lt;br&gt;
&amp;gt; problem would benefit from using multicore.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Do you have any particular set of functions in mind?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ---Bob.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Richard Underwood&quot; &amp;lt;Richard.Underwood@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:h06dov$egu$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; &amp;gt;I have some engineers running batch files on Windows XP 32bit, but they are &lt;br&gt;
&amp;gt; &amp;gt;only taking up 25% of the Quad core processor.  Is there a way to force &lt;br&gt;
&amp;gt; &amp;gt;MatLAB to use up 100% of the CPU?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Could this be a code problem within the batch files? &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Dear Bobby Cheng,&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
Thank you &lt;br&gt;
Prashanth</description>
    </item>
    <item>
      <pubDate>Tue, 03 Nov 2009 18:42:38 -0500</pubDate>
      <title>Re: Force 100% CPU usage</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252833#691797</link>
      <author>Ashish Uthama</author>
      <description>On Tue, 03 Nov 2009 13:36:02 -0500, Prashanth Kumar   &lt;br&gt;
&amp;lt;prashanth.chinta@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; &quot;Bobby Cheng&quot; &amp;lt;bcheng@mathworks.com&amp;gt; wrote in message  &lt;br&gt;
&amp;gt; &amp;lt;h0ckgo$1mn$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; That depends on what your application is doing. I sincerely hope that&lt;br&gt;
&amp;gt;&amp;gt; spinning the cores 100% is not the only goal here. I hope you just want  &lt;br&gt;
&amp;gt;&amp;gt; the&lt;br&gt;
&amp;gt;&amp;gt; MATLAB program runs faster.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Have you profile your code? Do you know where the bottle neck is?&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; If the bottleneck happens to be parallelizedable, or you expect it to be&lt;br&gt;
&amp;gt;&amp;gt; able to be parallelized, please contact our supoort and let us know.  &lt;br&gt;
&amp;gt;&amp;gt; These&lt;br&gt;
&amp;gt;&amp;gt; are invaluable feedback we like to hear everyday.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Asking a general statement like your post makes this very difficult to  &lt;br&gt;
&amp;gt;&amp;gt; give&lt;br&gt;
&amp;gt;&amp;gt; any useful answer. Without knowing specific problems, I cannot say if  &lt;br&gt;
&amp;gt;&amp;gt; the&lt;br&gt;
&amp;gt;&amp;gt; problem would benefit from using multicore.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Do you have any particular set of functions in mind?&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; ---Bob.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &quot;Richard Underwood&quot; &amp;lt;Richard.Underwood@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt;&amp;gt; news:h06dov$egu$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;I have some engineers running batch files on Windows XP 32bit, but  &lt;br&gt;
&amp;gt;&amp;gt; they are&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;only taking up 25% of the Quad core processor.  Is there a way to force&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;MatLAB to use up 100% of the CPU?&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Could this be a code problem within the batch files?&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Dear Bobby Cheng,&lt;br&gt;
&amp;gt; I have the similar problem. I first invoked(on intel  xeon quadcore  &lt;br&gt;
&amp;gt; processor) 'matlabpool 4' than it showed that it has connected to 4 labs  &lt;br&gt;
&amp;gt; on a default 'local' config. Than i run simple program where i used  &lt;br&gt;
&amp;gt; 'parfor' loop. But the cpu's are not utilized at their full strength.  &lt;br&gt;
&amp;gt; Only 50% to 60% of cpu strength has been utilized? Why's this so? Is  &lt;br&gt;
&amp;gt; this a problem of licenses? How can we get 100% cpu usage for faster  &lt;br&gt;
&amp;gt; computation.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thank you&lt;br&gt;
&amp;gt; Prashanth&lt;br&gt;
&lt;br&gt;
Prashanth,&lt;br&gt;
&lt;br&gt;
Maybe the code you are running is not CPU bound. Though you have four  &lt;br&gt;
process running, they might not each need 100% of the CPU computing power  &lt;br&gt;
at the same time. Quite a bit of time goes in IO and waiting on other  &lt;br&gt;
resources.&lt;br&gt;
&lt;br&gt;
You could try using MicroSofts's 'process explorer' tool to study the CPU  &lt;br&gt;
utilization of each of your MATLAb worker individually. I have a feeling  &lt;br&gt;
you would notice that it doesnt need the amount of CPU power you are  &lt;br&gt;
expecting.&lt;br&gt;
&lt;br&gt;
You could try increasing the number of Workers, you might see a better  &lt;br&gt;
utlization. BUT ..this might not correspond to a better overall  &lt;br&gt;
performance (there would be point of diminishing returns with increasing  &lt;br&gt;
workers dependent on machine configuration, memory, swap, the type of code  &lt;br&gt;
you are running,etc..etc)</description>
    </item>
  </channel>
</rss>

