Discussion:
Can MPI_Gather processes can send different sendcount?
(too old to reply)
c***@gmail.com
2009-08-26 04:23:54 UTC
Permalink
Hello Folks, I have been working on MPI_Gather which has the prototype

int MPI_Allgather ( void *sendbuf, int sendcount, MPI_Datatype
sendtype,
void *recvbuf, int recvcount, MPI_Datatype
recvtype,
MPI_Comm comm )

Now i want to ask one thing. Can "sendcount" be different for
different processes i-e

If i run using -np = 4

Is it possbile that process 0 sends 3 elements whereas process 1 sends
5 elements and so on?

Or all the procesess send equal sendcount always? I checked the
specification but couldnt find any thing?
Michael Hofmann
2009-08-26 07:29:16 UTC
Permalink
Post by c***@gmail.com
Hello Folks, I have been working on MPI_Gather which has the prototype
int MPI_Allgather ( void *sendbuf, int sendcount, MPI_Datatype
sendtype,
void *recvbuf, int recvcount, MPI_Datatype
recvtype,
MPI_Comm comm )
Now i want to ask one thing. Can "sendcount" be different for
different processes i-e
If i run using -np = 4
Is it possbile that process 0 sends 3 elements whereas process 1 sends
5 elements and so on?
No, this is not possible with MPI_Gather or MPI_Allgather. Looking at the
prototypes, one can see that there is only one recvcount value. The root
process uses this (single) value to determine the amount of data to
receive.

The "v"-versions MPI_Gatherv and MPI_Allgatherv extend the functionality
of the regular gather operations. Here, every process can send a different
amount of data and the recvcounts are an array.
Post by c***@gmail.com
Or all the procesess send equal sendcount always? I checked the
specification but couldnt find any thing?
It is not totally correct to say that the sendcounts (of MPI_Gather or
MPI_Allgather) need to be equal, because this is only true if all
sendtypes are equal, too. Only the type signature (which results from the
sendtype and the sendcount) needs to equal. This is important when using
derived data types, where distinct sendcounts and -types can still result
in equal type signatures.


Michael

Loading...