[mpich2-commits] r9544 - mpich2/trunk/src/mpi/coll

balaji at mcs.anl.gov balaji at mcs.anl.gov
Mon Feb 27 23:32:11 CST 2012


Author: balaji
Date: 2012-02-27 23:32:10 -0600 (Mon, 27 Feb 2012)
New Revision: 9544

Modified:
   mpich2/trunk/src/mpi/coll/alltoall.c
Log:
Bug-fix: For MPI_ALLTOALL, do error checking on sendcount and sendtype
only when the send buffer is not MPI_IN_PLACE.  See tt#1564.

Modified: mpich2/trunk/src/mpi/coll/alltoall.c
===================================================================
--- mpich2/trunk/src/mpi/coll/alltoall.c	2012-02-28 04:01:24 UTC (rev 9543)
+++ mpich2/trunk/src/mpi/coll/alltoall.c	2012-02-28 05:32:10 UTC (rev 9544)
@@ -784,15 +784,19 @@
 	    
             MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
             if (mpi_errno != MPI_SUCCESS) goto fn_fail;
-	    MPIR_ERRTEST_COUNT(sendcount, mpi_errno);
+
+            if (sendbuf != MPI_IN_PLACE) {
+                MPIR_ERRTEST_COUNT(sendcount, mpi_errno);
+                MPIR_ERRTEST_DATATYPE(sendtype, "sendtype", mpi_errno);
+                if (HANDLE_GET_KIND(sendtype) != HANDLE_KIND_BUILTIN) {
+                    MPID_Datatype_get_ptr(sendtype, sendtype_ptr);
+                    MPID_Datatype_valid_ptr( sendtype_ptr, mpi_errno );
+                    MPID_Datatype_committed_ptr( sendtype_ptr, mpi_errno );
+                }
+            }
+
 	    MPIR_ERRTEST_COUNT(recvcount, mpi_errno);
-	    MPIR_ERRTEST_DATATYPE(sendtype, "sendtype", mpi_errno);
 	    MPIR_ERRTEST_DATATYPE(recvtype, "recvtype", mpi_errno);
-            if (HANDLE_GET_KIND(sendtype) != HANDLE_KIND_BUILTIN) {
-                MPID_Datatype_get_ptr(sendtype, sendtype_ptr);
-                MPID_Datatype_valid_ptr( sendtype_ptr, mpi_errno );
-                MPID_Datatype_committed_ptr( sendtype_ptr, mpi_errno );
-            }
             if (HANDLE_GET_KIND(recvtype) != HANDLE_KIND_BUILTIN) {
                 MPID_Datatype_get_ptr(recvtype, recvtype_ptr);
                 MPID_Datatype_valid_ptr( recvtype_ptr, mpi_errno );



More information about the mpich2-commits mailing list