In the simple Jacobi loop, at the end of each iteration, there is an MPI_Allreduce used to test for convergence. This provides a synchronization point in the program. This example uses that synchronization point to allow the use of the MPI_Irsend routine.

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