MPI Forum Meetings logo

MPI Forum: mpi3-fortran Mailing List Archives

all MPI Forum: mpi3-fortran mailing list

Subject: Re: [MPI3 Fortran] Proposing changes to Fortran 2008
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2008-03-20 11:19:25


On Mar 20, 2008, at 11:13 AM, Craig Rasmussen wrote:
> Yes, but the same size hole would exist for the "companion" C struct
> as well. So however you calculate stride information for C would
> work for an interoperable derived type in Fortran as well. Suppose
> foo were,
>
> struct foo {
> char a;
> char b;
> int i;
> char c;
> char d;
> }

Ok, but you said everything in Fortran had to be contiguous. With a
hole, by definition, it's not contiguous (and, per my other mails, you
can be much more arbitrary, such as skipping the "b" field in the
struct above). Does Fortran have a different definition of
"contiguous" than C? :-)

> Don't you have to worry about the C compiler reordering the elements
> of foo?

With C++, perhaps. With C, no.

Regardless, if you construct the MPI datatype (map) at run-time, then
MPI will get the Right values for offsets into the memory map because
you actually measure the distances/offsets at run-time (vs. compile-
time).

-- 
Jeff Squyres
Cisco Systems