Re: [MPI3 Fortran] Serious problem/bug in MPI libraries with the alignment of MPI_DOUBLE_PRECISION
A very good question. Instead of referring to SEQUENCE, it should say that MPI_DOUBLE_PRECISION would use the numeric storage sequence rules (16.4.3.1 in Fortran 2003) for alignment.
Nick, please can you explain, what "16.4.3.1 in Fortran 2003" tells about alignments. In SEQUENCE derived types and COMMON blocks, when I understand this correctly, then DOUBLE PRECISION must have also one numerical storage unit as alignment, i.e., with REAL=4 bytes, DOUBLE PRECISION alignment must be also 4 byte, i.e., exactly what the Intel compiler is doing in a SEQUENCE derived type or COMMON block. The implication is that the compiler issues nice "warnings" about misaligned data. Do I understand correctly, that the other compilers with REAL-size=4 byte and DOUBLE PRECISION size and alignment = 8 byte, do it wrong, i.e.not according to Fortran 2003 or 2008? Best regards Rolf ----- Original Message -----
From: "N.M. Maclaren" <[email protected]> To: "Fab Tillier" <[email protected]> Cc: "Rolf Rabenseifner" <[email protected]>, "Jeff Squyres" <[email protected]>, "Shinji Sumimoto" <[email protected]>, "Hubert Ritzdorf" <[email protected]>, "Howard Pritchard" <[email protected]>, "Brian Smith" <[email protected]>, "Charles J Archer" <[email protected]>, "Rajeev Thakur" <[email protected]>, "Bill Long" <[email protected]>, "Bill Gropp" <[email protected]>, "Richard Graham" <[email protected]>, "Iain Bason" <[email protected]> Sent: Wednesday, September 28, 2011 10:26:37 AM Subject: RE: Serious problem/bug in MPI libraries with the alignment of MPI_DOUBLE_PRECISION On Sep 27 2011, Fab Tillier wrote:
It seems that all the a == 4 results come from using the Intel Fortran compiler suite. Given that Microsoft doesn't ship a Fortran compiler, mandating a == 8 doesn't put us in a position to succeed. Therefore, I cannot support such a proposal.
I agree that Microsoft should not be forgotten, but it is not a major platform for MPI use, and the tail should not wag the dog. We have the ghastly example of C99 long long where some people claimed Microsoft compatibility required an incompatible change to the standard; largely as a result, the official C standard is no longer used as a portable programming base by a good half of the C-using community.
however, shouldn't a DOUBLE PRECISION BIND(C) derived type map to MPI_DOUBLE, not MPI_DOUBLE_PRECISION?
Can't we simply document that MPI_DOUBLE_PRECISION (and any Fortran types that need similar treatment) apply only to SEQUENCE derived types, while BIND(C) derived types should use the C types?
A very good question. Instead of referring to SEQUENCE, it should say that MPI_DOUBLE_PRECISION would use the numeric storage sequence rules (16.4.3.1 in Fortran 2003) for alignment.
Slightly related to this, can't we PLEASE deprecate those horrible MPI_INTEGER8 etc. types? They have been a portability disaster for half a century, even among Fortran IV compilers (where they started)! MPI has provided some perfectly good mechanisms to use Fortran's selectable KINDs. The reason that it is related is that there is no guarantee that a compiler will give them the same alignment as another type even if they use the same storage, because they are non-standard and therefore any specification is the compiler's choice.
Regards, Nick Maclaren.
-- Dr. Rolf Rabenseifner . . . . . . . . . .. email [email protected] High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530 University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832 Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner Nobelstr. 19, D-70550 Stuttgart, Germany . (Office: Allmandring 30)
participants (1)
-
Rolf Rabenseifner