[mpich2-commits] r7663 - mpich2/trunk/src/mpi/pt2pt

goodell at mcs.anl.gov goodell at mcs.anl.gov
Tue Jan 4 15:46:49 CST 2011


Author: goodell
Date: 2011-01-04 15:46:49 -0600 (Tue, 04 Jan 2011)
New Revision: 7663

Modified:
   mpich2/trunk/src/mpi/pt2pt/bsendutil.c
Log:
fix for bad buffer_attach fix, r7659, and ticket #1149

Bill was sharp and caught my mistake, which didn't entirely replace
sizeof(void*) with align_sz.

No reviewer.

Modified: mpich2/trunk/src/mpi/pt2pt/bsendutil.c
===================================================================
--- mpich2/trunk/src/mpi/pt2pt/bsendutil.c	2011-01-04 20:02:14 UTC (rev 7662)
+++ mpich2/trunk/src/mpi/pt2pt/bsendutil.c	2011-01-04 21:46:49 UTC (rev 7663)
@@ -130,10 +130,11 @@
     BsendBuffer.buffer_size	= buffer_size;
 
     /* Make sure that the buffer that we use is aligned to align_sz.  Some other
-       code assumes pointer-alignment, and some code assumes double alignment
-       (see #1149). */
+       code assumes pointer-alignment, and some code assumes double alignment.
+       Further, GCC 4.5.1 generates bad code on 32-bit platforms when this is
+       only 4-byte aligned (see #1149). */
     align_sz = MPIR_MAX(sizeof(void *), sizeof(double));
-    offset = ((size_t)buffer) % sizeof(void *);
+    offset = ((size_t)buffer) % align_sz;
     if (offset) {
         offset = align_sz - offset;
 	buffer = (char *)buffer + offset;



More information about the mpich2-commits mailing list