From: Augustin Degomme Date: Tue, 9 Oct 2012 16:51:14 +0000 (+0200) Subject: forgot to handle MPI_ANY_SOURCE as a valid source, they were caught as invalid X-Git-Tag: v3_8~92^2~15 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e3c649a631d7da6f3691c1dc8a7dabd4d11c1771 forgot to handle MPI_ANY_SOURCE as a valid source, they were caught as invalid --- diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index e3abcd24e4..8baedaea3a 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -914,7 +914,7 @@ int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, } else if (src == MPI_PROC_NULL) { *request = MPI_REQUEST_NULL; retval = MPI_SUCCESS; - } else if (src >= smpi_group_size(smpi_comm_group(comm)) || src <0){ + } else if (src!=MPI_ANY_SOURCE && (src >= smpi_group_size(smpi_comm_group(comm)) || src <0)){ retval = MPI_ERR_COMM; } else if (count < 0) { retval = MPI_ERR_COUNT; @@ -1008,7 +1008,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, smpi_empty_status(status); status->MPI_SOURCE = MPI_PROC_NULL; retval = MPI_SUCCESS; - }else if(src >= smpi_group_size(smpi_comm_group(comm)) || src <0){ + } else if (src!=MPI_ANY_SOURCE && (src >= smpi_group_size(smpi_comm_group(comm)) || src <0)){ retval = MPI_ERR_COMM; } else if (count < 0) { retval = MPI_ERR_COUNT; @@ -1105,7 +1105,8 @@ int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, smpi_empty_status(status); status->MPI_SOURCE = MPI_PROC_NULL; retval = MPI_SUCCESS; - }else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0 || src >= smpi_group_size(smpi_comm_group(comm)) || src <0){ + }else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0 || + (src!=MPI_ANY_SOURCE && (src >= smpi_group_size(smpi_comm_group(comm)) || src <0))){ retval = MPI_ERR_COMM; } else if (sendcount < 0 || recvcount<0) { retval = MPI_ERR_COUNT;