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 intermediate_message = 10000;
/**
* can handle both commutative and non-commutative operations.
* Ring algorithm does not support non-commutative operations.
*/
- dsize = smpi_datatype_size(dtype);
+ dsize = dtype->size();
block_dsize = dsize * count;
if (block_dsize < intermediate_message) {
op, comm));
}
- if( smpi_op_is_commute(op) && (count > comm_size) ) {
+ if( ((op==MPI_OP_NULL) || op->is_commutative()) && (count > comm_size) ) {
const size_t segment_size = 1 << 20; /* 1 MB */
if ((comm_size * segment_size >= block_dsize)) {
//FIXME: ok, these are not the right algorithms, try to find closer ones
{
int communicator_size;
size_t dsize, block_dsize;
- communicator_size = smpi_comm_size(comm);
+ communicator_size = comm->size();
/* Decision function based on measurement on Grig cluster at
the University of Tennessee (2GB MX) up to 64 nodes.
Has better performance for messages of intermediate sizes than the old one */
/* determine block size */
- dsize = smpi_datatype_size(sdtype);
+ dsize = sdtype->size();
block_dsize = dsize * scount;
if ((block_dsize < 200) && (communicator_size > 12)) {
int smpi_coll_tuned_barrier_ompi(MPI_Comm comm)
-{ int communicator_size = smpi_comm_size(comm);
+{ int communicator_size = comm->size();
if( 2 == communicator_size )
return smpi_coll_tuned_barrier_ompi_two_procs(comm);
//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
/* no limit on # of outstanding requests */
//const int max_requests = 0;
- 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 */
/**
* If the operation is non commutative we currently have choice of linear
* or in-order binary tree algorithm.
*/
- if( !smpi_op_is_commute(op) ) {
+ if( (op!=MPI_OP_NULL) && !op->is_commutative() ) {
if ((communicator_size < 12) && (message_size < 2048)) {
return smpi_coll_tuned_reduce_ompi_basic_linear (sendbuf, recvbuf, count, datatype, op, root, comm/*, module*/);
}
XBT_DEBUG("smpi_coll_tuned_reduce_scatter_ompi");
- comm_size = smpi_comm_size(comm);
+ comm_size = comm->size();
// We need data size for decision function
- dsize=smpi_datatype_size(dtype);
+ dsize=dtype->size();
total_message_size = 0;
for (i = 0; i < comm_size; i++) {
total_message_size += rcounts[i];
}
}
- if( !smpi_op_is_commute(op) || (zerocounts)) {
+ if( ((op!=MPI_OP_NULL) && !op->is_commutative()) || (zerocounts)) {
smpi_mpi_reduce_scatter (sbuf, rbuf, rcounts,
dtype, op,
comm);
int communicator_size, pow2_size;
size_t dsize, total_dsize;
- communicator_size = smpi_comm_size(comm);
+ communicator_size = comm->size();
/* Special case for 2 processes */
if (communicator_size == 2) {
}
/* 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;
size_t dsize, total_dsize;
- communicator_size = smpi_comm_size(comm);
+ communicator_size = comm->size();
/* Special case for 2 processes */
if (communicator_size == 2) {
}
/* Determine complete data size */
- dsize=smpi_datatype_size(sdtype);
+ dsize=sdtype->size();
total_dsize = 0;
for (i = 0; i < communicator_size; i++) {
total_dsize += dsize * rcounts[i];
XBT_DEBUG("smpi_coll_tuned_gather_ompi");
- communicator_size = smpi_comm_size(comm);
- rank = smpi_comm_rank(comm);
+ communicator_size = comm->size();
+ rank = comm->rank();
// Determine block size
if (rank == root) {
- dsize = smpi_datatype_size(rdtype);
+ dsize = rdtype->size();
block_size = dsize * rcount;
} else {
- dsize = smpi_datatype_size(sdtype);
+ dsize = sdtype->size();
block_size = dsize * scount;
}
XBT_DEBUG("smpi_coll_tuned_scatter_ompi");
- communicator_size = smpi_comm_size(comm);
- rank = smpi_comm_rank(comm);
+ communicator_size = comm->size();
+ rank = comm->rank();
// Determine block size
if (root == rank) {
- dsize=smpi_datatype_size(sdtype);
+ dsize=sdtype->size();
block_size = dsize * scount;
} else {
- dsize=smpi_datatype_size(rdtype);
+ dsize=rdtype->size();
block_size = dsize * rcount;
}
if ((communicator_size > small_comm_size) &&
(block_size < small_block_size)) {
if(rank!=root){
- sbuf=xbt_malloc(rcount*smpi_datatype_get_extent(rdtype));
+ sbuf=xbt_malloc(rcount*rdtype->get_extent());
scount=rcount;
sdtype=rdtype;
}