if(MV2_Reduce_intra_function==NULL)
MV2_Reduce_intra_function=smpi_coll_tuned_reduce_mpich;
- if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
- smpi_comm_init_smp(comm);
+ if(comm->get_leaders_comm()==MPI_COMM_NULL){
+ comm->init_smp();
}
- my_rank = smpi_comm_rank(comm);
- total_size = smpi_comm_size(comm);
- shmem_comm = smpi_comm_get_intra_comm(comm);
- local_rank = smpi_comm_rank(shmem_comm);
- local_size = smpi_comm_size(shmem_comm);
+ my_rank = comm->rank();
+ total_size = comm->size();
+ shmem_comm = comm->get_intra_comm();
+ local_rank = shmem_comm->rank();
+ local_size = shmem_comm->size();
- leader_comm = smpi_comm_get_leaders_comm(comm);
- int* leaders_map = smpi_comm_get_leaders_map(comm);
- leader_of_root = smpi_group_rank(smpi_comm_group(comm),leaders_map[root]);
- leader_root = smpi_group_rank(smpi_comm_group(leader_comm),leaders_map[root]);
+ leader_comm = comm->get_leaders_comm();
+ int* leaders_map = comm->get_leaders_map();
+ leader_of_root = comm->group()->rank(leaders_map[root]);
+ leader_root = leader_comm->group()->rank(leaders_map[root]);
is_commutative=smpi_op_is_commute(op);
}
if (local_rank == 0 && root != my_rank) {
- smpi_mpi_send(out_buf, count, datatype, root,
+ Request::send(out_buf, count, datatype, root,
COLL_TAG_REDUCE+1, comm);
}
if ((local_rank != 0) && (root == my_rank)) {
- smpi_mpi_recv(recvbuf, count, datatype,
+ Request::recv(recvbuf, count, datatype,
leader_of_root, COLL_TAG_REDUCE+1, comm,
MPI_STATUS_IGNORE);
}
if (local_rank == 0) {
- leader_comm = smpi_comm_get_leaders_comm(comm);
+ leader_comm = comm->get_leaders_comm();
if(leader_comm==MPI_COMM_NULL){
leader_comm = MPI_COMM_WORLD;
}
- leader_comm_size = smpi_comm_size(leader_comm);
- leader_comm_rank = smpi_comm_rank(leader_comm);
+ leader_comm_size = leader_comm->size();
+ leader_comm_rank = leader_comm->rank();
tmp_buf=(void *)smpi_get_tmp_sendbuffer(count *
(MAX(extent, true_extent)));
tmp_buf = (void *) ((char *) tmp_buf - true_lb);
* root of the reduce operation. The reduced data is in tmp_buf */
if ((local_rank == 0) && (root != my_rank)
&& (leader_root == leader_comm_rank)) {
- smpi_mpi_send(tmp_buf, count, datatype, root,
+ Request::send(tmp_buf, count, datatype, root,
COLL_TAG_REDUCE+1, comm);
}
if ((local_rank != 0) && (root == my_rank)) {
- smpi_mpi_recv(recvbuf, count, datatype,
+ Request::recv(recvbuf, count, datatype,
leader_of_root,
COLL_TAG_REDUCE+1, comm,
MPI_STATUS_IGNORE);