<!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"> Hi <A HREF="mailto:Mark@OpenMP.org">Mark@OpenMP.org</A>, hi <A HREF="mailto:campbel...@gmail.com">campbel...@gmail.com</A>, hi other readers,</FONT><BR>
<FONT SIZE="5">I think I have found the reason of the bad/erratic behaviour of my program.</FONT><BR>
<FONT SIZE="5"> I already wrote that the program began to hang in its last subprogram, called rnflow, although 90 % or 95 % of the work had already been done by the tenth of previous other subroutines.</FONT><BR>
<FONT SIZE="5"> This subroutine is just a rainflow counter, which needs be initialized, and here is the problem because I used DATA statements, that are said to put the variables which they act upon into the SHARED set of variables; there, they become sunject to race condition between the various processors.</FONT><BR>
<FONT SIZE="5"> I read that yesterday; I mas still reading lots of things about good practises of fortran coding, and things about "valgrind --tool=helgrind" that I might have inteded to use, and I falled on a paper by The Journal of Supercomputing in The Netherlands, saying that "Saved local variables are always shared and non-saved local variables are always threadprivate. It is all too easy to inadvertently create a saved variable. For example, in Fortran 90/95 initializing a local variable, e.g., INTEGER :: I=0, creates a saved variable. A DATA statement has a similar effect in both Fortran 77 and Fortran 90/95. In OpenMP such variables are always shared, but often the programmer’s intent was to initialize a threadprivate variable (which is not possible with local variables in version 1.1)."</FONT><BR>
<FONT SIZE="5"> So tomorrow at work, I will have to go in the depht of this rnflow subroutine, and simply change a "data a/1/" to "a=1", and then the count will be exactly the same, except that the program should go to its end without data race nor hanging.</FONT><BR>
<FONT SIZE="5"> I hope that it's the last time that you have to read me,</FONT><BR>
<FONT SIZE="5">David</FONT>
</BODY>
</HTML>