<?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: Open MP and Win32 APIs in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Open-MP-and-Win32-APIs/m-p/988387#M5936</link>
    <description>Spawn -&lt;BR /&gt;&lt;BR /&gt;On Windows, the Intel OpenMP implementation is built on the Windows APIs, so use of other Win32 API functions should work.  However, if you have a specific failure that you are experiencing, please report the problem to Intel through &lt;A href="http://premier.intel.com"&gt;Premier Support&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Since OpenMP is designed for "synchronous" compute-bound computations, it may not be appropriate to use Windows threading functions within OpenMP parallel regions.  Interactions of OpenMP synchronization points and blocking API calls could adversely affect performance.&lt;BR /&gt;&lt;BR /&gt;As for your second question, if an API call can be used within a (Win32) threaded code, there should be no problems with using that call within an OpenMP parallel region.  I expect documentation from Microsoft(?) would be able to give more specific details of thread safety for Windows API functions.&lt;BR /&gt;&lt;BR /&gt;Besides thread safety, you need to consider algorithmic safety when calling API functions from OpenMP threads.  Do you mean to have each thread call the function (i.e., every thread opens a different output file) or should only one thread be calling the routine (i.e. TerminateProcess).  If the latter is the case, you should put the API calls in a &lt;B&gt;master&lt;/B&gt; or &lt;B&gt;single&lt;/B&gt; region within the parallel region.&lt;BR /&gt;&lt;BR /&gt;Just to satisfy my curiosity, can you tell us what sort of application you are using this combination of APIs?&lt;BR /&gt;&lt;BR /&gt;-- clay</description>
    <pubDate>Fri, 13 Jun 2003 22:13:42 GMT</pubDate>
    <dc:creator>ClayB</dc:creator>
    <dc:date>2003-06-13T22:13:42Z</dc:date>
    <item>
      <title>Open MP and Win32 APIs</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Open-MP-and-Win32-APIs/m-p/988386#M5935</link>
      <description>1)Can OpenMP be used with Win32 API calls within, say, a simple "for" loop?&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;#pragma omp parallel for&lt;BR /&gt;for(...)&lt;BR /&gt;  win32_api (i.e. OpenProcess);  &lt;BR /&gt;&lt;BR /&gt;2)I have separate threads calling the same Win32 APIs (i.e. OpenProcess). Is this thread-safe?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Fri, 13 Jun 2003 19:17:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Open-MP-and-Win32-APIs/m-p/988386#M5935</guid>
      <dc:creator>spawn</dc:creator>
      <dc:date>2003-06-13T19:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Open MP and Win32 APIs</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Open-MP-and-Win32-APIs/m-p/988387#M5936</link>
      <description>Spawn -&lt;BR /&gt;&lt;BR /&gt;On Windows, the Intel OpenMP implementation is built on the Windows APIs, so use of other Win32 API functions should work.  However, if you have a specific failure that you are experiencing, please report the problem to Intel through &lt;A href="http://premier.intel.com"&gt;Premier Support&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Since OpenMP is designed for "synchronous" compute-bound computations, it may not be appropriate to use Windows threading functions within OpenMP parallel regions.  Interactions of OpenMP synchronization points and blocking API calls could adversely affect performance.&lt;BR /&gt;&lt;BR /&gt;As for your second question, if an API call can be used within a (Win32) threaded code, there should be no problems with using that call within an OpenMP parallel region.  I expect documentation from Microsoft(?) would be able to give more specific details of thread safety for Windows API functions.&lt;BR /&gt;&lt;BR /&gt;Besides thread safety, you need to consider algorithmic safety when calling API functions from OpenMP threads.  Do you mean to have each thread call the function (i.e., every thread opens a different output file) or should only one thread be calling the routine (i.e. TerminateProcess).  If the latter is the case, you should put the API calls in a &lt;B&gt;master&lt;/B&gt; or &lt;B&gt;single&lt;/B&gt; region within the parallel region.&lt;BR /&gt;&lt;BR /&gt;Just to satisfy my curiosity, can you tell us what sort of application you are using this combination of APIs?&lt;BR /&gt;&lt;BR /&gt;-- clay</description>
      <pubDate>Fri, 13 Jun 2003 22:13:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Open-MP-and-Win32-APIs/m-p/988387#M5936</guid>
      <dc:creator>ClayB</dc:creator>
      <dc:date>2003-06-13T22:13:42Z</dc:date>
    </item>
  </channel>
</rss>

