[MPI3 Fortran] The alignment kerfluffle

Jeff Squyres jsquyres at cisco.com
Wed Sep 28 15:18:54 CDT 2011


I talked with some people about this today, re-read the entire mail threads, and summarize the takeaways from these discussions, in no particular order:

1. If the compiler can change its alignment of a given type depending on the specific situation (per NM's mail), then this is beyond the scope of MPI to "fix".

2. Open MPI's alignment test is probably wrong, but it has been wrong for a long time.  Note that we used the exact same alignment test as LAM/MPI, which goes all the way back to the mid/late 90's.  So it's been "wrong" for a very, very long time.  Apparently, no one cares.  :-)

3. Multiple people have cited on the threads that if the language itself doesn't enforce portability (in the way that Rolf is defining it), then it is madness to try to fix it in MPI.

4. As rationale for trying to fix this issue, MPI-2.2 p79 7-9 was quoted:

    The definition of extent is motivated by the assumption that 
    the amount of padding added at the end of each structure in 
    an array of structures is the least needed to fulfill 
    alignment constraints. 

But the *very next sentence* says:

    More explicit control of the extent is provided in Section 4.1.6.

Section 4.1.6 defined MPI_UB and MPI_LB and friends.  This gives credence to Bill Gropp's assertion that MPI already has the tools necessary for this issue.

5. Different environments have different sizes for un-sized types (e.g., DOUBLE PRECISION and others).  As Fab cited, one choice that a developer of portable software can make is to use explicitly-sized types (e.g., int32_t).

-----

With these points, I conclude that nothing should be done to the standard, except maybe an ATU advising them of the potential portability issue, and suggestions on how to code around it.

We'll fix the alignment test in Open MPI and I suspect that everyone will continue to not care.  :-)

-- 
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