<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Rolf,<div><br></div><div>I don't know where you get the idea that a DOUBLE PRECISION variable should occupy 4 bytes.  The standard says:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; ">A nonpointer scalar object of type double precision real or default complex occupies two contiguous numeric storage units;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><div style="font-size: medium; ">The derived types we worked out in Santorini were especially constructed so that double precisions numbers would be misaligned if the compiler was forced to do bad things via the SEQUENCE statement.  Can you give me an idea which part of the tests we wrote indicate a double precision number is 4 bytes?</div><div style="font-size: medium; "><br></div><div style="font-size: medium; ">Also, I checked the F2003 and F2008 standards and this wording (see above) has not been changed.</div><div style="font-size: medium; "><br></div><div style="font-size: medium; ">-craig</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><div style="font-size: medium; "><br></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><br></div><div><div>On Sep 28, 2011, at 11:00 AM, Rolf Rabenseifner wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><blockquote type="cite">A very good question. Instead of referring to SEQUENCE, it should say<br></blockquote><blockquote type="cite">that MPI_DOUBLE_PRECISION would use the numeric storage sequence rules<br></blockquote><blockquote type="cite">(16.4.3.1 in Fortran 2003) for alignment.<br></blockquote><br>Nick, <br>please can you explain, what "16.4.3.1 in Fortran 2003" tells<br>about alignments. <br>In SEQUENCE derived types and COMMON blocks,<br>when I understand this correctly, then DOUBLE PRECISION<br>must have also one numerical storage unit as alignment,<br>i.e., with REAL=4 bytes, DOUBLE PRECISION alignment must be<br>also 4 byte, i.e., exactly what the Intel compiler is doing<br>in a SEQUENCE derived type or COMMON block.<br><br>The implication is that the compiler issues nice "warnings" about<br>misaligned data.<br><br>Do I understand correctly, that the other compilers with <br>REAL-size=4 byte and DOUBLE PRECISION size and alignment = 8 byte,<br>do it wrong, i.e.not according to Fortran 2003 or 2008?<br><br>Best regards<br>Rolf   <br><br>----- Original Message -----<br><blockquote type="cite">From: "N.M. Maclaren" <<a href="mailto:nmm1@cam.ac.uk">nmm1@cam.ac.uk</a>><br></blockquote><blockquote type="cite">To: "Fab Tillier" <<a href="mailto:ftillier@microsoft.com">ftillier@microsoft.com</a>><br></blockquote><blockquote type="cite">Cc: "Rolf Rabenseifner" <<a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a>>, "Jeff Squyres" <<a href="mailto:jsquyres@cisco.com">jsquyres@cisco.com</a>>, "Shinji Sumimoto"<br></blockquote><blockquote type="cite"><<a href="mailto:s-sumi@labs.fujitsu.com">s-sumi@labs.fujitsu.com</a>>, "Hubert Ritzdorf" <<a href="mailto:hubert.ritzdorf@emea.nec.com">hubert.ritzdorf@emea.nec.com</a>>, "Howard Pritchard" <<a href="mailto:howardp@cray.com">howardp@cray.com</a>>,<br></blockquote><blockquote type="cite">"Brian Smith" <<a href="mailto:smithbr@us.ibm.com">smithbr@us.ibm.com</a>>, "Charles J Archer" <<a href="mailto:archerc@us.ibm.com">archerc@us.ibm.com</a>>, "Rajeev Thakur" <<a href="mailto:thakur@mcs.anl.gov">thakur@mcs.anl.gov</a>>,<br></blockquote><blockquote type="cite">"Bill Long" <<a href="mailto:longb@cray.com">longb@cray.com</a>>, "Bill Gropp" <<a href="mailto:wgropp@uiuc.edu">wgropp@uiuc.edu</a>>, "Richard Graham" <<a href="mailto:rlgraham@ornl.gov">rlgraham@ornl.gov</a>>, "Iain Bason"<br></blockquote><blockquote type="cite"><<a href="mailto:iain.bason@oracle.com">iain.bason@oracle.com</a>><br></blockquote><blockquote type="cite">Sent: Wednesday, September 28, 2011 10:26:37 AM<br></blockquote><blockquote type="cite">Subject: RE: Serious problem/bug in MPI libraries with the alignment of MPI_DOUBLE_PRECISION<br></blockquote><blockquote type="cite">On Sep 27 2011, Fab Tillier wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">It seems that all the a == 4 results come from using the Intel<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Fortran<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">compiler suite. Given that Microsoft doesn't ship a Fortran<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">compiler,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">mandating a == 8 doesn't put us in a position to succeed. Therefore,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">cannot support such a proposal.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I agree that Microsoft should not be forgotten, but it is not a major<br></blockquote><blockquote type="cite">platform for MPI use, and the tail should not wag the dog. We have the<br></blockquote><blockquote type="cite">ghastly example of C99 long long where some people claimed Microsoft<br></blockquote><blockquote type="cite">compatibility required an incompatible change to the standard; largely<br></blockquote><blockquote type="cite">as a result, the official C standard is no longer used as a portable<br></blockquote><blockquote type="cite">programming base by a good half of the C-using community.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">however, shouldn't a DOUBLE PRECISION BIND(C) derived type map to<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">MPI_DOUBLE, not MPI_DOUBLE_PRECISION?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Can't we simply document that MPI_DOUBLE_PRECISION (and any Fortran<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">types<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">that need similar treatment) apply only to SEQUENCE derived types,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">while<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">BIND(C) derived types should use the C types?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">A very good question. Instead of referring to SEQUENCE, it should say<br></blockquote><blockquote type="cite">that MPI_DOUBLE_PRECISION would use the numeric storage sequence rules<br></blockquote><blockquote type="cite">(16.4.3.1 in Fortran 2003) for alignment.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Slightly related to this, can't we PLEASE deprecate those horrible<br></blockquote><blockquote type="cite">MPI_INTEGER8 etc. types? They have been a portability disaster for<br></blockquote><blockquote type="cite">half a century, even among Fortran IV compilers (where they started)!<br></blockquote><blockquote type="cite">MPI has provided some perfectly good mechanisms to use Fortran's<br></blockquote><blockquote type="cite">selectable KINDs. The reason that it is related is that there is no<br></blockquote><blockquote type="cite">guarantee that a compiler will give them the same alignment as another<br></blockquote><blockquote type="cite">type even if they use the same storage, because they are non-standard<br></blockquote><blockquote type="cite">and therefore any specification is the compiler's choice.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Regards,<br></blockquote><blockquote type="cite">Nick Maclaren.<br></blockquote><br>-- <br>Dr. Rolf Rabenseifner . . . . . . . . . .. email <a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a><br>High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530<br>University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832<br>Head of Dpmt Parallel Computing . . . <a href="http://www.hlrs.de/people/rabenseifner">www.hlrs.de/people/rabenseifner</a><br>Nobelstr. 19, D-70550 Stuttgart, Germany . (Office: Allmandring 30)<br>_______________________________________________<br>mpi3-fortran mailing list<br><a href="mailto:mpi3-fortran@lists.mpi-forum.org">mpi3-fortran@lists.mpi-forum.org</a><br>http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran<br></div></blockquote></div><br></div></body></html>