[mpich2-commits] r7766 - mpich2/trunk/src/mpi/coll
buntinas at mcs.anl.gov
buntinas at mcs.anl.gov
Thu Jan 20 14:21:35 CST 2011
Author: buntinas
Date: 2011-01-20 14:21:35 -0600 (Thu, 20 Jan 2011)
New Revision: 7766
Modified:
mpich2/trunk/src/mpi/coll/alltoall.c
mpich2/trunk/src/mpi/coll/alltoallv.c
mpich2/trunk/src/mpi/coll/alltoallw.c
Log:
Reverted r7739 r7745 r7746 and r7747. These were an attempt to eliminate the need to send zero-byte messages in collectives. However the problem is more subtle that it looks.
Modified: mpich2/trunk/src/mpi/coll/alltoall.c
===================================================================
--- mpich2/trunk/src/mpi/coll/alltoall.c 2011-01-20 03:23:44 UTC (rev 7765)
+++ mpich2/trunk/src/mpi/coll/alltoall.c 2011-01-20 20:21:35 UTC (rev 7766)
@@ -623,10 +623,6 @@
sendaddr = (char *)sendbuf + dst*sendcount*sendtype_extent;
}
- if (sendcount == 0)
- dst = MPI_PROC_NULL;
- if (recvcount == 0)
- src = MPI_PROC_NULL;
mpi_errno = MPIC_Sendrecv(sendaddr, sendcount, sendtype, dst,
MPIR_ALLTOALL_TAG, recvaddr,
recvcount, recvtype, src,
Modified: mpich2/trunk/src/mpi/coll/alltoallv.c
===================================================================
--- mpich2/trunk/src/mpi/coll/alltoallv.c 2011-01-20 03:23:44 UTC (rev 7765)
+++ mpich2/trunk/src/mpi/coll/alltoallv.c 2011-01-20 20:21:35 UTC (rev 7766)
@@ -67,7 +67,7 @@
MPID_Comm *comm_ptr )
{
int comm_size, i, j;
- MPI_Aint send_extent, recv_extent, sendtype_size, recvtype_size;
+ MPI_Aint send_extent, recv_extent;
int mpi_errno = MPI_SUCCESS;
MPI_Status *starray;
MPI_Status status;
@@ -86,8 +86,6 @@
/* Get extent of send and recv types */
MPID_Datatype_get_extent_macro(sendtype, send_extent);
MPID_Datatype_get_extent_macro(recvtype, recv_extent);
- MPID_Datatype_get_size_macro(sendtype, sendtype_size);
- MPID_Datatype_get_size_macro(recvtype, recvtype_size);
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
@@ -105,7 +103,7 @@
for (i = 0; i < comm_size; ++i) {
/* start inner loop at i to avoid re-exchanging data */
for (j = i; j < comm_size; ++j) {
- if (rank == i && (recvcnts[j] * recvtype_size)) {
+ if (rank == i) {
/* also covers the (rank == i && rank == j) case */
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + rdispls[j]*recv_extent),
recvcnts[j], recvtype,
@@ -114,7 +112,7 @@
comm, &status);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
- else if (rank == j && (recvcnts[i] * recvtype_size)) {
+ else if (rank == j) {
/* same as above with i/j args reversed */
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + rdispls[i]*recv_extent),
recvcnts[i], recvtype,
@@ -141,7 +139,7 @@
/* do the communication -- post ss sends and receives: */
for ( i=0; i<ss; i++ ) {
dst = (rank+i+ii) % comm_size;
- if (recvcnts[dst] * recvtype_size) {
+ if (recvcnts[dst]) {
MPID_Datatype_get_size_macro(recvtype, type_size);
if (type_size) {
MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
@@ -158,7 +156,7 @@
for ( i=0; i<ss; i++ ) {
dst = (rank-i-ii+comm_size) % comm_size;
- if (sendcnts[dst] * sendtype_size) {
+ if (sendcnts[dst]) {
MPID_Datatype_get_size_macro(sendtype, type_size);
if (type_size) {
MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
@@ -230,7 +228,7 @@
*/
int local_size, remote_size, max_size, i;
- MPI_Aint send_extent, recv_extent, sendtype_size, recvtype_size;
+ MPI_Aint send_extent, recv_extent;
int mpi_errno = MPI_SUCCESS;
MPI_Status status;
int src, dst, rank, sendcount, recvcount;
@@ -245,8 +243,6 @@
/* Get extent of send and recv types */
MPID_Datatype_get_extent_macro(sendtype, send_extent);
MPID_Datatype_get_extent_macro(recvtype, recv_extent);
- MPID_Datatype_get_size_macro(sendtype, sendtype_size);
- MPID_Datatype_get_size_macro(recvtype, recvtype_size);
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
@@ -279,10 +275,6 @@
sendcount = sendcnts[dst];
}
- if (sendcount * sendtype_size == 0)
- dst = MPI_PROC_NULL;
- if (recvcount * recvtype_size == 0)
- src = MPI_PROC_NULL;
mpi_errno = MPIC_Sendrecv(sendaddr, sendcount, sendtype, dst,
MPIR_ALLTOALLV_TAG, recvaddr, recvcount,
recvtype, src, MPIR_ALLTOALLV_TAG,
Modified: mpich2/trunk/src/mpi/coll/alltoallw.c
===================================================================
--- mpich2/trunk/src/mpi/coll/alltoallw.c 2011-01-20 03:23:44 UTC (rev 7765)
+++ mpich2/trunk/src/mpi/coll/alltoallw.c 2011-01-20 20:21:35 UTC (rev 7766)
@@ -72,7 +72,6 @@
int outstanding_requests;
int ii, ss, bblock;
int type_size;
- MPI_Aint size1, size2;
MPIU_CHKLMEM_DECL(2);
comm = comm_ptr->handle;
@@ -95,11 +94,7 @@
for (i = 0; i < comm_size; ++i) {
/* start inner loop at i to avoid re-exchanging data */
for (j = i; j < comm_size; ++j) {
- /* Get size of recv types */
- MPID_Datatype_get_size_macro(recvtypes[i], size1);
- MPID_Datatype_get_size_macro(recvtypes[j], size2);
-
- if (rank == i && (recvcnts[j] * size2)) {
+ if (rank == i) {
/* also covers the (rank == i && rank == j) case */
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + rdispls[j]),
recvcnts[j], recvtypes[j],
@@ -112,7 +107,7 @@
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
}
- else if (rank == j && (recvcnts[i] * size1)) {
+ else if (rank == j) {
/* same as above with i/j args reversed */
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + rdispls[i]),
recvcnts[i], recvtypes[i],
@@ -267,7 +262,6 @@
int src, dst, rank, sendcount, recvcount;
char *sendaddr, *recvaddr;
MPI_Datatype sendtype, recvtype;
- MPI_Aint sendtype_size, recvtype_size;
MPI_Comm comm;
local_size = comm_ptr->local_size;
@@ -306,13 +300,6 @@
sendtype = sendtypes[dst];
}
- MPID_Datatype_get_size_macro(sendtypes[dst], sendtype_size);
- MPID_Datatype_get_size_macro(recvtypes[src], recvtype_size);
-
- if (sendcount * sendtype_size == 0)
- dst = MPI_PROC_NULL;
- if (recvcount * recvtype_size == 0)
- src = MPI_PROC_NULL;
mpi_errno = MPIC_Sendrecv(sendaddr, sendcount, sendtype,
dst, MPIR_ALLTOALLW_TAG, recvaddr,
recvcount, recvtype, src,
More information about the mpich2-commits
mailing list