<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Controlling Multithreading</title>
	<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/</link>
	<description>Loren Shure  works on design of the MATLAB language at &#60;a href="http://www.mathworks.com/"&#62;The MathWorks&#60;/a&#62;. She writes here about once a week on MATLAB programming and related topics. &#60;br&#62;&#60;br&#62;&#60;a href="/images/loren-full.jpg"&#62;&#60;img src="/images/loren.jpg"&#62;&#60;/a&#62;</description>
	<pubDate>Sun, 22 Nov 2009 23:07:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Bernd</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-30003</link>
		<dc:creator>Bernd</dc:creator>
		<pubDate>Fri, 30 Jan 2009 09:46:42 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-30003</guid>
		<description>Loren, Tom-

You can set maxNumCompThreads(1); in toolbox/local/matlabrc.m, thus overwriting any user setting. 
You can do this in 2 ways:

a) add the line before the section where user preferences are checked.  In this way the preferences of the users are still repected, but the internal default behavior is overwritten.

b) add the line after the section.  In this way you overwrite both the user settings and the internal setting, and you force your users to activate multi-threading explicitly in every session.  That's how we do it here.

The new default, i.e. automatic multi-threading, plus the problem with the Java garbage collector threads (1 per core) can turn Matlab into a DoS tool on our big SMPs, with 96-144 cores!

-Bernd</description>
		<content:encoded><![CDATA[<p>Loren, Tom-</p>
<p>You can set maxNumCompThreads(1); in toolbox/local/matlabrc.m, thus overwriting any user setting.<br />
You can do this in 2 ways:</p>
<p>a) add the line before the section where user preferences are checked.  In this way the preferences of the users are still repected, but the internal default behavior is overwritten.</p>
<p>b) add the line after the section.  In this way you overwrite both the user settings and the internal setting, and you force your users to activate multi-threading explicitly in every session.  That&#8217;s how we do it here.</p>
<p>The new default, i.e. automatic multi-threading, plus the problem with the Java garbage collector threads (1 per core) can turn Matlab into a DoS tool on our big SMPs, with 96-144 cores!</p>
<p>-Bernd</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29992</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 28 Jan 2009 13:03:20 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29992</guid>
		<description>Tom-

There is no such control over multithreading.

--Loren</description>
		<content:encoded><![CDATA[<p>Tom-</p>
<p>There is no such control over multithreading.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Crockett</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29987</link>
		<dc:creator>Tom Crockett</dc:creator>
		<pubDate>Tue, 27 Jan 2009 22:36:06 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29987</guid>
		<description>Automatic multithreading is great when you're running on a multicore workstation (i.e., dedicated to a single user), but what about the situation when multiple users are sharing a multiprocessor system?  The problem we're running into is that the available processors are being oversubscribed, resulting in lost performance due to OS scheduling overheads, cache pollution, memory contention, etc.

Is there some way to change the multithreading default at a system-wide level from "automatic" to "manual" so that we (the system administrators) can keep the aggregate thread count to something manageable?</description>
		<content:encoded><![CDATA[<p>Automatic multithreading is great when you&#8217;re running on a multicore workstation (i.e., dedicated to a single user), but what about the situation when multiple users are sharing a multiprocessor system?  The problem we&#8217;re running into is that the available processors are being oversubscribed, resulting in lost performance due to OS scheduling overheads, cache pollution, memory contention, etc.</p>
<p>Is there some way to change the multithreading default at a system-wide level from &#8220;automatic&#8221; to &#8220;manual&#8221; so that we (the system administrators) can keep the aggregate thread count to something manageable?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29727</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 27 Aug 2008 12:57:27 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29727</guid>
		<description>Uvernes-

For a start, MATLAB wasn't using multi-threaded BLAS in version 5.3.  That has come much more recently.

You probably should contact technical support as your issue warrants more attention than I can give it here.

--Loren</description>
		<content:encoded><![CDATA[<p>Uvernes-</p>
<p>For a start, MATLAB wasn&#8217;t using multi-threaded BLAS in version 5.3.  That has come much more recently.</p>
<p>You probably should contact technical support as your issue warrants more attention than I can give it here.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uvernes Somarriba</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29725</link>
		<dc:creator>Uvernes Somarriba</dc:creator>
		<pubDate>Tue, 26 Aug 2008 15:27:43 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29725</guid>
		<description>I’m running a home made application using Agilent VEE Pro 8.5 with has embeded Matlab 2007a.  When the application  reach a Matlab script (show below)  it slow down (average 9 loops per second) .  I’ve been monitoring the processor with Task Manager (Windows Vista Ultimate 32 bits, HP Pavilion a1710n with ADM Athlon 64 X2 Dual Core Processor 4200+ 2.20 GHz) and I can see that only one of the core is working.  I run the same application using Agilent VEE Pro 6.0 with has embeded Matlab 5.3 on an MS Windows XP PC without dual core and the performace is a lot higher (average 700 loops per second). I’ve try to find information about how to programatically active multithreading with the embeded version of matlab but I could not find any information.  But even, only with one core working, the has decrease considerable.  Could you help me to solve this problem?  What can I do to reach the desired performance (same as with XP)?
ZI = 0:1:C;
W = polifit(A,B,4);
Vout = polycal (W, ZI);
Z1 = ZI

Thanks,
Uvernes</description>
		<content:encoded><![CDATA[<p>I’m running a home made application using Agilent VEE Pro 8.5 with has embeded Matlab 2007a.  When the application  reach a Matlab script (show below)  it slow down (average 9 loops per second) .  I’ve been monitoring the processor with Task Manager (Windows Vista Ultimate 32 bits, HP Pavilion a1710n with ADM Athlon 64 X2 Dual Core Processor 4200+ 2.20 GHz) and I can see that only one of the core is working.  I run the same application using Agilent VEE Pro 6.0 with has embeded Matlab 5.3 on an MS Windows XP PC without dual core and the performace is a lot higher (average 700 loops per second). I’ve try to find information about how to programatically active multithreading with the embeded version of matlab but I could not find any information.  But even, only with one core working, the has decrease considerable.  Could you help me to solve this problem?  What can I do to reach the desired performance (same as with XP)?<br />
ZI = 0:1:C;<br />
W = polifit(A,B,4);<br />
Vout = polycal (W, ZI);<br />
Z1 = ZI</p>
<p>Thanks,<br />
Uvernes</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29686</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Tue, 12 Aug 2008 12:04:11 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29686</guid>
		<description>J. Hengenius-

You still haven't shown code that we could look at.  Please send a sample to technical support with information on the runs on different computers so they can dive into this with more information.

--Loren</description>
		<content:encoded><![CDATA[<p>J. Hengenius-</p>
<p>You still haven&#8217;t shown code that we could look at.  Please send a sample to technical support with information on the runs on different computers so they can dive into this with more information.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. Hengenius</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29681</link>
		<dc:creator>J. Hengenius</dc:creator>
		<pubDate>Tue, 12 Aug 2008 04:31:14 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29681</guid>
		<description>Thanks for the quick response.  I've been using MS Task Manager to check my PC cores.  All cores run at 100% while the code is running.  

The n-D grid created by the code represents the parameter space of an ODE system.  At each point in the parameter grid, a cost function (ODE output vs. data) is evaluated and stored.  There is a heuristic to decide if the resolution along any one parameter dimension is high enough.  If it isn't, the number of points along that dimension is doubled and the cost function is evaluated/stored at the new points.  The evaluations don't depend on each other and these evaluations are carried out simultaneously on all cores of my PCs (maxNumCompThreads returns 2 or 4 depending on the PC).

The multi-processor system has been executing the same code on only one processor.  (It may be worth noting that my PCs are running Vista.  The workstation has basic SPARC architecture and is running Solaris.)

If this is getting outside your area of expertise, I'll pass it along to Technical Support.  I'd still welcome feedback from you or your commenters.  Thanks again.

- J. Hengenius</description>
		<content:encoded><![CDATA[<p>Thanks for the quick response.  I&#8217;ve been using MS Task Manager to check my PC cores.  All cores run at 100% while the code is running.  </p>
<p>The n-D grid created by the code represents the parameter space of an ODE system.  At each point in the parameter grid, a cost function (ODE output vs. data) is evaluated and stored.  There is a heuristic to decide if the resolution along any one parameter dimension is high enough.  If it isn&#8217;t, the number of points along that dimension is doubled and the cost function is evaluated/stored at the new points.  The evaluations don&#8217;t depend on each other and these evaluations are carried out simultaneously on all cores of my PCs (maxNumCompThreads returns 2 or 4 depending on the PC).</p>
<p>The multi-processor system has been executing the same code on only one processor.  (It may be worth noting that my PCs are running Vista.  The workstation has basic SPARC architecture and is running Solaris.)</p>
<p>If this is getting outside your area of expertise, I&#8217;ll pass it along to Technical Support.  I&#8217;d still welcome feedback from you or your commenters.  Thanks again.</p>
<p>- J. Hengenius</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29676</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 11 Aug 2008 20:35:55 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29676</guid>
		<description>J Hengenius-

Whether or not MATLAB uses more than 1 thread for an operations depends very much on what operation is being done.  You haven't supplied enough information for any of us to give a concrete answer, including how you know the 2- and 4- core PCs are using the multithreading.  Perhaps you can send the details to tech support for more context.

--Loren</description>
		<content:encoded><![CDATA[<p>J Hengenius-</p>
<p>Whether or not MATLAB uses more than 1 thread for an operations depends very much on what operation is being done.  You haven&#8217;t supplied enough information for any of us to give a concrete answer, including how you know the 2- and 4- core PCs are using the multithreading.  Perhaps you can send the details to tech support for more context.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. Hengenius</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29673</link>
		<dc:creator>J. Hengenius</dc:creator>
		<pubDate>Mon, 11 Aug 2008 17:18:41 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29673</guid>
		<description>Dear Loren, 

I'm a little late to this party, but hopefully you  or your readers can provide some feedback.  I have some code that iteratively builds an n-D array.  On my PCs (2-core and 4-core) R2008a's multithreading utilizes all cores to run the code.  I recently tried the same code on a 24-processor workstation.  While maxNumCompThreads returns 24, only one CPU is active.  Another commenter asked about this in one of your previous posts, but I didn't see any responses.

Would anyone care to chime in with insights?

Thanks,
J. Hengenius</description>
		<content:encoded><![CDATA[<p>Dear Loren, </p>
<p>I&#8217;m a little late to this party, but hopefully you  or your readers can provide some feedback.  I have some code that iteratively builds an n-D array.  On my PCs (2-core and 4-core) R2008a&#8217;s multithreading utilizes all cores to run the code.  I recently tried the same code on a 24-processor workstation.  While maxNumCompThreads returns 24, only one CPU is active.  Another commenter asked about this in one of your previous posts, but I didn&#8217;t see any responses.</p>
<p>Would anyone care to chime in with insights?</p>
<p>Thanks,<br />
J. Hengenius</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-28633</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Tue, 29 Apr 2008 15:53:46 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-28633</guid>
		<description>Yunde-

As far as I know, currently all the timers run in one shared thread.  Since that is something under the hood, it could change in a future release.

--Loren</description>
		<content:encoded><![CDATA[<p>Yunde-</p>
<p>As far as I know, currently all the timers run in one shared thread.  Since that is something under the hood, it could change in a future release.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
</channel>
</rss>
