From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Wed Apr  6 13:47:52 2016
Return-Path: <owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id C21F03587B8; Wed,  6 Apr 2016 13:47:52 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
Received: from postout2.mail.lrz.de (postout2.mail.lrz.de [129.187.255.138])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by www.open-std.org (Postfix) with ESMTP id DF35D3569A1
	for <sc22wg5@open-std.org>; Wed,  6 Apr 2016 13:47:46 +0200 (CEST)
Received: from lxmhs52.srv.lrz.de (localhost [127.0.0.1])
	by postout2.mail.lrz.de (Postfix) with ESMTP id 3qg3r22lMVzyRX;
	Wed,  6 Apr 2016 13:47:46 +0200 (CEST)
Authentication-Results: postout.lrz.de (amavisd-new); dkim=pass (2048-bit key)
	reason="pass (just generated, assumed good)" header.d=lrz.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lrz.de; h=
	mime-version:content-transfer-encoding:content-type:content-type
	:content-language:accept-language:in-reply-to:references
	:message-id:date:date:subject:subject:from:from:received
	:received:received:received; s=postout; t=1459943265; bh=9mLh8Ly
	0sREZ1Bzx+tqt+YFHUg8UiHdq4AMLgaCbnWA=; b=NPRhgmA7gE8uKPtbz4UCHT3
	JPYIY5EYRPjA/nXRZc4r8XhXgvkWHei1BeyTIPAGdiAJNyx7PcB1dNNmb1LhOxSB
	E/wenxE9qy/6/Amm+5RPLK4alz1Gc/MW35qZt72CsZoPy23s6IB8Hx0ILCD3yOdF
	u2CZM992ts9YUADMt25hWsTYUhGwK1umsm9PwjPb7b30GqGLpeU2NG6jZbMeFkob
	K47moBabHqLMifRdsIJNJMknhSZmFI72/phE2zE3goLDQPMcF/l8xtOUfLcQXlTf
	dzMFaGBm0uhhUSJs8cpfpqRCPbt9lsnByf8q00A38q2/zJRtrL5xU9ukKwbOteA=
	=
X-Virus-Scanned: by amavisd-new at lrz.de in lxmhs52.srv.lrz.de
X-Spam-Flag: NO
X-Spam-Score: -2.885
X-Spam-Level:
X-Spam-Status: No, score=-2.885 tagged_above=-999 required=5
	tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, LRZ_DATE_TZ_0000=0.001,
	LRZ_DKIM_DESTROY_MTA=0.001, LRZ_DMARC_LRZ_FAIL=0.001,
	LRZ_DMARC_OVERWRITE=0.001, LRZ_ENVFROM_LRZ_S=0.001,
	LRZ_FROM_AP_PHRASE=0.001, LRZ_FROM_LRZ_S=0.001, LRZ_FROM_PHRASE=0.001,
	LRZ_FROM_PRE_SUR_ADDR=0.001, LRZ_FWD_MS_EX=0.001,
	LRZ_HAS_X_ORIG_IP=0.001, LRZ_MSGID_HL32=0.001,
	LRZ_MSGID_SPAM_68=0.001, LRZ_RCVD_MS_EX=0.001, SPF_HELO_NONE=0.001]
	autolearn=no autolearn_force=no
Received: from postout2.mail.lrz.de ([127.0.0.1])
	by lxmhs52.srv.lrz.de (lxmhs52.srv.lrz.de [127.0.0.1]) (amavisd-new, port 20024)
	with LMTP id IHbGhzE-CuXk; Wed,  6 Apr 2016 13:47:45 +0200 (CEST)
Received: from BADWLRZ-SWMBX03.ads.mwn.de (BADWLRZ-SWMBX03.ads.mwn.de [IPv6:2001:4ca0:0:108::159])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))
	(Client CN "BADWLRZ-SWMBX03", Issuer "BADWLRZ-SWMBX03" (not verified))
	by postout2.mail.lrz.de (Postfix) with ESMTPS id 3qg3r14gSYzyRR;
	Wed,  6 Apr 2016 13:47:45 +0200 (CEST)
Received: from BADWLRZ-SWMBX03.ads.mwn.de (2001:4ca0:0:108::159) by
 BADWLRZ-SWMBX03.ads.mwn.de (2001:4ca0:0:108::159) with Microsoft SMTP Server
 (TLS) id 15.0.1156.6; Wed, 6 Apr 2016 13:47:45 +0200
Received: from BADWLRZ-SWMBX03.ads.mwn.de ([fe80::7c52:cc37:21a8:1966]) by
 BADWLRZ-SWMBX03.ads.mwn.de ([fe80::7c52:cc37:21a8:1966%12]) with mapi id
 15.00.1156.000; Wed, 6 Apr 2016 13:47:45 +0200
From: "Bader, Reinhold" <Reinhold.Bader@lrz.de>
To: "mexas@bris.ac.uk" <mexas@bris.ac.uk>, "j3@mailman.j3-fortran.org"
	<j3@mailman.j3-fortran.org>
CC: "sc22wg5@open-std.org" <sc22wg5@open-std.org>
Subject: AW: (SC22WG5.5700) [ukfortran] AW: (j3.2006)  coarray dummy arguments
Thread-Topic: (SC22WG5.5700) [ukfortran] AW: (j3.2006)  coarray dummy
 arguments
Thread-Index: AQHRj+iLw/ajIVelkE6JNHiblczHep980VaQ
Date: Wed, 6 Apr 2016 11:47:45 +0000
Message-ID: <ca97fbd97aec4559846524e1cfaa8e8f@BADWLRZ-SWMBX03.ads.mwn.de>
References: <20160405233438.6AE86358789@www.open-std.org>
 <20160406093950.12605358720@www.open-std.org>
In-Reply-To: <20160406093950.12605358720@www.open-std.org>
Accept-Language: de-DE, en-US
Content-Language: de-DE
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [2001:4ca0:0:f034::7]
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

Hi Anton,

> -----Urspr=FCngliche Nachricht-----
> Von: owner-sc22wg5@open-std.org [mailto:owner-sc22wg5@open-std.org] Im
> Auftrag von Anton Shterenlikht
> Gesendet: Mittwoch, 6. April 2016 05:37
> An: j3@mailman.j3-fortran.org; Bader, Reinhold <Reinhold.Bader@lrz.de>
> Cc: sc22wg5@open-std.org
> Betreff: (SC22WG5.5700) [ukfortran] AW: (j3.2006) coarray dummy arguments
>=20
> Hi Reinhold
>=20
> Your example makes your point much clearer.
> Still...
>=20
> > Image 1:
> >
> > INTEGER  ::  I[*] =3D 0
> >
> > I[2] =3D 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
>=20
> 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 referen=
ced, defined, or become undefined
4 in a segment on another image unless the segments are ordered".  The sugg=
ested modifications ensure
that passing it in as a dummy argument does not trigger any item in that li=
st.

(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 c=
ompleted, on image 1.)

Cheers=20
Reinhold

> "I" is used on image 2 as actual argument when calling subroutine S1. I b=
elieve
> that to conform, SYNC IMAGES( [1,2] ) must appear before CALL S1(I, IL).
>=20
> 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.
>=20
> Anton
