[Omp] Clarification of the Fortran OpenMP 2.0 specs about FLUSH directive is needed

Meadows, Lawrence F lawrence.f.meadows at intel.com
Mon Jul 31 13:59:39 PDT 2006


Marina:

The intent of all of this is clear, if you hand around a pointer
to something then it is visible to other threads. In standard
Fortran this can happen through argument association or using
the POINTER attribute. In extended Fortran and in Fortran 2004
there are other ways to do this. If you think of it as C, then
you'll understand the intent.

However, I suggest that you read the 2.5 specification. The intent
of 2.5 was not to change semantics, but to clarify, and I believe
that most of your questions are answered in 2.5.

Of course, I could be wrong, in which case please ask again.

Regards,

Larry Meadows 

>-----Original Message-----
>From: omp-bounces at openmp.org [mailto:omp-bounces at openmp.org] 
>On Behalf Of Marina Kraeva
>Sent: Monday, July 31, 2006 1:39 PM
>To: Omp at openmp.org
>Subject: [Omp] Clarification of the Fortran OpenMP 2.0 specs 
>about FLUSH directive is needed
>
>Hello,
>
>I have several questions about thread-visible variables and FLUSH 
>directive. In the Fortran OpenMP API 2.0 specs it's said that "Local 
>variables that have had their address taken and saved or have 
>had their 
>address passed to another subprogram" are thread-visible.
>
>The first question is how one can take and save the address of 
>a variable.
>
>The second question is whether I understand it right that the 
>thread-visible variables are shared variables and "global-lifetime 
>memory locations". I did not find any mention of thread-visible 
>variables in the OpenMP API 2.5 specs other than in the following 
>sentence: "A flush construct without a list, executed on a 
>given thread, 
>operates as if the whole thread-visible data state of the program, as 
>defined by the base language, is flushed."
>
>The last question is about passing address of a local variable to 
>another subprogram (see the quote from the specs 2.0 above). Does it 
>mean that in case a local variable was passed into another subprogram 
>(and in Fortran all variables are passed by address), this variable is 
>considered thread-visible? Can anyone provide an example for 
>that quote?
>
>Or should I disregard everything in the specs 2.0 as there is 
>new specs?
>
>Thank you in advance,
>Marina Kraeva.
>
>
>_______________________________________________
>Omp mailing list
>Omp at openmp.org
>http://openmp.org/mailman/listinfo/omp
>


More information about the Omp mailing list