cmpiopenmpi

Is MPI_Ibcast buffered?


I'm using OpenMPI for a little project, and I've got a doubt.
When I use MPI_Ibcast to send an array to all the other processes, can I start computing on the same array?

Example:

MPI_Ibcast(array, ... &request);
compute(array);
MPI_Wait(&request);

If I get it right, MPI_Ibcast does not save the array in a buffer, so I couldn't do that, but I'm not sure.


Solution

  • For any MPI_Iwhatever operation you should not touch the buffer before the completion (the MPI_Waitwhatever call). If it's a sending call (including a bcast if you're the root) the data may not have been sent; if it's a receiving call (including bcast if you're not the root) there is no guarantee that the data has arrived.