MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
{
size_t dsize, block_dsize;
- int comm_size = smpi_comm_size(comm);
+ int comm_size = comm->size();
const size_t large_message = 2048; //MPIR_PARAM_ALLREDUCE_SHORT_MSG_SIZE
- dsize = smpi_datatype_size(dtype);
+ dsize = dtype->size();
block_dsize = dsize * count;
while (pof2 <= comm_size) pof2 <<= 1;
pof2 >>=1;
- if (block_dsize > large_message && count >= pof2 && smpi_op_is_commute(op)) {
+ if (block_dsize > large_message && count >= pof2 && (op==MPI_OP_NULL || op->is_commutative())) {
//for long messages
return (smpi_coll_tuned_allreduce_rab_rdb (sbuf, rbuf,
count, dtype,
{
int communicator_size;
size_t dsize, block_dsize;
- communicator_size = smpi_comm_size(comm);
+ communicator_size = comm->size();
unsigned int short_size=256;
unsigned int medium_size=32768;
// and sends to (rank+i).
- dsize = smpi_datatype_size(sdtype);
+ dsize = sdtype->size();
block_dsize = dsize * scount;
if ((block_dsize < short_size) && (communicator_size >= 8)) {
//int segsize = 0;
size_t message_size, dsize;
- communicator_size = smpi_comm_size(comm);
+ communicator_size = comm->size();
/* else we need data size for decision function */
- dsize = smpi_datatype_size(datatype);
+ dsize = datatype->size();
message_size = dsize * (unsigned long)count; /* needed for decision */
/* Handle messages of small and intermediate size, and
int communicator_size=0;
//int segsize = 0;
size_t message_size, dsize;
- communicator_size = smpi_comm_size(comm);
+ communicator_size = comm->size();
/* need data size for decision function */
- dsize=smpi_datatype_size(datatype);
+ dsize=datatype->size();
message_size = dsize * count; /* needed for decision */
int pof2 = 1;
pof2 >>= 1;
- if ((count < pof2) || (message_size < 2048) || !smpi_op_is_commute(op)) {
+ if ((count < pof2) || (message_size < 2048) || (op!=MPI_OP_NULL && !op->is_commutative())) {
return smpi_coll_tuned_reduce_binomial (sendbuf, recvbuf, count, datatype, op, root, comm);
}
return smpi_coll_tuned_reduce_scatter_gather(sendbuf, recvbuf, count, datatype, op, root, comm/*, module,
XBT_DEBUG("smpi_coll_tuned_reduce_scatter_mpich");
- comm_size = smpi_comm_size(comm);
+ comm_size = comm->size();
// We need data size for decision function
total_message_size = 0;
for (i = 0; i < comm_size; i++) {
total_message_size += rcounts[i];
}
- if( smpi_op_is_commute(op) && total_message_size > 524288) {
+ if( (op==MPI_OP_NULL || op->is_commutative()) && total_message_size > 524288) {
return smpi_coll_tuned_reduce_scatter_mpich_pair (sbuf, rbuf, rcounts,
dtype, op,
comm);
- }else if (!smpi_op_is_commute(op)) {
+ }else if ((op!=MPI_OP_NULL && !op->is_commutative())) {
int is_block_regular = 1;
for (i = 0; i < (comm_size - 1); ++i) {
if (rcounts[i] != rcounts[i+1]) {
int communicator_size, pow2_size;
size_t dsize, total_dsize;
- communicator_size = smpi_comm_size(comm);
+ communicator_size = comm->size();
/* Determine complete data size */
- dsize=smpi_datatype_size(sdtype);
+ dsize=sdtype->size();
total_dsize = dsize * scount * communicator_size;
for (pow2_size = 1; pow2_size < communicator_size; pow2_size <<=1);
int communicator_size, pow2_size,i;
size_t total_dsize;
- communicator_size = smpi_comm_size(comm);
+ communicator_size = comm->size();
/* Determine complete data size */
total_dsize = 0;
int root, MPI_Comm comm
)
{
- if(smpi_comm_rank(comm)!=root){
- sbuf=xbt_malloc(rcount*smpi_datatype_get_extent(rdtype));
+ if(comm->rank()!=root){
+ sbuf=xbt_malloc(rcount*rdtype->get_extent());
scount=rcount;
sdtype=rdtype;
}
int ret= smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype,
rbuf, rcount, rdtype,
root, comm);
- if(smpi_comm_rank(comm)!=root){
+ if(comm->rank()!=root){
xbt_free(sbuf);
}
return ret;