[MPI3 Fortran] Specify IN/OUT/INOUT in MPI spec?

Hubert Ritzdorf ritzdorf at it.neclab.eu
Thu May 28 11:44:58 CDT 2009


BUF must have INTENT (INOUT) since MPI_Send ()
can receive data into the buffer (for non-contiguous datatypes; or after
count elements).

Hubert

Lionel, Steve wrote:
> Here's how I'd do it.  I'm assuming that MPI_INT_KIND exists and I used IMPORT from F2003 assuming that the types and kinds were defined elsewhere in the same module.  How this might be represented in the text of the standard could vary.
>
> subroutine MPI_SEND(BUF, COUNT, DATATYPE, DEST, TAG, COMM, IERROR)
>   import
>   <type>, dimension(*), intent(IN) ::BUF
>   integer(MPI_INT_KIND), intent(IN) :: COUNT
>   integer(MPI_INT_KIND), intent(IN) :: DATATYPE
>   integer(MPI_INT_KIND), intent(IN) :: DEST
>   integer(MPI_INT_KIND),  intent(IN) :: TAG
>   integer(MPI_INT_KIND),  intent(IN) :: COMM
>   integer(MPI_INT_KIND),  intent(OUT) :: IERROR
>   end subroutine MPI_SEND
>
> subroutine MPI_STARTALL(COUNT, ARRAY_OF_REQUESTS, IERROR)
>   import
>   integer(MPI_INT_KIND),  intent(IN) :: COUNT
>   integer(MPI_INT_KIND),  dimension(*), intent(INOUT) :: ARRAY_OF_REQUESTS
>   integer(MPI_INT_KIND),  intent(OUT) :: IERROR
>   end subroutine MPI_STARTALL
>
> subroutine MPI_TYPE_CREATE_STRUCT(COUNT, ARRAY_OF_BLOCKLENGTHS, &
>      ARRAY_OF_DISPLACEMENTS, ARRAY_OF_TYPES, NEWTYPE, IERROR)
>   import
>   integer(MPI_INT_KIND), intent(IN) :: COUNT
>   integer(MPI_INT_KIND),  dimension(*), intent(IN) :: ARRAY_OF_BLOCKLENGTHS
>   integer(MPI_ADDRESS_KIND), dimension(*), intent(IN) :: ARRAY_OF_DISPLACEMENTS
>   integer(MPI_INT_KIND),  dimension(*), intent(IN) :: ARRAY_OF_TYPES
>   integer(MPI_INT_KIND),  intent(OUT) :: NEWTYPE
>   integer(MPI_INT_KIND),  intent(OUT) :: IERROR
>   end subroutine MPI_TYPE_CREATE_STRUCT
>
>
> -----Original Message-----
> From: mpi3-fortran-bounces at lists.mpi-forum.org [mailto:mpi3-fortran-bounces at lists.mpi-forum.org] On Behalf Of Jeff Squyres
> Sent: Thursday, May 28, 2009 11:21 AM
> To: MPI-3 Fortran working group
> Subject: Re: [MPI3 Fortran] Specify IN/OUT/INOUT in MPI spec?
> Importance: Low
>
> On May 28, 2009, at 10:41 AM, Lionel, Steve wrote:
>
>   
>> Yes, I can do 2b (what am I getting myself into?)
>>
>>     
>
> :-)
>
>   
>> I would have expected that the canonical form of the binding was a  
>> Fortran source of a module, but it probably is helpful to show the  
>> declaration in the standard text alongside a C binding if that's  
>> there.
>>
>>     
>
> Throughout the MPI doc, we show language neutral, C, C++, and Fortran  
> bindings for each MPI API function.  The C++ bindings may well go away  
> (yay!), and what I'm suggesting is that we include proper INTENT  
> declarations for each one.
>
> The Forum text purists will likely want to have some input on the  
> format, spacing, font, etc. of how these new bindings will appear  
> (!).  That's why I suggest that we don't do anything until I can run a  
> few examples by the Forum and see which ones they like.  That way, we  
> should get some standardized latex macros for all the Fortran bindings  
> -- then it'll just be a matter of applying those macros throughout the  
> text.
>
> I picked a few random Fortran bindings from the 2.1 doc -- can you  
> guys tell me how the text *should* read with the INTENT stuff?  I'll  
> then dither over font, spacing, etc. with the Forum to get it to their  
> liking.
>
> ! all are IN except IERROR
> MPI_SEND(BUF, COUNT, DATATYPE, DEST, TAG, COMM, IERROR)
>    <type> BUF(*)
>    INTEGER COUNT, DATATYPE, DEST, TAG, COMM, IERROR
>
> ! count is IN
> ! array_of_requests is INOUT
> ! ierror is OUT
> MPI_STARTALL(COUNT, ARRAY_OF_REQUESTS, IERROR)
>    INTEGER COUNT, ARRAY_OF_REQUESTS(*), IERROR
>
> ! all are IN except NEWTYPE and IERROR
> MPI_TYPE_CREATE_STRUCT(COUNT, ARRAY_OF_BLOCKLENGTHS,
>      ARRAY_OF_DISPLACEMENTS, ARRAY_OF_TYPES, NEWTYPE, IERROR)
>    INTEGER COUNT, ARRAY_OF_BLOCKLENGTHS(*), ARRAY_OF_TYPES(*), NEWTYPE,
>    IERROR
>    INTEGER(KIND=MPI_ADDRESS_KIND) ARRAY_OF_DISPLACEMENTS(*)
>
> Thanks!
>
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-fortran/attachments/20090528/4684769f/attachment-0001.bin>


More information about the mpiwg-fortran mailing list