<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="">My advice is to compile it -g with symbols for debugging, attach a debugger to the hanging process (gdb —pid the_pid_of_your_process), run the command “info thread” to see where each of your threads are, and look at the call stack for each thread to see what it is doing. Either all threads are doing something that causes them to loop infinitely, or most threads are at a barrier while one or more threads is computing infinitely or waiting for a condition that will never be satisfied.<div class=""><br class=""></div><div class="">Using a debugger to examine the problem in action and then speculating about the root causes is much better than speculating blind.<br class=""><div 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=""><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><blockquote type="cite" class=""><div class="">On May 24, 2016, at 9:41 AM, David Van Aelst via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" class="">openmp-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">


  <meta http-equiv="Content-Type" content="text/html; CHARSET=UTF-8" class="">
  <meta name="GENERATOR" content="GtkHTML/4.6.6" class="">

<div class="">
<font size="5" class=""> Hello from Toulouse, France, so please excuse my sometimes poor or hesitant English; I want to parallelize a fortran tool that post-processes finite elements stress results, and it does not yet work correctly; I already posted a message on this list, under the same title : <a href="https://groups.google.com/forum/#!searchin/comp.lang.fortran/fortran$20OpenMP$20hangs$20in$20the$20last$20subroutine|" class="">[fortran OpenMP hangs in the last subroutine]</a>. The serial version of the tool is Ok, but a run lasts five days, and the machine should be able to reduce that to half a day with OpenMP.</font><br class="">
<font size="5" class=""> The problem is that the program enters an endless loop while ran on several processors, even with as few as a twentieth of the full data set that it should finally process. But it behaves perfectly well with an even smaller set of data.</font><br class="">
<font size="5" class=""> I suspect a race condition on one of the variables used by that subroutine, because it never enters that endless loop at the same step within this last subroutine.</font><br class="">
<font size="5" class="">So, I would like to check before any assignation of any variable, if it would not use a memory location which would be already used elsewhere in a previous subroutine.</font><br class="">
<font size="5" class=""> Would it be better to scan every already used variable, whith the following logical function which checks if two pointers do have the same target : C_ASSOCIATED(C_PTR_1, C_PTR_2) with C_PTR_1 aiming at the variable to test, and C_PTR_2 aiming in a loop at all previously used variables.</font><br class="">
<font size="5" class=""> Or, I also imagine to create a C-function which would recieve a pointer to the new variable, and return its real memory location obtained by the "&" unary C-operator, and I could later check that memory location against all those that would have been already used.</font><br class="">
<font size="5" class=""> I hope this is clear enough for somebody to give me an advice,</font><br class="">
<font size="5" class="">Thank you,</font><br class="">
<font size="5" class=""> David</font><br class="">
<br class="">

!DSPAM:8504,574467d8149701257476417!

</div>



_______________________________________________<br class="">Openmp-dev mailing list<br class=""><a href="mailto:Openmp-dev@lists.llvm.org" class="">Openmp-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev<br class=""><br class="">!DSPAM:8504,574467d8149701257476417!<br class=""></div></blockquote></div><br class=""></div></body></html>