Is it same to read from a buffer that is being used in a non-blocking send?

Viewed 35

MPI newbie here. Say I am using MPI_ISend like this:

MPI_Isend(&send_buf, 10, MPI_DOUBLE, rank + 1, 0, MPI_COMM_WORLD, &send_req);
a = send_buf[0] + send_buf[1];

Can we assume the line below MPI_Isend is reading safely from the buffer? or is this something that should be avoided?

1 Answers

Your code is safe. You can read from a send buffer. What you can not do is read from a receive buffer in an MPI_Irecv call, before you've done some type of MPI_Waitwhatever.

Related