*/
if (root != 0) {
if (rank == root) {
- smpi_mpi_send(buf, count, datatype, 0, tag - 1, comm);
+ Request::send(buf, count, datatype, 0, tag - 1, comm);
} else if (rank == 0) {
- smpi_mpi_recv(buf, count, datatype, root, tag - 1, comm, &status);
+ Request::recv(buf, count, datatype, root, tag - 1, comm, &status);
}
}
for (k = 0; k < 3; k++) {
for (i = 1; i < size; i++) {
if ((already_sent[i] == 0) && (will_send[i] == 0)) {
- smpi_mpi_iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
+ Request::iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
&temp_status_array[i]);
if (flag_array[i] == 1) {
will_send[i] = 1;
- smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, comm,
+ Request::recv(&temp_buf[i], 1, MPI_CHAR, i, tag, comm,
&status);
i = 0;
}
/* send header */
for (i = 0; i < header_index; i++) {
to = header_buf[i];
- smpi_mpi_send(header_buf, header_size, MPI_INT, to, header_tag, comm);
+ Request::send(header_buf, header_size, MPI_INT, to, header_tag, comm);
}
curr_remainder = count % header_index;
if ((i == (header_index - 1)) || (curr_size == 0))
curr_size += curr_remainder;
//printf("Root send to %d index %d\n",to,(i*curr_increment));
- smpi_mpi_send((char *) buf + (i * curr_increment), curr_size, datatype, to,
+ Request::send((char *) buf + (i * curr_increment), curr_size, datatype, to,
tag, comm);
}
}
/* none root */
else {
/* send 1-byte message to root */
- smpi_mpi_send(temp_buf, 1, MPI_CHAR, 0, tag, comm);
+ Request::send(temp_buf, 1, MPI_CHAR, 0, tag, comm);
/* wait for header forward when required */
- smpi_mpi_recv(header_buf, header_size, MPI_INT, 0, header_tag, comm, &status);
+ Request::recv(header_buf, header_size, MPI_INT, 0, header_tag, comm, &status);
/* search for where it is */
int myordering = 0;
/* receive data */
if (myordering == (total_nodes - 1))
recv_size += curr_remainder;
- smpi_mpi_recv((char *) buf + (myordering * curr_increment), recv_size, datatype,
+ Request::recv((char *) buf + (myordering * curr_increment), recv_size, datatype,
0, tag, comm, &status);
/* at this point all nodes in this set perform all-gather operation */
//printf("\tnode %d sent_offset %d send_count %d\n",rank,send_offset,send_count);
- smpi_mpi_sendrecv((char *) buf + send_offset, send_count, datatype, to,
+ Request::sendrecv((char *) buf + send_offset, send_count, datatype, to,
tag + i, (char *) buf + recv_offset, recv_count, datatype,
from, tag + i, comm, &status);
}