<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Controlling Multithreading</title>
	<atom:link href="http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Mon, 13 Feb 2012 13:24:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-31912</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Fri, 10 Dec 2010 12:07:07 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-31912</guid>
		<description>Christian-

I have no idea about your question.  You can either contact technical support or set up a test of your own where the assignment takes long enough that you can test if it gets interrupted.  Also, you should probably make this an enhancement request - please see the support link on the right of this blog.

--Loren</description>
		<content:encoded><![CDATA[<p>Christian-</p>
<p>I have no idea about your question.  You can either contact technical support or set up a test of your own where the assignment takes long enough that you can test if it gets interrupted.  Also, you should probably make this an enhancement request &#8211; please see the support link on the right of this blog.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-31910</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Thu, 09 Dec 2010 22:44:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-31910</guid>
		<description>Hi Loren, 

here is a good question on MATLAB timers: 
Suppose I want to update several variables (say a and b)  &quot;atomically&quot; in MATLAB (for the purposes of multiple timers). 

Would [a,b] = deal(...,...); do the job, or can the assignment be interrupted by a timer? If it is safe in current versions (which seems very likely to me), it is probably a good idea to retain this behavior for future MATLABs (potentially as valuable as having a compare-and-swap instruction in a processor).

Thanks,
Christian</description>
		<content:encoded><![CDATA[<p>Hi Loren, </p>
<p>here is a good question on MATLAB timers:<br />
Suppose I want to update several variables (say a and b)  &#8220;atomically&#8221; in MATLAB (for the purposes of multiple timers). </p>
<p>Would [a,b] = deal(&#8230;,&#8230;); do the job, or can the assignment be interrupted by a timer? If it is safe in current versions (which seems very likely to me), it is probably a good idea to retain this behavior for future MATLABs (potentially as valuable as having a compare-and-swap instruction in a processor).</p>
<p>Thanks,<br />
Christian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-31189</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 24 Mar 2010 14:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-31189</guid>
		<description>Gus-

Multithreading features change in MATLAB each release recently.  I suggest reading release notes and contacting technical support (link at right) for the best information for your installation and configuration.

--Loren</description>
		<content:encoded><![CDATA[<p>Gus-</p>
<p>Multithreading features change in MATLAB each release recently.  I suggest reading release notes and contacting technical support (link at right) for the best information for your installation and configuration.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gus Correa</title>
		<link>http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-31188</link>
		<dc:creator>Gus Correa</dc:creator>
		<pubDate>Tue, 23 Mar 2010 23:44:38 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-31188</guid>
		<description>Hello All

I second Tom Crocket&#039;s comment.

Inside a matlab script (batch mode) I tried 

&lt;pre&gt;
LASTNT=maxNumCompThreads(NTHREADS)
&lt;/pre&gt;

with several values for NTHREADS (1,4,8, etc)
on a 8-core 64bit Linux machine.
However, &quot;top&quot; shows all 8 cores working at ~100%,
regardless of the value I use for NTHREADS.

I tried also with Matlab interactively,
but I get the same 8 cores working, no matter what I do.

(Matlab R2009a_64bit, Linux, CentOS 5.2)

Is there a way to limit the number of cores in use?
That would be very important and useful for multi-user
systems.


Thank you,
Gus Correa</description>
		<content:encoded><![CDATA[<p>Hello All</p>
<p>I second Tom Crocket&#8217;s comment.</p>
<p>Inside a matlab script (batch mode) I tried </p>
<pre>
LASTNT=maxNumCompThreads(NTHREADS)
</pre>
<p>with several values for NTHREADS (1,4,8, etc)<br />
on a 8-core 64bit Linux machine.<br />
However, &#8220;top&#8221; shows all 8 cores working at ~100%,<br />
regardless of the value I use for NTHREADS.</p>
<p>I tried also with Matlab interactively,<br />
but I get the same 8 cores working, no matter what I do.</p>
<p>(Matlab R2009a_64bit, Linux, CentOS 5.2)</p>
<p>Is there a way to limit the number of cores in use?<br />
That would be very important and useful for multi-user<br />
systems.</p>
<p>Thank you,<br />
Gus Correa</p>
]]></content:encoded>
	</item>
	<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 isPermaLink="false">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&#039;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 isPermaLink="false">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 isPermaLink="false">http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29987</guid>
		<description>Automatic multithreading is great when you&#039;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&#039;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 &quot;automatic&quot; to &quot;manual&quot; 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 isPermaLink="false">http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29727</guid>
		<description>Uvernes-

For a start, MATLAB wasn&#039;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 isPermaLink="false">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 isPermaLink="false">http://blogs.mathworks.com/loren/2007/09/12/controlling-multithreading/#comment-29686</guid>
		<description>J. Hengenius-

You still haven&#039;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>
</channel>
</rss>

