MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
MPI_Send (buf1, buf_size, MPI_INT, 0, 0, comm);
}
else if (drank == 0) {
MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
MPI_Send (buf1, buf_size, MPI_INT, 0, 0, comm);
}
else if (drank == 0) {
MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm2, &status);
MPI_Send (buf1, buf_size, MPI_INT, 0, 0, comm2);
}
else if (drank == 0) {
MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm2, &status);
MPI_Send (buf1, buf_size, MPI_INT, 0, 0, comm2);
}
else if (drank == 0) {
MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm2);
MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm2);