} else if (rank == ((root - 1 + size) % size)) {
smpi_mpi_send(rbuf, count, datatype, to, tag, comm);
} else {
smpi_mpi_recv(tmp_buf, count, datatype, from, tag, comm, &status);
} else if (rank == ((root - 1 + size) % size)) {
smpi_mpi_send(rbuf, count, datatype, to, tag, comm);
} else {
smpi_mpi_recv(tmp_buf, count, datatype, from, tag, comm, &status);