[MPIWG Fortran] MPI-3 ticket 349: Fortran question
Bill Long
longb at cray.com
Fri Dec 13 13:52:44 CST 2013
On 12/13/13 11:15 AM, Craig Rasmussen wrote:
> Hum,
>
> I thought I had sent this out earlier, but just found it in my "outbox".
>
> On Dec 11, 2013, at 9: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):
>>
>> -----
>> 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
>> -----
>>
>
>
> They look ok for me. I wonder why there are two? I don't think there should be.
>
> I also think this would be an ideal place to use BIND(C). I know we had to drop BIND(C) from the official interfaces (not from within an implementation) for a number of reasons, but I think BIND(C) is a good choice for NEW routines. This will allow purely Fortran stuff to fade into the background.
>
I do not think BIND(C) is a good idea here. On of the arguments in
getting rid of BIND(C) was the ambiguity caused by specifying default
INTEGER for arguments.
BIND(C) makes sense for Fortran routines where the intent is that the
Fortran implementation is the ONLY implementation and the C users end up
calling this routine. This is right for routines that do conversions
that involve Fortran types. Until we finally throw off the yoke of
default INTEGER in the interfaces, that is about the limit of the
usefulness of BIND(C) on procedures in MPI.
Cheers,
Bill
> -craig
>
>
>
> _______________________________________________
> mpiwg-fortran mailing list
> mpiwg-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
>
--
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