From owner-sc22wg5@open-std.org  Sat Jan 24 00:22:02 2009
Return-Path: <owner-sc22wg5@open-std.org>
X-Original-To: sc22wg5-dom7
Delivered-To: sc22wg5-dom7@www2.open-std.org
Received: by www2.open-std.org (Postfix, from userid 521)
	id ACC2CCA6002; Sat, 24 Jan 2009 00:22:02 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
Received: from mail1.cray.com (mail1.cray.com [136.162.0.111])
	by www2.open-std.org (Postfix) with ESMTP id 753E7CA5FED
	for <sc22wg5@open-std.org>; Sat, 24 Jan 2009 00:22:00 +0100 (CET)
Received: from beaver.us.cray.com (beaver.us.cray.com [172.30.74.51])
	by mail1.cray.com (8.13.6/8.13.3/gw-5323) with ESMTP id n0NNLmmk005550
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Jan 2009 17:21:48 -0600 (CST)
Received: from CFEXFE01.us.cray.com (cfexfe01.us.cray.com [172.30.74.93])
	by beaver.us.cray.com (8.13.8/8.13.3/hub-5273) with ESMTP id n0NNLinK000671;
	Fri, 23 Jan 2009 17:21:45 -0600
Received: from mh-dhcp-172-31-16-180.us.cray.com ([172.31.16.180]) by CFEXFE01.us.cray.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959);
	 Fri, 23 Jan 2009 17:21:45 -0600
Message-ID: <497A51B9.3080304@cray.com>
Date: Fri, 23 Jan 2009 17:24:41 -0600
From: Bill Long <longb@cray.com>
Reply-To: longb@cray.com
Organization: Cray Inc.
User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031)
MIME-Version: 1.0
To: Van.Snyder@jpl.nasa.gov,
	MPI-3 Fortran working group <mpi3-fortran@lists.mpi-forum.org>
Cc: WG5 <sc22wg5@open-std.org>
Subject: Re: [MPI3 Fortran] (j3.2006) (SC22WG5.3917)	(SC22WG5.3909)	[ukfortran]
 [MPI3	Fortran] MPI	non-blocking transfers
References: <Prayer.1.3.1.0901211104060.5654@hermes-2.csi.cam.ac.uk>	<49776DF7.1040900@cray.com>	<20090121211748.130A5C178D9@www2.open-std.org>	<20090121224014.6CB63C178D9@www2.open-std.org>	<20090121234200.4F3BDCA3434@www2.open-std.org>	<20090122000407.D5A8ECA3434@www2.open-std.org>	<Prayer.1.3.1.0901221006510.28472@hermes-2.csi.cam.ac.uk>	<1232658808.15119.824.camel@math.jpl.nasa.gov>	<20090123095622.CBD80CA5FED@www2.open-std.org>	<20090123190515.A5B24CA5FE6@www2.open-std.org>	<497A1CE5.3000708@cray.com>	<Prayer.1.3.1.0901232009180.25233@hermes-2.csi.cam.ac.uk>	<20090123204209.615C8CA5FED@www2.open-std.org> <1232747203.15119.979.camel@math.jpl.nasa.gov>
In-Reply-To: <1232747203.15119.979.camel@math.jpl.nasa.gov>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 23 Jan 2009 23:21:45.0046 (UTC) FILETIME=[5B414F60:01C97DB1]
X-Cray-VirusStatus: clean
Sender: owner-sc22wg5@open-std.org
Precedence: bulk



Van Snyder wrote:
> On Fri, 2009-01-23 at 12:44 -0800, Bill Long wrote:
>
>   
>> The problem is solved for asynchronous I/O in Fortran by exactly the
>> same means.  The solution relies on C1239 and C1240 [299:12-19] in
>> 09-007.  If you violate either of these constraints, your program will
>> be rejected by the compiler and you have to fix it....  If we plan to
>> base a solution on asynchronous (or volatile) for MPI, then the
>> solution is exactly the same as for asynchronous I/O in Fortran.
>>     
>
> Since solutions exist for asynchronous Fortran I/O, which is
> indistinguishable from MPI hiding in an external procedure, why are we
> having this conversation?
>
> Just write an extra layer to get at MPI_wait, having an assumed-shape
> buffer dummy argument with the ASYNCHRONOUS attribute and without the
> CONTIGUOUS attribute.  Since the buffer dummy won't be referenced, make
> the procedure external, or better yet, write it in C, so a clever
> optimizer won't inline it, notice the buffer isn't used, and then move
> accesses to the buffer across the remaining reference to MPI_wait, which
> is the present problem.
>
>   

The copy-in/copy-out problem does not affect MPI_wait.  There's no 
argument to copy anyway.  Copy-in/copy-out is a serious problem for the 
earlier call to MPI_Isend, etc. where you do not want the copy temp 
being the buffer MPI sees, since it will get deleted when the call 
returns (which is before MPI is done with it.)   This continues with any 
subsequent call to other routines that have the buffer as the argument, 
because a copy-out runs the risk of overwriting the buffer with the 
wrong values.

Cheers,
Bill

-- 
Bill Long                                   longb@cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120

            

