[mpich2-commits] r7910 - mpich2/trunk/src/mpi/attr

gropp at mcs.anl.gov gropp at mcs.anl.gov
Fri Feb 4 09:51:03 CST 2011


Author: gropp
Date: 2011-02-04 09:51:03 -0600 (Fri, 04 Feb 2011)
New Revision: 7910

Modified:
   mpich2/trunk/src/mpi/attr/attrutil.c
   mpich2/trunk/src/mpi/attr/comm_get_attr.c
Log:
Fix for incorrect handling of Fortran predefined attribute values on bigendian/64 bit systems, see ticket #1158

Modified: mpich2/trunk/src/mpi/attr/attrutil.c
===================================================================
--- mpich2/trunk/src/mpi/attr/attrutil.c	2011-02-04 15:47:09 UTC (rev 7909)
+++ mpich2/trunk/src/mpi/attr/attrutil.c	2011-02-04 15:51:03 UTC (rev 7910)
@@ -352,7 +352,7 @@
     return ret;
 }
 
-
+/* FIXME: Missing routine description */
 void
 MPIR_Keyval_set_proxy(
     int keyval,

Modified: mpich2/trunk/src/mpi/attr/comm_get_attr.c
===================================================================
--- mpich2/trunk/src/mpi/attr/comm_get_attr.c	2011-02-04 15:47:09 UTC (rev 7909)
+++ mpich2/trunk/src/mpi/attr/comm_get_attr.c	2011-02-04 15:51:03 UTC (rev 7910)
@@ -194,11 +194,16 @@
 	   it here. */
 	if (*flag) {
             /* Use the internal pointer-sized-int for systems (e.g., BG/P)
- *             that define MPI_Aint as a different size that MPIR_Pint */
+               that define MPI_Aint as a different size than MPIR_Pint.
+	       The casts must be as they are:
+	       On the right, the value is a pointer to an int, so to 
+	       get the correct value, we need to extract the int.
+	       On the left, the output type is given by the argument 
+	       outAttrType - and the cast must match the intended results */
 	    if (outAttrType == MPIR_ATTR_AINT)
-		*(MPIR_Pint*)attr_val_p = *(MPIR_Pint*)*(void **)attr_val_p;
+		*(MPIR_Pint*)attr_val_p = *(int*)*(void **)attr_val_p;
 	    else if (outAttrType == MPIR_ATTR_INT)
-		*(MPIR_Pint*)attr_val_p = *(int *)*(void **)attr_val_p;
+		*(int*)attr_val_p = *(int *)*(void **)attr_val_p;
 	}
     }
     else {



More information about the mpich2-commits mailing list