[MPI3 Fortran] MPI Data types

Craig Rasmussen crasmussen at newmexicoconsortium.org
Thu May 7 12:38:47 CDT 2009


On May 7, 2009, at 9:33 AM, N.M. Maclaren wrote:

> On May 7 2009, Jeff Squyres wrote:
>> On May 7, 2009, at 9:29 AM, Bill Long wrote:
>>
>>> So, inside a wrapper C wrapper routine,  could the information   
>>> available
>>> in our Cdesc structure be used create the corresponding MPI  
>>> datatype,
>>> and then use that in the internal MPI Call?   This avoids the  
>>> need  for a
>>> copy at all, does not require any modifications to the Request data
>>> structure, and also relieves the Fortran user from creating his  
>>> own  MPI
>>> datatype.  This sounds like the best solution yet.  (Or , maybe  
>>> that's
>>> been the plan all along, and I've just figured it out :) ).
>
> That is what I was attempting to suggest yesterday, but clearly didn't
> succeed.  Either technique would work.
>> That would be suitable for a Fortran value-add/add-on library.  It  
>> is  not suitable for the Fortran MPI bindings, unfortunately -- we  
>> need to  preserve pretty much a 1:1 mapping of Fortran functions to  
>> C functions  for the official bindings.
>
> That means you have to stick to non-standard Fortran 77.  Sorry, but  
> the
> memory models of C and Fortran just don't overlap on any superset.
>
>> Craig has talked about making a value-add Fortran library that  
>> would  do stuff like this (similar to how the Boost.MPI library did  
>> this for C ++).
>
> I thought that we were discussing features to enable MPI-3 to  
> support things
> like Fortran array arguments that have no equivalent in C (principally
> assumed shape).

The minimal MPI library will just grab the buffer pointer and send the  
count number of elements.  It will effectively ignore what is really  
in the array descriptor.  A good MPI implementation should at least  
return an error where the user does the wrong thing according to the C  
semantics.  There will be the possibility for runtime errors, the  
compiler won't help with this but the MPI library can check.

-craig



More information about the mpiwg-fortran mailing list