int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype senddatatype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvdatatype, int source, int recvtag, MPI_Comm comm, MPI_Status *status)
1 int a[10], b[10], npes, myrank; 2 MPI_Status status; 3 ... 4 MPI_Comm_size(MPI_COMM_WORLD, &npes); 5 MPI_Comm_rank(MPI_COMM_WORLD, &myrank); 6 MPI_SendRecv(a, 10, MPI_INT, (myrank+1)%npes, 1, 7 b, 10, MPI_INT, (myrank-1+npes)%npes, 1, 8 MPI_COMM_WORLD, &status); 9 ...