From owner-sc22wg5@open-std.org  Wed Dec 17 16:44:55 2008
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 98DEFC178DE; Wed, 17 Dec 2008 16:44:55 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
X-Greylist: delayed 2260 seconds by postgrey-1.18 at www2.open-std.org; Wed, 17 Dec 2008 16:44:54 CET
Received: from s-utl02-sjpop.stsn.net (s-utl02-sjpop.stsn.net [72.254.0.202])
	by www2.open-std.org (Postfix) with SMTP id 3D1C9C178D6
	for <sc22wg5@open-std.org>; Wed, 17 Dec 2008 16:44:53 +0100 (CET)
Received: from s-utl02-sjpop.stsn.net ([127.0.0.1])
 by s-utl02-sjpop.stsn.net (SMSSMTP 4.1.2.20) with SMTP id M2008121707070624687
 ; Wed, 17 Dec 2008 07:07:06 -0800
X-Spam-Status: No, hits=0.0 required=9.9
	tests=ALL_TRUSTED: -2.867,AWL: -1.964,BAYES_00: -1.665,
	DATE_IN_PAST_12_24: 0.571,HTML_20_30: 0.567,HTML_MESSAGE: 0.001,
	LOCAL_OBFU_GENERIC: 1.8,MIME_HTML_ONLY: 1.156
X-Spam-Level: 
Received: from [10.150.155.236] ([10.150.155.236])
	by s-utl02-sjpop.stsn.net;
	Wed, 17 Dec 2008 07:07:05 -0800
X-Uniform-Type-Identifier: com.apple.mail-draft
X-Apple-Mail-Signature: SKIP_SIGNATURE
From: Craig Rasmussen <crasmussen@lanl.gov>
To: MPI-3 Fortran working group <mpi3-fortran@lists.mpi-forum.org>
X-Universally-Unique-Identifier: d3385d00-15d1-43d0-aef3-710f55d939ed
Subject: Please tell me I'm wrong
X-Apple-Mail-Remote-Attachments: YES
X-Apple-Windows-Friendly: 1
Message-Id: <71DC5DE2-391C-4057-B808-C5CD6E93E177@lanl.gov>
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Apple Message framework v929.2)
X-Apple-Base-Url: x-msg://20/
Date: Tue, 16 Dec 2008 15:42:59 -0700
Cc: WG5 <sc22wg5@open-std.org>
X-Mailer: Apple Mail (2.929.2)
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; ">Without help from the Fortran =
standard, I don't think there is anyway to avoid a combinatorial =
explosion of interfaces (made worse by the F2008 with 15 dimensions). =
&nbsp;Consider the simple example code =
snippet:<br><br>---------<br><br>subroutine test_recv(message)<br> =
&nbsp;real :: message(:,:)<br><br> &nbsp;call MPI_Recv(message, 2, =
MPI_INTEGER, 1, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE)<br><br>end =
subroutine<br><br>---------<br><br>For interface =
declaration:<br><br>subroutine MPI_Recv_wrapper(buf, count, datatype, =
source, tag, comm, status, err)<br> &nbsp;real, dimension(*), =
intent(out) &nbsp;:: buf<br><br>or:<br><br>subroutine =
MPI_Recv_wrapper(buf, count, datatype, source, tag, comm, status, =
err)<br> &nbsp;real, dimension(1,1,1,1,1,1,*), intent(out) &nbsp;:: =
buf<br><br>This give the following error with the Intel =
compiler:<br><br>fortcom: Error: test_recv_call.f90, line 15: There is =
no matching specific subroutine for this generic subroutine call. =
&nbsp;&nbsp;[MPI_RECV]<br> &nbsp;call MPI_Recv(message, 2, MPI_INTEGER, =
dest, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE)<br>--------^<br><br>On the =
other hand, if we use the interface:<br><br>subroutine =
MPI_Recv_wrapper(buf, count, datatype, source, tag, comm, status, =
err)<br> &nbsp;type(C_PTR) :: buf<br><br>There is still a problem as =
assumed shape arrays are not interoperable. &nbsp;=46rom =
gfortran:<br><br> &nbsp;call MPI_Recv(C_LOC(message), 2, MPI_INTEGER, =
dest, 1, MPI_COMM_WORLD, requ<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br>Error: Assumed-shape array 'message' =
at (1) cannot be an argument to the procedure 'c_loc because it is not C =
interoperable<br><br><br>So there doesn't seem to be anyway to currently =
do multi-dimensional interfaces for assumed-shape actuals without a =
combinatorial explosion of interfaces. &nbsp;This also seems to be the =
case for assumed-size actuals as =
well.<br><br>Comments?<br><br>Cheers,<br>Craig<br><br><br></body></html>=

