<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170005</link>
    <title>MATLAB Central Newsreader - Multithreading not working?</title>
    <description>Feed for thread: Multithreading not working?</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>Tue, 27 May 2008 18:21:02 -0400</pubDate>
      <title>Multithreading not working?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170005#434335</link>
      <author>David Doria</author>
      <description>I just installed matlab 2008a and noticed under &quot;general&quot;&lt;br&gt;
properties &quot;automatic multithreading&quot; is enabled.  I have&lt;br&gt;
some code with some &quot;embarrassingly parallel&quot; for loops that&lt;br&gt;
takes hours to run.  I ran the code with this option enabled&lt;br&gt;
and there was no activity on more than 1 processor, infact&lt;br&gt;
the one processor is only at 20%.  Why would it not use the&lt;br&gt;
other processors?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
Dave</description>
    </item>
    <item>
      <pubDate>Tue, 27 May 2008 19:06:11 -0400</pubDate>
      <title>Re: Multithreading not working?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170005#434348</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g1hjee$k00$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
David Doria &amp;lt;daviddoria@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;I just installed matlab 2008a and noticed under &quot;general&quot;&lt;br&gt;
&amp;gt;properties &quot;automatic multithreading&quot; is enabled.  I have&lt;br&gt;
&amp;gt;some code with some &quot;embarrassingly parallel&quot; for loops that&lt;br&gt;
&amp;gt;takes hours to run.  I ran the code with this option enabled&lt;br&gt;
&amp;gt;and there was no activity on more than 1 processor, infact&lt;br&gt;
&amp;gt;the one processor is only at 20%.  Why would it not use the&lt;br&gt;
&amp;gt;other processors?&lt;br&gt;
&lt;br&gt;
The BLAS routines are multithreaded. If you do not happen to&lt;br&gt;
be doing something like \ or (e.g.) singular value decomposition,&lt;br&gt;
then whether Matlab will end up using the BLAS routines or not&lt;br&gt;
will depend on its success in figuring out that a given&lt;br&gt;
expression is can be fully or partially rewritten in terms to&lt;br&gt;
calls to BLAS routines -- and dependant upon Matlab figuring out&lt;br&gt;
that making such a call is worthwhile (there is considerable&lt;br&gt;
overhead to starting multithreading.)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;So you found your solution&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;What will be your last contribution?&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Supertramp (Fool's Overture)</description>
    </item>
    <item>
      <pubDate>Tue, 27 May 2008 19:20:03 -0400</pubDate>
      <title>Re: Multithreading not working?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170005#434350</link>
      <author>David Doria</author>
      <description>Correction to original post - one cpu is at 100%, i was&lt;br&gt;
reading the monitoring wrong, sorry.&lt;br&gt;
&lt;br&gt;
Oh, I thought this would act like openMP does in c++, just&lt;br&gt;
starting threads to &quot;parallelize&quot; a simple loop.  Is there&lt;br&gt;
no way to do this?</description>
    </item>
    <item>
      <pubDate>Tue, 27 May 2008 19:35:10 -0400</pubDate>
      <title>Re: Multithreading not working?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170005#434357</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g1hmt3$bvb$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
David Doria &amp;lt;daviddoria@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;Oh, I thought this would act like openMP does in c++, just&lt;br&gt;
&amp;gt;starting threads to &quot;parallelize&quot; a simple loop.  Is there&lt;br&gt;
&amp;gt;no way to do this?&lt;br&gt;
&lt;br&gt;
No, Matlab does not do that at present. It is my understanding,&lt;br&gt;
reading between the lines, that Mathworks is working on improving&lt;br&gt;
Matlab's ability to detect parallizable code.&lt;br&gt;
&lt;br&gt;
One of the toolboxes supports a 'parfor' instruction which can&lt;br&gt;
be used to specifically parallize sections.&lt;br&gt;
&lt;br&gt;
Other than that -- only to the extent that Matlab manages to figure&lt;br&gt;
out that your expression matches something in BLAS. I -have- seen&lt;br&gt;
Matlab convert some expressions into BLAS calls (I could tell by&lt;br&gt;
the timing)... I was a bit surprised at the sophistication that it&lt;br&gt;
already has in doing that, as the code I had written was not obviously&lt;br&gt;
BLAS-able.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;History is a pile of debris&quot;                     -- Laurie Anderson</description>
    </item>
  </channel>
</rss>

