<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.6.6">
</HEAD>
<BODY>
<FONT SIZE="5"> 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|">[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>
<FONT SIZE="5"> 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>
<FONT SIZE="5"> 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>
<FONT SIZE="5">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>
<FONT SIZE="5"> 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>
<FONT SIZE="5"> 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>
<FONT SIZE="5"> I hope this is clear enough for somebody to give me an advice,</FONT><BR>
<FONT SIZE="5">Thank you,</FONT><BR>
<FONT SIZE="5"> David</FONT><BR>
<BR>
</BODY>
</HTML>