<?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 OpenMP functions in static library in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-functions-in-static-library/m-p/821435#M1263</link>
    <description>If I use openmp commands such as:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;int nthreads, tid;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: red;"&gt;#pragma omp parallel private(tid)&lt;/SPAN&gt;&lt;BR /&gt;  {&lt;BR /&gt;&lt;BR /&gt;  /* Obtain and print thread id */&lt;BR /&gt;  tid = &lt;SPAN style="color: red;"&gt;omp_get_thread_num()&lt;/SPAN&gt;;&lt;BR /&gt;  printf("Hello World from thread = %d\\n", tid);&lt;BR /&gt;&lt;BR /&gt;  /* Only master thread does this */&lt;BR /&gt;  if (tid == 0) &lt;BR /&gt;    {&lt;BR /&gt;    nthreads = &lt;SPAN style="color: red;"&gt;omp_get_num_threads()&lt;/SPAN&gt;;&lt;BR /&gt;    printf("Number of threads = %d\\n", nthreads);&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;  }  /* All threads join master thread and terminate */&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;in my main project they work properly (I have 4 cores, and four threads are shown). &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;BUT if create a static library and THE SAME commands are used in some function of from this static library program shows only 1 thread available.&lt;BR /&gt;&lt;BR /&gt;Why is that ? &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 28 Sep 2011 18:16:11 GMT</pubDate>
    <dc:creator>AdamD85</dc:creator>
    <dc:date>2011-09-28T18:16:11Z</dc:date>
    <item>
      <title>OpenMP functions in static library</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-functions-in-static-library/m-p/821435#M1263</link>
      <description>If I use openmp commands such as:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;int nthreads, tid;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: red;"&gt;#pragma omp parallel private(tid)&lt;/SPAN&gt;&lt;BR /&gt;  {&lt;BR /&gt;&lt;BR /&gt;  /* Obtain and print thread id */&lt;BR /&gt;  tid = &lt;SPAN style="color: red;"&gt;omp_get_thread_num()&lt;/SPAN&gt;;&lt;BR /&gt;  printf("Hello World from thread = %d\\n", tid);&lt;BR /&gt;&lt;BR /&gt;  /* Only master thread does this */&lt;BR /&gt;  if (tid == 0) &lt;BR /&gt;    {&lt;BR /&gt;    nthreads = &lt;SPAN style="color: red;"&gt;omp_get_num_threads()&lt;/SPAN&gt;;&lt;BR /&gt;    printf("Number of threads = %d\\n", nthreads);&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;  }  /* All threads join master thread and terminate */&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;in my main project they work properly (I have 4 cores, and four threads are shown). &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;BUT if create a static library and THE SAME commands are used in some function of from this static library program shows only 1 thread available.&lt;BR /&gt;&lt;BR /&gt;Why is that ? &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Sep 2011 18:16:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-functions-in-static-library/m-p/821435#M1263</guid>
      <dc:creator>AdamD85</dc:creator>
      <dc:date>2011-09-28T18:16:11Z</dc:date>
    </item>
    <item>
      <title>OpenMP functions in static library</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-functions-in-static-library/m-p/821436#M1264</link>
      <description>&lt;P&gt;Make sure that you use the proper compiler option to compile your code with OpenMP pragmas: "-openmp" on Linux and "/Qopenmp" on Windows.&lt;/P&gt;&lt;P&gt;You might not notice any problems while compiling your code because the compiler just emits the warning about unrecognized pragma but not the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2011 07:29:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-functions-in-static-library/m-p/821436#M1264</guid>
      <dc:creator>Olga_M_Intel</dc:creator>
      <dc:date>2011-09-29T07:29:01Z</dc:date>
    </item>
  </channel>
</rss>

