[MPI3 Fortran] MPI function symbol naming convention for tools
Martin Schulz
schulzm at llnl.gov
Thu Jun 23 02:39:02 CDT 2011
Hi Jeff and Bill,
On Jun 22, 2011, at 12:16 PM, Bill Long wrote:
>
>
> On 6/22/11 11:48 AM, Jeff Squyres wrote:
>> Martin --
>>
>> It is important to realize the difference between the different Fortran bindings.
Sure.
>>
>> The "old" form (via include 'mpif.h') will still be available, and (likely) use whatever mechanism an implementation used for it before (e.g., have an underlying symbol for MPI_RECV as mpi_recv, MPI_RECV, mpi_recv_, and/or mpi_recv__). These will likely also be the same underlying symbols for the "use mpi" interface.
Great - that was my question. This means that existing tools
are still compatible with existing codes. This was my main
concern.
>>
>> However, the "use mpi_f08" interface uses different parameter types than mpi.h/use mpi. So it has a different back-end function for MPI_RECV than the other two. Modern fortran also allows us to specify what the back-end symbol name will be; hence, Craig is proposing a specific set of back-end symbol names for the "use mpi_f08" functions like MPI_RECV that will be different than those used for mpif.h and "use mpi". This will actually allow tool authors to know for sure what the symbol names will be.
That makes more sense now - just to clarify: the new names only
apply if an application uses "use mpi_f08", otherwise the old
interface applies. Is this correct?
>>
>
> A bit more detail here: If you specify BIND(C, name="Jeff") in Fortran
> the external symbol is the same as the external symbol for a C object
> named Jeff in C source code. If the C compiler does some sort of name
> mangling for external symbols, then the Fortran compiler is required to
> do the SAME mangling on its name. That way you can look at the Fortran
> and C statements and see the same names and know they correspond. If,
> as is common, the C name is the same as the back-end symbol, they the
> the name= specifier does end up specifying the back-end symbol as well.
> But the rule is in terms of the C name.
That sounds good.
>
> Cheers,
> Bill
>
>
>> So in one sense, we're not breaking tools because the use mpi_f08 interface is new.
I read Craig's email as if the existing interface (without using mpi_f08)
would get the new symbol as well. If I read you right, this is not the case.
>>
>> In another sense, if we mandate specific symbols for mpif.h/use mpi, we might break some tools, but put ourselves in a better place for the future. Since a tool already has to sense which back-end symbol to use mpif.h/use mpi (lower case, caps, 1 underscore, 2 underscores -- none of which are mandated by the Fortran spec, by the way; it's just common convention), is it really a hardship to add another symbol name to check during the tools configuration/building mechanism?
I am more worrying about existing tools - those would all
have to be changed.
Martin
>>
>>
>>
>>
>> On Jun 22, 2011, at 12:12 PM, Rasmussen, Craig E wrote:
>>
>>>
>>> On Jun 20, 2011, at 9:45 PM, Martin Schulz wrote:
>>>
>>>> Hi Craig, all,
>>>>
>>>> (I cc-ed the tools group on this as well - this is regarding the
>>>> issue how the profiling interface will work with the proposed
>>>> new Fortran bindings):
>>>>
>>>>
>>>> On Jun 20, 2011, at 10:15 AM, Rasmussen, Craig E wrote:
>>>>
>>>>> I've talked with Jeff Squyres and we come up with naming convention that we'd like to propose for tools to have access to Fortran.
>>>>>
>>>>> I believe we need four different symbol naming conventions. Consider MPI_Recv(), the four functions are
>>>>>
>>>>> 1. mpi_recv_f
>>>>> - This function implements (in C or Fortran) MPI_Recv with integer handles and the choice buffer passed by address.
>>>>
>>>> Does this mean the existing mpi_recv binding will go away?
>>>> This would break any existing tool. Can we keep the old naming
>>>> scheme for the old interface? Or is this intended as an additional
>>>> symbol?
>>>
>>> Hum and YUK. There really isn't an mpi_recv symbol as the Fortran compilers mangle the name. We could keep the old mixed up name mangling scheme (and hopefully deprecate it) for the mpif.h usage. This proposal give the C tools writer a common symbol name hook rather than compiler dependent mangling.
>>>
>>>>
>>>>>
>>>>> 2. mpi_recv_f_nostatus
>>>>> - This function implements (in C or Fortran) MPI_Recv with integer handles without a status variable and the choice buffer passed by address.
>>>>
>>>> Is this just for the new bindings?
>>>
>>> New bindings only but could be made available to "use mpi" users.
>>>
>>>>
>>>>>
>>>>> 3. mpi_recv_f08
>>>>> - This function implements (in C or Fortran) MPI_Recv with integer handles and the choice buffer passed via an array descriptor.
>>>>>
>>>>> 4. mpi_recv_f_nostatus
>>>>> - This function implements (in C or Fortran) MPI_Recv with integer handles without a status variable and the choice buffer passed via an array descriptor.
>>>>
>>>> I assume you mean mpi_recv_f08_nostatus?
>>>
>>> Yes. But Steve requested a name change to mpi_recv_desc and mpi_recv_desc_nostatus.
>>>
>>>>
>>>>>
>>>>> Note that these functions only need to support integer handles because of the way we (thanks to Rolf) have chosen to define the handle types in the mpi_f08 module.
>>>
>>> I should say support integer handles in C. If implemented in Fortran the interface would be with typed Fortran handles for mpi_recv_desc and mpi_recv_desc_nostatus.
>>>
>>> -craig
>>> _______________________________________________
>>> mpi3-fortran mailing list
>>> mpi3-fortran at lists.mpi-forum.org
>>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-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
>
>
________________________________________________________________________
Martin Schulz, schulzm at llnl.gov, http://people.llnl.gov/schulzm
CASC @ Lawrence Livermore National Laboratory, Livermore, USA
More information about the mpiwg-fortran
mailing list