To do this, the matching receives (as MPI_Isend) must be posted before the synchronization point and the sends (as MPI_Irsend) must be posted after the synchronization point. This version uses nonblocking ready sends to provide more opportunity for concurrent communication.
You may want to use these MPI routines in your solution:
MPI_Irecv
MPI_Rsend
MPI_Waitall
MPI_Cancel