[MPI3 Fortran] What if Fortran is the primary interface?

Aleksandar Donev donev1 at llnl.gov
Mon Mar 17 17:05:39 CDT 2008

On Monday 17 March 2008 14:40, Jeff Squyres wrote:

> Craig mentioned last week that if we have these opaque Fortran types  
> (with their contents unspecified), that we could be guaranteed that  
> their first member would be at the first byte of the instance.
If the type has the BIND(C) attribute, which it should, then it has exactly 
the same layout as a C struct would with the same members in the same order. 
So whatever C99 guarantees or does not guarantee applies (check the C 
standard :-). If it is not a BIND(C) datatype then there are no guarantees of 
any sort.

In C, would you make the C Interface:

void MPI_Send(..., struct MPI_Comm comm,...)

or do you want

void MPI_Send(..., struct MPI_Comm *comm,...)


Either one of these could be translated into an *equivalent* Fortran 
interface, where by equivalence I mean full binary compatibility.


More information about the mpiwg-fortran mailing list