// mca_coll_tuned_module_t *tuned_module = (mca_coll_tuned_module_t*) module;
// mca_coll_tuned_comm_t *data = tuned_module->tuned_data;
- size = smpi_comm_size(comm);
- rank = smpi_comm_rank(comm);
+ size = comm->size();
+ rank = comm->rank();
//compute again segsize
const size_t intermediate_message_size = 370728;
- size_t message_size = smpi_datatype_size(datatype) * (unsigned long)count;
+ size_t message_size = datatype->size() * (unsigned long)count;
if(message_size < intermediate_message_size)
segsize = 1024 ;
else
/* setup the binary tree topology. */
tree = ompi_coll_tuned_topo_build_tree(2,comm,root);
- type_size = smpi_datatype_size( datatype );
+ type_size = datatype->size();
/* Determine number of segments and number of elements per segment */
counts[0] = count/2;
return (smpi_coll_tuned_bcast_SMP_linear ( buffer, count, datatype,
root, comm));
}
- type_extent = smpi_datatype_get_extent(datatype);
+ type_extent = datatype->get_extent();
/* Determine real segment size */
if(segindex == (num_segments[i] - 1))
sendcount[i] = counts[i] - segindex*segcount[i];
/* send data */
- smpi_mpi_send(tmpbuf[i], sendcount[i], datatype,
+ Request::send(tmpbuf[i], sendcount[i], datatype,
tree->tree_next[i], COLL_TAG_BCAST, comm);
/* update tmp buffer */
tmpbuf[i] += realsegsize[i];
* and we disseminating the data to all children.
*/
sendcount[lr] = segcount[lr];
- base_req=smpi_mpi_irecv(tmpbuf[lr], sendcount[lr], datatype,
+ base_req=Request::irecv(tmpbuf[lr], sendcount[lr], datatype,
tree->tree_prev, COLL_TAG_BCAST,
comm);
if( segindex == (num_segments[lr] - 1))
sendcount[lr] = counts[lr] - segindex*segcount[lr];
/* post new irecv */
- new_req = smpi_mpi_irecv( tmpbuf[lr] + realsegsize[lr], sendcount[lr],
+ new_req = Request::irecv( tmpbuf[lr] + realsegsize[lr], sendcount[lr],
datatype, tree->tree_prev, COLL_TAG_BCAST,
comm);
/* wait for and forward current segment */
- smpi_mpi_waitall( 1, &base_req, MPI_STATUSES_IGNORE );
+ Request::waitall( 1, &base_req, MPI_STATUSES_IGNORE );
for( i = 0; i < tree->tree_nextsize; i++ ) { /* send data to children (segcount[lr]) */
- smpi_mpi_send( tmpbuf[lr], segcount[lr], datatype,
+ Request::send( tmpbuf[lr], segcount[lr], datatype,
tree->tree_next[i], COLL_TAG_BCAST,
comm);
} /* end of for each child */
} /* end of for segindex */
/* wait for the last segment and forward current segment */
- smpi_mpi_waitall( 1, &base_req, MPI_STATUSES_IGNORE );
+ Request::waitall( 1, &base_req, MPI_STATUSES_IGNORE );
for( i = 0; i < tree->tree_nextsize; i++ ) { /* send data to children */
- smpi_mpi_send(tmpbuf[lr], sendcount[lr], datatype,
+ Request::send(tmpbuf[lr], sendcount[lr], datatype,
tree->tree_next[i], COLL_TAG_BCAST, comm);
} /* end of for each child */
}
/* determine how many elements to expect in this round */
if (segindex == (num_segments[lr] - 1)) sendcount[lr] = counts[lr] - segindex*segcount[lr];
/* receive segments */
- smpi_mpi_recv(tmpbuf[lr], sendcount[lr], datatype,
+ Request::recv(tmpbuf[lr], sendcount[lr], datatype,
tree->tree_prev, COLL_TAG_BCAST,
comm, MPI_STATUS_IGNORE);
/* update the initial pointer to the buffer */
if ( (size%2) != 0 && rank != root) {
- smpi_mpi_sendrecv( tmpbuf[lr], counts[lr], datatype,
+ Request::sendrecv( tmpbuf[lr], counts[lr], datatype,
pair, COLL_TAG_BCAST,
tmpbuf[(lr+1)%2], counts[(lr+1)%2], datatype,
pair, COLL_TAG_BCAST,
} else if ( (size%2) == 0 ) {
/* root sends right buffer to the last node */
if( rank == root ) {
- smpi_mpi_send(tmpbuf[1], counts[1], datatype,
+ Request::send(tmpbuf[1], counts[1], datatype,
(root+size-1)%size, COLL_TAG_BCAST, comm);
}
/* last node receives right buffer from the root */
else if (rank == (root+size-1)%size) {
- smpi_mpi_recv(tmpbuf[1], counts[1], datatype,
+ Request::recv(tmpbuf[1], counts[1], datatype,
root, COLL_TAG_BCAST,
comm, MPI_STATUS_IGNORE);
}
/* everyone else exchanges buffers */
else {
- smpi_mpi_sendrecv( tmpbuf[lr], counts[lr], datatype,
+ Request::sendrecv( tmpbuf[lr], counts[lr], datatype,
pair, COLL_TAG_BCAST,
tmpbuf[(lr+1)%2], counts[(lr+1)%2], datatype,
pair, COLL_TAG_BCAST,