<?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 CLOMP: kmp_lock_cond_wait runtime ERROR in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CLOMP-kmp-lock-cond-wait-runtime-ERROR/m-p/847196#M1710</link>
    <description>I wrote a CLOMP program under Redhat Enterprise 4. All OpenMP programs runs smoothly. A cluster openmp program works well, if the lock api is not called.&lt;BR /&gt;However, when the program reached to &lt;B&gt;kmp_lock_cond_wait&lt;/B&gt;, a &lt;B&gt;runtime error &lt;/B&gt;will be output, and the process will be terminated.&lt;BR /&gt;&lt;BR /&gt;I really need to add the lock feature to my cluster OpenMP program. It seems that kmp_lock_cond_wait is the only choice for me.&lt;BR /&gt;&lt;BR /&gt;I really appreciate your help. Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;SPAN style="text-decoration: underline;"&gt;Error imformations:&lt;/SPAN&gt;&lt;/B&gt;&lt;BR /&gt;&lt;B&gt;&lt;I&gt;Cluster OMP Fatal: Proc#0 Thread#0 (INITIAL): A lock (lock=39) was needed but&lt;BR /&gt; not held for the operation in ../src/lock.c at line 1497.&lt;/I&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;B&gt;Code:&lt;/B&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;#include &lt;KMP_SHARABLE.H&gt;&lt;BR /&gt;&lt;BR /&gt;omp_lock_t *pLock = NULL;&lt;BR /&gt;&lt;BR /&gt;pLock = (omp_lock_t *)kmp_sharable_malloc(sizeof(omp_lock_t));&lt;BR /&gt;&lt;BR /&gt;omp_init_lock(pLock);&lt;BR /&gt;&lt;BR /&gt;#pragma omp parallel num_threads(4) shared(pLock)&lt;BR /&gt;{&lt;BR /&gt; kmp_lock_cond_wait(pLock);&lt;BR /&gt; printf("Thread locked\n");&lt;BR /&gt; kmp_lock_cond_signal(pLock);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;omp_destroy_lock(pLock);&lt;BR /&gt;kmp_sharable_free(pLock);&lt;BR /&gt;&lt;/KMP_SHARABLE.H&gt;</description>
    <pubDate>Mon, 04 Jan 2010 11:35:37 GMT</pubDate>
    <dc:creator>remex1980</dc:creator>
    <dc:date>2010-01-04T11:35:37Z</dc:date>
    <item>
      <title>CLOMP: kmp_lock_cond_wait runtime ERROR</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CLOMP-kmp-lock-cond-wait-runtime-ERROR/m-p/847196#M1710</link>
      <description>I wrote a CLOMP program under Redhat Enterprise 4. All OpenMP programs runs smoothly. A cluster openmp program works well, if the lock api is not called.&lt;BR /&gt;However, when the program reached to &lt;B&gt;kmp_lock_cond_wait&lt;/B&gt;, a &lt;B&gt;runtime error &lt;/B&gt;will be output, and the process will be terminated.&lt;BR /&gt;&lt;BR /&gt;I really need to add the lock feature to my cluster OpenMP program. It seems that kmp_lock_cond_wait is the only choice for me.&lt;BR /&gt;&lt;BR /&gt;I really appreciate your help. Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;SPAN style="text-decoration: underline;"&gt;Error imformations:&lt;/SPAN&gt;&lt;/B&gt;&lt;BR /&gt;&lt;B&gt;&lt;I&gt;Cluster OMP Fatal: Proc#0 Thread#0 (INITIAL): A lock (lock=39) was needed but&lt;BR /&gt; not held for the operation in ../src/lock.c at line 1497.&lt;/I&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;B&gt;Code:&lt;/B&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;#include &lt;KMP_SHARABLE.H&gt;&lt;BR /&gt;&lt;BR /&gt;omp_lock_t *pLock = NULL;&lt;BR /&gt;&lt;BR /&gt;pLock = (omp_lock_t *)kmp_sharable_malloc(sizeof(omp_lock_t));&lt;BR /&gt;&lt;BR /&gt;omp_init_lock(pLock);&lt;BR /&gt;&lt;BR /&gt;#pragma omp parallel num_threads(4) shared(pLock)&lt;BR /&gt;{&lt;BR /&gt; kmp_lock_cond_wait(pLock);&lt;BR /&gt; printf("Thread locked\n");&lt;BR /&gt; kmp_lock_cond_signal(pLock);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;omp_destroy_lock(pLock);&lt;BR /&gt;kmp_sharable_free(pLock);&lt;BR /&gt;&lt;/KMP_SHARABLE.H&gt;</description>
      <pubDate>Mon, 04 Jan 2010 11:35:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CLOMP-kmp-lock-cond-wait-runtime-ERROR/m-p/847196#M1710</guid>
      <dc:creator>remex1980</dc:creator>
      <dc:date>2010-01-04T11:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: CLOMP: kmp_lock_cond_wait runtime ERROR</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CLOMP-kmp-lock-cond-wait-runtime-ERROR/m-p/847197#M1711</link>
      <description>Every suggestion is welcome.&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Jan 2010 02:03:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CLOMP-kmp-lock-cond-wait-runtime-ERROR/m-p/847197#M1711</guid>
      <dc:creator>remex1980</dc:creator>
      <dc:date>2010-01-06T02:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: CLOMP: kmp_lock_cond_wait runtime ERROR</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CLOMP-kmp-lock-cond-wait-runtime-ERROR/m-p/847198#M1712</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/459503"&gt;remex1980&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Every suggestion is welcome.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;I'm not sure what you're trying to do.&lt;BR /&gt;&lt;BR /&gt;You can use openmp locks. You should #include &lt;OMP.H&gt; . See the Intel documentation or the OpenMP 3.0 specification at &lt;A href="http://openmp.org/wp/openmp-specifications/" target="_blank"&gt;http://openmp.org/wp/openmp-specifications/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;To acquire a lock&lt;BR /&gt;omp_set_lock&lt;BR /&gt;&lt;BR /&gt;To check for availability of a lock:&lt;BR /&gt;omp_try_lock&lt;BR /&gt;&lt;BR /&gt;To release a lock:&lt;BR /&gt;omp_unset_lock&lt;BR /&gt;&lt;BR /&gt;OpenMP does not provide condition variables. Regular OpenMP locks should work fine with Cluster OpenMP.&lt;BR /&gt;&lt;BR /&gt;Hopefully this will work for you.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Larry Meadows&lt;BR /&gt;&lt;A href="mailto:lawrence.f.meadows@intel.com"&gt;lawrence.f.meadows@intel.com&lt;/A&gt;&lt;/OMP.H&gt;</description>
      <pubDate>Fri, 08 Jan 2010 22:38:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CLOMP-kmp-lock-cond-wait-runtime-ERROR/m-p/847198#M1712</guid>
      <dc:creator>Lawrence_M_Intel</dc:creator>
      <dc:date>2010-01-08T22:38:09Z</dc:date>
    </item>
  </channel>
</rss>

