[MPIWG Fortran] F08 and pair types?

Jeff Squyres (jsquyres) jsquyres at cisco.com
Tue Dec 8 19:02:26 CST 2015

On Dec 8, 2015, at 2:44 PM, Bill Long <longb at cray.com> wrote:
>> and goes on to define an MPI Datatype that is a C float followed immediately in memory by a C int.  So the MPI standard actually defines a memory representation rather than a C struct.
> How do you handle  MPI_SHORT_INT?  A short immediately followed in memory by an int will cause the int to have bad memory alignment. 

Right.  MPI knows this; MPI_SHORT_INT will include padding between the SHORT and INT if it needs to.

> Was it the case that the starting point for the rules was the SEQUENCE type in Fortran (which might have been the only option at the time) and then force C to conform?   Today it is easier to get Fortran to mimic what is natural for C. 

There are two issues here:

1. The "good" MPI datatype name of MPI_2INTEGER is already being used; it currently means "INTEGER foo(2)".  We want to update it to mean a derived type that contains 2 INTEGERs and still be able to use the MPI datatype name "MPI_2INTEGER" without breaking existing codes.

I hear you that SEQUENCE is considered bad programming/style.  Is having the equivalence between INTEGER foo(2) and a derived type with 2 INTEGERs do-able without using SEQUENCE?

2. I wasn't looking to emulate the C types in Fortran -- I think we've had this discussion before.  The intent is to have Fortran-native types (that would be natural for Fortran programmers).  I might not have been clear when I said "parity with the C types" -- what I meant was having "Fortran-natural equivalents of the 6 C MPI_Datatypes".

Make sense?

Jeff Squyres
jsquyres at cisco.com
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/

More information about the mpiwg-fortran mailing list