|
From: <sv...@va...> - 2006-03-12 13:37:26
|
Author: sewardj
Date: 2006-03-12 13:37:19 +0000 (Sun, 12 Mar 2006)
New Revision: 5752
Log:
sizeofOneNamedTy(): handle long double correctly on non-x86/amd64 platfor=
ms.
Modified:
trunk/auxprogs/mpiwrap.c
Modified: trunk/auxprogs/mpiwrap.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/mpiwrap.c 2006-03-12 13:36:06 UTC (rev 5751)
+++ trunk/auxprogs/mpiwrap.c 2006-03-12 13:37:19 UTC (rev 5752)
@@ -377,7 +377,10 @@
exact size of one item of the type, NOT the size of it when padded
suitably to make an array of them. In particular that's why the
size of LONG_DOUBLE is 10 and not sizeof(long double), since the
- latter is 12 at least on x86. Ref: MPI 1.1 doc p18 */
+ latter is 12 at least on x86. Except if sizeof(long double) is
+ claimed to be 8 then we'd better respect that.
+
+ Ref: MPI 1.1 doc p18 */
static long sizeofOneNamedTy ( MPI_Datatype ty )
{
if (ty =3D=3D MPI_CHAR) return sizeof(signed char);
@@ -390,8 +393,10 @@
if (ty =3D=3D MPI_UNSIGNED_LONG) return sizeof(unsigned long int);
if (ty =3D=3D MPI_FLOAT) return sizeof(float);
if (ty =3D=3D MPI_DOUBLE) return sizeof(double);
- if (ty =3D=3D MPI_LONG_DOUBLE) return 10; /* NOT: sizeof(long doub=
le); */
if (ty =3D=3D MPI_BYTE) return 1;
+ if (ty =3D=3D MPI_LONG_DOUBLE)
+ return sizeof(long double)=3D=3D8=20
+ ? 8 : 10; /* NOT: sizeof(long double); */
/* MPI_PACKED */
/* new in MPI2: */
# if defined(MPI_WCHAR)
|