[MPI3 Fortran] Proposing changes to Fortran 2008

Jeff Squyres jsquyres at cisco.com
Thu Mar 20 10:19:25 CDT 2008


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




More information about the mpiwg-fortran mailing list