[MPI3 Fortran] Incorporating input to naming convention
Rasmussen, Craig E
rasmussn at lanl.gov
Fri Jul 8 09:43:11 CDT 2011
Unless I hear major complaints, my goal is to change my Open MPI implementation to take these changes into account.
-craig
On Jul 8, 2011, at 8:39 AM, Rasmussen, Craig E wrote:
> I've put together a proposed solution to the MPI-3 naming convention for Fortran that incorporates input for emails and discussions over the past few days. Jeff and I had a long conversation yesterday and I was able to read Rolf's email from June 30.
>
> As Rolf points out, there has to be two naming conventions, one for existing compilers and one for compilers implementing the Interop TR (TR29113) as explained in detail below. Plus there are the existing interfaces for mpif.h and use-mpi. These will be left without changes.
>
> 1. Interface and naming convention for existing compilers. MPI handles will have the BIND(C) attriburte. But the procedures do not contain the BIND attribute and therefore the binding label is compiler dependent (as we have with existing interfaces). All MPI names will have the suffix "_f08" attached. C implementations will support contiguous choice buffer arguments as they currently do. Example:
>
> interface MPI_Recv
>
> subroutine MPI_Recv_f08(buf, ...) ! binding labels will be MPI_RECV_F08, mpi_recv_f08, mpi_recv_f08_, mpi_recv_f08__, ...
> ! use ignore TKR directive if possible for buf, overloaded functions for MPI numeric types otherwise
> end subroutine
>
> end interface
>
> A PMPI user may override this interface in Fortran with:
>
> subroutine MPI_Recv_f08(buf, ...)
> ! ...
> call PMPI_Recv_f08(buf, ...)
> end subroutine
>
>
> 2. Interface and naming convention for TR29113 compliant compilers. MPI handles will have the BIND(C) attriburte. Procedures will contain the BIND attribute with a binding label. This is required to allow descriptors to be passed to C. All MPI names use the MPI C naming convention (mixed case) and will have the suffix "_f08" attached. C implementations will have to support descriptors for choice buffers and character strings. Example:
>
> interface MPI_Recv
>
> subroutine MPI_Recv_f08(buf, ...) BIND(C, name="MPI_Recv_f08")
> TYPE(*), DIMENSION(..) :: buf
> end subroutine
>
> end interface
>
> A PMPI user may override this interface in Fortran with:
>
> subroutine MPI_Recv_f08(buf, ...) BIND(C, name="MPI_Recv_f08")
> ! ...
> call PMPI_Recv_f08(buf, ...)
> end subroutine
>
>
> Further notes:
>
> 1. Users won't see a difference as compilers begin to TR29113. They modify there codes to:
> a. Use typed handles, e.g., TYPE(MPI_Comm)
> b. Use Fortran character strings (as they do now).
> c. Call MPI procedures using normal conventions, e.g., CALL MPI_Recv(buf, ...)
>
> 2. The mixed case name for the binding label for TR29113 interfaces cannot be all lower case as it will collide with possible binding labels for non TR29113 compliant compilers.
>
> 3. For overloaded functions an additional suffix is applied to the binding label: _nostatus, _noweights, ...
>
> 4. While an interim solution is required (interfaces in #1 above), it will be allowed to die a natural death as compilers begin to implement TR29113. Eventually there will be a time when C tool writers won't have to deal with the multiple symbol madness that currently exists. There will be two C names to implement, e.g., MPI_Recv_f08, MPI_Recv_f08_nostatus. Again regular MPI users won't notice the change.
>
> 5. I believe this meets Rolf's constraints:
>
>> C1. Do not break ABI backward compatibility.
>> (Hubert is asolutely right!)
>> C2. Do not break PMPI.
>> (Thanks to the tools people who pointed this out)
>> C3. Each interface has different linker names.
>> These linker names are well defined and must be
>> used if a user wants to substitute an MPI routine
>> by a user-written wrapper:
>> - MPI_Recv for the C interface
>> - MPI::Recv for the C++ interface
>> - mpi_recv_ (or whatever the Fortran compiler has chosen)
>> for Fortran mpif.h or mpi module
>
> However I've included wrappers using binding labels like MPI_Recv_f08. This standardized name is absolutely required to write portable code for compilers that implement TR29113.
>
> Cheers,
> Craig
>
>
> _______________________________________________
> mpi3-fortran mailing list
> mpi3-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran
More information about the mpiwg-fortran
mailing list