From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Sat Mar 30 11:46:33 2013
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 F05AA356DD0; Sat, 30 Mar 2013 11:46:32 +0100 (CET)
Delivered-To: sc22wg5@open-std.org
Received: from ppsw-41.csi.cam.ac.uk (ppsw-41.csi.cam.ac.uk [131.111.8.141])
	by www.open-std.org (Postfix) with ESMTP id 77EEB356DC5
	for <sc22wg5@open-std.org>; Sat, 30 Mar 2013 11:46:31 +0100 (CET)
X-Cam-AntiVirus: no malware found
X-Cam-SpamDetails: not scanned
X-Cam-ScannerInfo: http://www.ucs.cam.ac.uk/email/scanner/
Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:55977)
	by ppsw-41.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:25)
	with esmtpa (EXTERNAL:nmm1) id 1ULtIp-0004Si-SV (Exim 4.72)
	(return-path <nmm1@hermes.cam.ac.uk>); Sat, 30 Mar 2013 10:46:27 +0000
Received: from prayer by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk)
	with local (PRAYER:nmm1) id 1ULtIp-0003YV-QN (Exim 4.72)
	(return-path <nmm1@hermes.cam.ac.uk>); Sat, 30 Mar 2013 10:46:27 +0000
Received: from [87.115.144.83] by webmail.hermes.cam.ac.uk
	with HTTP (Prayer-1.3.5); 30 Mar 2013 10:46:27 +0000
Date: 30 Mar 2013 10:46:27 +0000
From: "N.M. Maclaren" <nmm1@cam.ac.uk>
To: "Bader, Reinhold" <Reinhold.Bader@lrz.de>
Cc: "Van.Snyder@jpl.nasa.gov" <Van.Snyder@jpl.nasa.gov>,
    fortran standards email list for J3 <j3@mailman.j3-fortran.org>,
    sc22wg5 <sc22wg5@open-std.org>
Subject: Re: AW: (SC22WG5.4945) [ukfortran] AW: (j3.2006) Thoughts on Reinhold's
 thoughts
Message-ID: <Prayer.1.3.5.1303301046270.7686@hermes-1.csi.cam.ac.uk>
In-Reply-To: <166ED263DF83324D9A3BA67FB6772B2B59F2B4D0@BADWLRZ-SWMBX11.ads.mwn.de>
References: <20130329203623.0D66F356D96@www.open-std.org>
 <20130329212446.AD585356D97@www.open-std.org>
 <20130329231248.0A33D356DA7@www.open-std.org>
 <166ED263DF83324D9A3BA67FB6772B2B59F2B4D0@BADWLRZ-SWMBX11.ads.mwn.de>
X-Mailer: Prayer v1.3.5
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset=ISO-8859-1
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

On Mar 30 2013, Bader, Reinhold wrote:
>
> I understand your concerns (and admit that I am also out of my depth 
> where the semantics of advanced memory models are concerned), but would 
> like to make the following comments:
>
> (1) The memory model papers you reference use a concept of computation 
> that does
>      not include synchronization operations. The discussion for Fortran 
> therefore needs
>      to focus on two different levels: The first one concerning 
> operations that permit
>      memory updates in unordered segments (atomics, events) - that's
>      where the memory model is needed - , and the second one that should 
> be allowed
>      to argue on the basis of *existing* synchronization semantics 
> (teams!).

Yes and no.  They do have synchronisation operations, actually, but they
are semi-implicit.  In C++, all accesses to atomic variables potentially
imply a fence, and the default ones include a release/acquire fence.
It's not a scalable model, and is almost unimplementable except on
cache coherent shared memory.

Also, the other aspect that makes me twitch is collectives.  These
provide a communication channel that does not involve any form of
synchronisation.  In that, they are very like atomics, but are not
restricted to atomic variables :-(

> (2) The concrete examples I'd like to see of course do not constitute 
> mathematical
>      proof. But they would provide valuable heuristics simple on whether 
> or not to
>      continue considering the second alternative. 

The trouble is that taking that approach has caused absolute chaos in
the past, because this area is SO fiendish.  People have been completely
unable to produce examples that fail, programs have failed in real life,
that has been tracked down to an inconsistency in the standard, and it
has been then found to be unfixable :-(

Both POSIX threads and OpenMP have that, redoubled in spades, and it
has been 'resolved' in C and C++ only by incompatible changes to the
languages.  Even so, C++ has one serious inconsistency that I know of
(which we blocked in Fortran), and C has dozens - even excluding the
old ones of incompatibilities in the serial specification.  In older
languages, Modula 3 made a complete mess of this for the same reason,
and there were almost certainly many others.

If you can tell me a particular aspect that you are thinking of, I will
see if I can create an example.  But, currently, the proposals are just
too inchoate (= just begun, with connotations of imperfect, undeveloped
and immature) to do much more.

Regards,
Nick.

