[Mpi-forum] Comment on Fortran WG5 ballot N1846

N.M. Maclaren nmm1 at cam.ac.uk
Thu Apr 14 04:16:11 CDT 2011


On Apr 14 2011, Rasmussen, Craig E wrote:
>
>>Programs are prohibited from causing definitions or references that
>>could result in a race condition.
>
> But this part of the standard only seems to put limitations on a 
> variable. So there should be other ways to express what we want. 
> Consider:
>
>BLOCK
>  target :: A
   real, target :: A(6)    ! I assume
>  real, pointer, ASYNCHRONOUS :: ptr(:)
>
>  ptr => A(1:5)
>
>  ! asynchronous communication with MPI and ptr variable
>
>  A(6) = 1.0
>
>  MPI_Wait()
>
>END BLOCK
>
>What is your interpretation of the example?

It looks fine to me, but I accept that it is not obvious.  Remember that
a Fortran variable isn't like a variable in other languages, so I read
the program as follows:

    'A' is a variable, but is not accessed except through selectors,
so is not directly involved.  'A(1:5)' is another variable, though it
is associated with 'A'.
    'ptr' is another variable, which is associated with 'A(1:5)' and
flagged as asynchronous, so can be used in that way.
    'A(6)' is another variable.  Despite the fact that it is also
associated with 'A', it is NOT associated with 'A(1:5)' and so there
is no race condition.

Now, I may well have misunderstood the standard, but that is how I read
the intent.  I can easily believe that the actual wording needs some
clarification (a universal statement!), but I don't think that any change
is needed.

Regards,
Nick Maclaren.




More information about the mpi-forum mailing list