[MPI3 Fortran] Fwd: Serious problem/bug in MPI libraries with the alignment of MPI_DOUBLE_PRECISION
N.M. Maclaren
nmm1 at cam.ac.uk
Wed Sep 28 14:04:23 CDT 2011
On Sep 28 2011, Rolf Rabenseifner wrote:
>Alexander,
>
>> Why don't we leave this to the implementation and the compiler to
>> decide?
>
>The reason is simple: It is not possible to write portable code
>according to the rule in MPI-2.2 p79:7-9
>
>"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."
>
>...
>
>In C, this should work, in Fortran there are incompatibilities
>that should be resolved with MPI-3.0.
You're kidding? That assumption is nowhere supported by the C
standard, and is demonstrably false for certain architectures.
In particular, the representation of all pointers to structures
is required to be the same (6.2.5 #27), which means that structures
must have the same alignment on any system where pointer values are
multiples of the alignment.
I have no idea whether there are any still extant, but I can tell
you that there were deliberately allowed for by WG14 during the
standardisation of C90. Furthermore, there have definitely been
some compilers where all structures had 8-byte alignment even on
byte-addressed systems, and probably still are some.
Regards,
Nick Maclaren.
More information about the mpiwg-fortran
mailing list