<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">I would file this bug with bugzilla, but I can’t figure out where the OpenMP bugs should go. If someone could enlighten me, I’d be grateful.</div><div class=""><br class=""></div><div class=""><b class=""><font color="#ff2600" class="">Compiling the simple code below with g++ and linking it to the LLVM OpenMP runtime compiled in debug mode produces a fatal error.</font></b></div><div class=""><br class=""></div><div class=""><b class="">The program:</b></div><div class=""><br class=""></div><div class=""><div class="">#include <omp.h></div><div class=""><br class=""></div><div class="">#define NUM_THREADS 2</div><div class=""><br class=""></div><div class="">int fib(int i)</div><div class="">{</div><div class="">  if (i < 2) return i;</div><div class="">  else return fib(i-1) + fib(i-2);</div><div class="">}</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">int main(int argc, char **argv)</div><div class="">{</div><div class="">  int i, inner_threads;</div><div class="">  for (inner_threads = 1; inner_threads <= NUM_THREADS; inner_threads++) {</div><div class="">#pragma omp parallel for schedule(runtime) num_threads(inner_threads)</div><div class="">    for (i = 0; i < NUM_THREADS; i++) {</div><div class="">      fib(10);</div><div class="">    }</div><div class="">  } </div><div class="">  return 0;</div><div class="">}</div></div><div class=""><br class=""></div><div class=""><b class="">The error:</b></div><div class=""><br class=""></div><div class=""><div class="">Assertion failure at kmp_dispatch.cpp(1392): p_last && p_lb && p_ub && p_st.</div><div class="">OMP: Error #13: Assertion failure at kmp_dispatch.cpp(1392).</div><div class="">OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see <a href="http://www.intel.com/software/products/support/" class="">http://www.intel.com/software/products/support/</a>.</div><div class=""><br class=""></div><div class=""><b class="">The explanation:</b></div><div class=""><b class=""><br class=""></b></div><div class="">On line 642 of kmp_gsupport.c, there is a call to </div><div class=""><br class=""></div><div class=""><div class="">  status = KMP_DISPATCH_NEXT(&loc, gtid, NULL, (kmp_int *)p_lb,        \</div><div class="">               (kmp_int *)p_ub, (kmp_int *)&stride);  </div></div><div class=""><br class=""></div></div><div class="">The NULL is passed to the parameter shown in red below</div><div class=""><br class=""></div><div class=""><div class="">template< typename T ></div><div class="">static int</div><div class="">__kmp_dispatch_next(</div><div class="">    ident_t *loc, int gtid, kmp_int32 <b class="">*<font color="#ff2600" class="">p_last</font>,</b> T *p_lb, T *p_ub, typename traits_t< T >::signed_t *p_st</div><div class="">)</div></div><div class=""><br class=""></div><div class="">This always fails the assertion below from line 1392 of kmp_dispatch.c</div><div class=""><br class=""></div><div class=""><div class="">    KMP_DEBUG_ASSERT( <font color="#ff2600" class=""><b class="">p_last</b></font> && p_lb && p_ub && p_st ); // AC: these cannot be NULL</div><div class=""><br class=""></div><div class="">I could fix it by eliminating the debug assertion, but I think it would be better for someone who understands the kmp dispatching mechanisms to think about how they are being used from the GOMP wrappers.</div><div class=""><br class=""></div><div apple-content-edited="true" class="">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="font-size: 12px;" class=""><font face="Courier" class="">--<br class="">John Mellor-Crummey         Professor<br class="">Dept of Computer Science    Rice University<br class="">email: <a href="mailto:johnmc@rice.edu" class="">johnmc@rice.edu</a>      phone: 713-348-5179</font><br class=""></div></div></span></div></span>
</div>
<br class=""></div></body></html>