1
1

checks for sendcount and recvcount(s) being zero have slightly different

consequences depending on whether the communicator is an intra or an inter
communicator. 

fixes trac:2415

This commit was SVN r23187.

The following Trac tickets were found above:
  Ticket 2415 --> https://svn.open-mpi.org/trac/ompi/ticket/2415
Этот коммит содержится в:
Edgar Gabriel 2010-05-20 22:21:26 +00:00
родитель e751f3c21c
Коммит 5881719d84
2 изменённых файлов: 35 добавлений и 13 удалений

Просмотреть файл

@ -10,6 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -89,12 +90,24 @@ int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
/* Do we need to do anything? Everyone had to give the same send
signature, which means that everyone must have given a
sendcount > 0 if there's anything to send. If we're doing
IN_PLACE, however, check recvcount, not sendcount. */
if ((MPI_IN_PLACE != sendbuf && 0 == sendcount) ||
(0 == recvcount)) {
return MPI_SUCCESS;
sendcount > 0 if there's anything to send for the intra-communicator
case. If we're doing IN_PLACE, however, check recvcount,
not sendcount. */
if ( OMPI_COMM_IS_INTRA(comm) ) {
if ((MPI_IN_PLACE != sendbuf && 0 == sendcount) ||
(0 == recvcount)) {
return MPI_SUCCESS;
}
}
else if ( OMPI_COMM_IS_INTER(comm) ){
/* for inter comunicators, the communication pattern
need not be symmetric. Specifically, one group is
allows to have sendcount=0, while the other has
a valid sendcount. Thus, the only way not to do
anything is if both sendcount and recvcount are zero. */
if ( 0 == sendcount && 0 == recvcount ) {
return MPI_SUCCESS;
}
}
OPAL_CR_ENTER_LIBRARY();

Просмотреть файл

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2010 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -108,14 +109,22 @@ int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
signature, which means that everyone must have given a
sum(recvounts) > 0 if there's anything to do. */
for (i = 0; i < ompi_comm_size(comm); ++i) {
if (0 != recvcounts[i]) {
break;
}
}
if (i >= ompi_comm_size(comm)) {
return MPI_SUCCESS;
if ( OMPI_COMM_IS_INTRA( comm) ) {
for (i = 0; i < ompi_comm_size(comm); ++i) {
if (0 != recvcounts[i]) {
break;
}
}
if (i >= ompi_comm_size(comm)) {
return MPI_SUCCESS;
}
}
/* There is no rule that can be applied for inter-communicators, since
recvcount(s)=0 only indicates that the processes in the other group
do not send anything, sendcount=0 only indicates that I do not send
anything. However, other processes in my group might very well send
something */
OPAL_CR_ENTER_LIBRARY();