<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Physical Processor Count ? in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Physical-Processor-Count/m-p/944166#M5089</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Hi Mithun,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Yourguesses are correct in both cases. Processoraffinity Mask is abit array with each bit represent a logical processor.&lt;/DIV&gt;
&lt;DIV&gt;However, there are twocaveates:1) changingprocessor affinity maskinterferes with the system scheduler's policy thus itshould be used sparingly; 2) affinity mask changes when the number of physical CPU changes and alsothe Hyperthreading turn on or turn off, which means that optimal performance at oneconfiguration might end up mediocre in another one.&lt;/DIV&gt;
&lt;DIV&gt;Anotherinteresting note isthat asdual core CPUs come out in future, Microsoftgoto redefine SYSTEM_INFO structure to accommodate another class of processors.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;-sli&lt;/DIV&gt;</description>
    <pubDate>Thu, 12 Aug 2004 14:56:13 GMT</pubDate>
    <dc:creator>Shuo_L_Intel</dc:creator>
    <dc:date>2004-08-12T14:56:13Z</dc:date>
    <item>
      <title>Physical Processor Count ?</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Physical-Processor-Count/m-p/944165#M5088</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;Hi,&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;I have a very basic query.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;I ran the "cpucounter" utility and it shows &lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;the following on my hyperthreaded machine -&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;physical processor count = 1&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;logical processors per physical processor = 2&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;Underthe same machine, i run the following Win32 code -&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;SYSTEM_INFO SysInfo ;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;GetSystemInfo ( &amp;amp; SysInfo ) ;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;DWORD count = SysInfo.dwNumberOfProcessor ;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;The variable 'count' is now = 2.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;Does this mean that SysInfo.dwNumberOfProcessor actually re&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;presents thelogical processor count instead of thephysical processor count ?&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;Also consider the following code snippet -&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;DWORD ProcessAffinityMask ;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;DWORDSystemAffinityMask ;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;GetProcessAffinityMask ( &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt; GetCurrentProcess(),&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp; ProcessAffinityMask,&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp; SystemAffinityMask ) ;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;The following is observed -&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;ProcessAffinityMask=00000003 (2 processors)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;SystemAffinityMask=00000003 (2 processors)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;Again does this mean that the variables 'SystemAffinityMask' and 'ProcessAffinityMask'represent the affinity mask of logical processorsinstead ofphysical processors ?&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;Can someone clarify my doubts ?&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks,&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="l" eft=""&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;-mithun.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Aug 2004 08:35:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Physical-Processor-Count/m-p/944165#M5088</guid>
      <dc:creator>mrshanbh</dc:creator>
      <dc:date>2004-08-11T08:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Physical Processor Count ?</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Physical-Processor-Count/m-p/944166#M5089</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Hi Mithun,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Yourguesses are correct in both cases. Processoraffinity Mask is abit array with each bit represent a logical processor.&lt;/DIV&gt;
&lt;DIV&gt;However, there are twocaveates:1) changingprocessor affinity maskinterferes with the system scheduler's policy thus itshould be used sparingly; 2) affinity mask changes when the number of physical CPU changes and alsothe Hyperthreading turn on or turn off, which means that optimal performance at oneconfiguration might end up mediocre in another one.&lt;/DIV&gt;
&lt;DIV&gt;Anotherinteresting note isthat asdual core CPUs come out in future, Microsoftgoto redefine SYSTEM_INFO structure to accommodate another class of processors.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;-sli&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Aug 2004 14:56:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Physical-Processor-Count/m-p/944166#M5089</guid>
      <dc:creator>Shuo_L_Intel</dc:creator>
      <dc:date>2004-08-12T14:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Physical Processor Count ?</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Physical-Processor-Count/m-p/944167#M5090</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Sli,&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Thanks for the reply. &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Windows Server 2003 already supports a API call 'GetLogicalProcessorInformation ( )', that can retrive information about logical processors on hyperthreaded processors.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Unfortunately this function is not supported under Windows XP or earlier editions. Too bad.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;You can look it up on msdn - &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getlogicalprocessorinformation.asp" target="_blank"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getlogicalprocessorinformation.asp&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Regards,&lt;/DIV&gt;
&lt;DIV&gt;Mithun Shanbhag.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Aug 2004 01:44:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Physical-Processor-Count/m-p/944167#M5090</guid>
      <dc:creator>mrshanbh</dc:creator>
      <dc:date>2004-08-13T01:44:12Z</dc:date>
    </item>
  </channel>
</rss>

