<?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: OpenMP and hyperthreading in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978749#M5680</link>
    <description>&lt;DIV&gt;Hi Gary,&lt;/DIV&gt;
&lt;DIV&gt;I can't reproduce the error that you describe. Your test program works correctly on my systemfor any number of threads. What version of the Intel compiler, Linux kernel, and glibc are you using? The 'icid' command should report these version numbers.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Henry&lt;/DIV&gt;</description>
    <pubDate>Tue, 16 Dec 2003 04:47:02 GMT</pubDate>
    <dc:creator>Henry_G_Intel</dc:creator>
    <dc:date>2003-12-16T04:47:02Z</dc:date>
    <item>
      <title>OpenMP and hyperthreading</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978747#M5678</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;(When I tried to submit this I got an error saying I wasn't allowed to submit HTML code, so I had to change all left-angle brackets to vertical lines. Sorry.)&lt;BR /&gt;&lt;BR /&gt;I have a P4 running Linux with hyperthreading turned on and I can't get OpenMP to work on it. I don't mean it isn't fast enough; I mean it hangs. I have a file with the following code:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;#include |stdio.h&amp;gt;&lt;STDIO.H&gt;&lt;BR /&gt;#include |omp.h&amp;gt;&lt;OMP.H&gt;&lt;BR /&gt;&lt;BR /&gt;#define N 16&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;int i;&lt;BR /&gt;int f&lt;N&gt;;&lt;BR /&gt;&lt;BR /&gt;#pragma omp parallel for&lt;BR /&gt;for(i=0;i|N;i++)&lt;/N&gt;&lt;/OMP.H&gt;&lt;/STDIO.H&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;N&gt;{&lt;BR /&gt;f&lt;I&gt;=i;&lt;BR /&gt;printf("%d
",i);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/I&gt;&lt;/N&gt;&lt;/FONT&gt;&lt;BR /&gt;I issue the following commands:&lt;BR /&gt;&lt;BR /&gt;icc -openmp foo.cpp&lt;BR /&gt;setenv OMP_NUM_THREADS 2&lt;BR /&gt;a.out&lt;BR /&gt;&lt;BR /&gt;and it prints only the first half of the i values and then stops. Clearly the second thread is never getting started. If I set OMP_NUM_THREADS to 1 it works fine.&lt;BR /&gt;&lt;BR /&gt;Does anyone know what's causing this and if there's a way around it?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Gary&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;Message Edited by hagabb on &lt;SPAN class="date_text"&gt;12-15-2003&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;11:58 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Dec 2003 01:09:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978747#M5678</guid>
      <dc:creator>gfelder</dc:creator>
      <dc:date>2003-12-13T01:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP and hyperthreading</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978748#M5679</link>
      <description>I guess you've verified that printf() isn't thread safe.
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 13 Dec 2003 06:55:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978748#M5679</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2003-12-13T06:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP and hyperthreading</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978749#M5680</link>
      <description>&lt;DIV&gt;Hi Gary,&lt;/DIV&gt;
&lt;DIV&gt;I can't reproduce the error that you describe. Your test program works correctly on my systemfor any number of threads. What version of the Intel compiler, Linux kernel, and glibc are you using? The 'icid' command should report these version numbers.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Henry&lt;/DIV&gt;</description>
      <pubDate>Tue, 16 Dec 2003 04:47:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978749#M5680</guid>
      <dc:creator>Henry_G_Intel</dc:creator>
      <dc:date>2003-12-16T04:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP and hyperthreading</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978750#M5681</link>
      <description>&lt;P&gt;Henry,&lt;/P&gt;
&lt;P&gt;Here's the output I get from icid.&lt;/P&gt;
&lt;P&gt;Thanks for your help,&lt;/P&gt;
&lt;P&gt;Gary&lt;/P&gt;
&lt;P&gt;-------------------&lt;/P&gt;
&lt;P&gt;OS information:&lt;BR /&gt;Red Hat Linux release 9 (Shrike)&lt;BR /&gt;Kernel on an m&lt;BR /&gt;Kernel 2.4.20-19.9smp&lt;BR /&gt;glibc-2.3.2-27.9.7&lt;/P&gt;
&lt;P&gt;===========================================================&lt;BR /&gt;Support Package IDs for Intel Compilers in /opt/intel/compiler70/ia32/bin&lt;BR /&gt;Please use the following information when submitting customer support requests.&lt;/P&gt;
&lt;P&gt;C++ Support Package ID : l_cc_p_7.1.006-NCOM&lt;BR /&gt;IDB Support Package ID : l_cc_p_7.1.006-NCOM&lt;BR /&gt;===========================================================&lt;BR /&gt;C++ License Expiration Date: never expire&lt;BR /&gt;C++ &amp;amp; IDB Support Services Expiration Date: never expire&lt;/P&gt;
&lt;P&gt;All Installed Compiler Components on this OS: &lt;BR /&gt;intel-icc7-7.1-6: Intel C++ Compiler for 32-bit applications, Version&lt;BR /&gt; 7.1 Build 20030307Z&lt;BR /&gt;intel-isubh7-7.1-6: Substitute Headers for Intel C++ Compiler for&lt;BR /&gt; 32-bit applications, Version 7.1&lt;BR /&gt;intel-iidb7-7.1-11: Linux Application Debugger for 32-bit applications,&lt;BR /&gt; Version 7.1, Build 20030303&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Dec 2003 02:53:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978750#M5681</guid>
      <dc:creator>gfelder</dc:creator>
      <dc:date>2003-12-18T02:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP and hyperthreading</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978751#M5682</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Gary,&lt;/DIV&gt;
&lt;DIV&gt;The Intel 7.1 compiler supports your Linux kernel and glibc so I don't know why this simple program doesn't work correctly on your system. I tried your test program on several systems, Linux (Red Hat 7.3, 9.0, AS2.1)and Windows, with and without Hyper-Threading, and it always works correctly for me. Does your program work correctly when Hyper-Threading is disabled?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Please run the following program and post the output:&lt;/DIV&gt;
&lt;DIV&gt;
&lt;HR /&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;#include |stdio.h&amp;gt;&lt;STDIO.H&gt;&lt;BR /&gt;#include |omp.h&amp;gt;&lt;OMP.H&gt;&lt;BR /&gt;&lt;BR /&gt;#define N 16&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;int i;&lt;BR /&gt;int f&lt;N&gt;;&lt;BR /&gt;&lt;BR /&gt;#pragma omp parallel&lt;/N&gt;&lt;/OMP.H&gt;&lt;/STDIO.H&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;{&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt; int myID = omp_get_thread_num();&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt; printf ("Hello from thread %d
", myID);&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt; #pragma omp for&lt;BR /&gt; for (i = 0; i | N; i++)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt; &lt;N&gt;{&lt;BR /&gt; f&lt;I&gt;=i;&lt;BR /&gt; printf ("%d %d
", i, myID);&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;
&lt;HR /&gt;
&lt;/I&gt;&lt;/N&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face="Arial"&gt;I want to see if multiple threads are active inside the parallel region.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face="Arial"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;DIV&gt;Henry&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face="Arial"&gt;PS The "&amp;lt;" bug is being fixed.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Dec 2003 08:26:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-and-hyperthreading/m-p/978751#M5682</guid>
      <dc:creator>Henry_G_Intel</dc:creator>
      <dc:date>2003-12-18T08:26:16Z</dc:date>
    </item>
  </channel>
</rss>

