[MPIWG Fortran] MPI-3 ticket 349: Fortran question

Bill Long longb at cray.com
Wed Dec 11 16:41:50 CST 2013



On 12/11/13 11:27 AM, Jeff Squyres (jsquyres) wrote:
> This ticket got a formal reading today at the Forum:
>
>      http://svn.mpi-forum.org/trac/mpi-forum-web/ticket/349
>      (as of this writing, there's still a BIND(C) in there, but it will be removed shortly)
>
> The function is basically intended to perform a mathematical operation.  As such, I think that the 2 Fortran bindings should be FUNCTIONs, not SUBROUTINEs (a la MPI_WTICK/MPI_WTIME).
>
> Do you agree?  If so, the ticket author (Jim Dinan) is amenable to changing the Fortran bindings to the following (and I'm assuming I have the syntax below correct, but feel free to correct me if they're wrong):
>

Certainly it makes more sense for these to be functions in Fortran. 
Particularly if the programmer prefers supply an interface and call the 
C form directly.  If the C and Fortran versions are both functions, 
there is no change in the source code where the function is used.

> -----
> INTEGER(KIND=MPI_ADDRESS_KIND) MPI_Aint_add(base, disp)
>      INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) ::  base, disp
>
> INTEGER(KIND=MPI_ADDRESS_KIND) MPI_AINT_ADD(BASE, DISP)
>      INTEGER(KIND=MPI_ADDRESS_KIND) BASE, DISP

It is certainly an oddity that the spec has two forms like this.  Any 
version of the Fortran standard that supports KIND= in INTEGER also 
supports lower case names and INTENT() attributes.   Maybe there could 
be some clean up of this in a future revision.

Cheers,
Bill



> -----
>

-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the mpiwg-fortran mailing list