(j3.2006) (SC22WG5.5701) AW: [ukfortran] AW: coarray dummy arguments
Bader, Reinhold
Reinhold.Bader
Wed Apr 6 07:47:45 EDT 2016
Hi Anton,
> -----Urspr?ngliche Nachricht-----
> Von: owner-sc22wg5 at open-std.org [mailto:owner-sc22wg5 at open-std.org] Im
> Auftrag von Anton Shterenlikht
> Gesendet: Mittwoch, 6. April 2016 05:37
> An: j3 at mailman.j3-fortran.org; Bader, Reinhold <Reinhold.Bader at lrz.de>
> Cc: sc22wg5 at open-std.org
> Betreff: (SC22WG5.5700) [ukfortran] AW: (j3.2006) coarray dummy arguments
>
> Hi Reinhold
>
> Your example makes your point much clearer.
> Still...
>
> > Image 1:
> >
> > INTEGER :: I[*] = 0
> >
> > I[2] = I[2] + 1
> > SYNC IMAGES( [1,2] )
> >
> > Image 2:
> >
> > INTEGER :: IL
> >
> > CALL S1(I, IL)
> >
> > The current text in the standard causes the above to be non-conforming
> > for two reasons:
> >
> > (1) the dummy argument A of procedure S1 is modified by a different
> > image, in violation of 12.5.2.13 para 3+4. Since the ability to do
> > such modifications is part of the coarray design, further
> > exceptions need to be added to the above paragraphs. The
> > exceptions
>
> I think this code violates [195:3-4].
> Variable I is defined on image 1 and used on image 2 in the same segment,
> which is prohibited.
The text in [195:3-4] does not say "used". It says "it shall not be referenced, defined, or become undefined
4 in a segment on another image unless the segments are ordered". The suggested modifications ensure
that passing it in as a dummy argument does not trigger any item in that list.
(Note that even if you shift the code executed on image 1 to within S1, the procedure might be invoked on
image 2 after the update has been performed, but before the SYNC has been completed, on image 1.)
Cheers
Reinhold
> "I" is used on image 2 as actual argument when calling subroutine S1. I believe
> that to conform, SYNC IMAGES( [1,2] ) must appear before CALL S1(I, IL).
>
> This seems to be related to the dummy variable issue you are addressing. When
> you say that the ability to modify a dummy argument by a different image is part
> of the coarray design, I'm not sure.
>
> Anton
More information about the J3
mailing list