MPI Forum Meetings logo

MPI Forum: mpi3-fortran Mailing List Archives

all MPI Forum: mpi3-fortran mailing list

Subject: Re: [MPI3 Fortran] What if Fortran is the primary interface?
From: Aleksandar Donev (donev1_at_[hidden])
Date: 2008-03-17 18:05:39


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.

Aleks