[Mpi-forum] Fortran bindings

Graham, Richard L. rlgraham at ornl.gov
Mon Oct 3 13:10:41 CDT 2011


OK - forgot about the return parameter - so thanks a lot !!!

Rich

On Oct 3, 2011, at 1:27 PM, Rasmussen, Craig E wrote:

> See answers to your questions below.
> 
> -craig
> 
> 
> On Oct 3, 2011, at 10:30 AM, Graham, Richard L. wrote:
> 
>> At the risk of upsetting the apple cart, I want to ask a question about the new proposed Fortran bindings for MPI 3.0.  I rather sure that the question I am about to ask has been addressed in the past, but to be honest, I did not understand the details of the proposal enough to note the difference.  It was not until the rather heated (and fruitful) discussions that occurred at the last meeting in Santorini, and a follow on discussion that this came up.
>> 
>> It seems to me that two options were considered with respect to these bindings:
>> - Be able to use all three versions of the Fortran bindings within a single translation unit.  The goal being to make it possible to migrate incrementally to the new proposed bindings, within the applications current file structure.
> 
> Yes.
> 
>> - Take advantage of the ability to have Fortran and C binding be exactly the same, bypassing a translation layer.
> 
> No.  We started down this path at the beginning.  However, this would have required that the Fortran procedures be functions rather than subroutines.  Early on we discussed this at length and decided that users would prefer the usage of subroutines (as is currently done in MPI).  Using functions in Fortran REQUIRES setting the return value with a variable in an assignment statement. So standard practice in Fortran is to user subroutines for most procedures.
> 
> The choice of using subroutines (a function that returns a void) means that a wrapper must be used to convert the C MPI function call.  In addition, since we have to have wrappers anyway, we decided to make MPI handles be a user defined type (think C struct) containing a single integer.  This removes a lot of messy conversions routines between new handles, C handles, and older MPI handles.  It also will allow the older wrapper functions to be called directly for most routines so implementers won't have to maintain two sets of wrappers.  The wrappers can be written in either Fortran or C.
> 
> -craig
> 
>> 
>> First, did I describe the two possibilities correctly ?  If so, why opt for the first over the second ?
>> 
> 
> I don't think these two options are mutually exclusive.  You could have both but we decided early on against the second.
> 
> -craig
> 
> 





More information about the mpi-forum mailing list