int rank = comm->rank();
int size = comm->size();
//non commutative case, use a working algo from openmpi
- if(!smpi_op_is_commute(op)){
+ if(op != MPI_OP_NULL && !op->is_commutative()){
smpi_coll_tuned_reduce_ompi_basic_linear(sendtmpbuf, recvbuf, count, datatype, op, root, comm);
return;
}
Request::unuse(&requests[index]);
}
if(op) /* op can be MPI_OP_NULL that does nothing */
- smpi_op_apply(op, tmpbufs[index], recvbuf, &count, &datatype);
+ if(op!=MPI_OP_NULL) op->apply( tmpbufs[index], recvbuf, &count, &datatype);
}
for(index = 0; index < size - 1; index++) {
smpi_free_tmp_buffer(tmpbufs[index]);
// Wait for completion of all comms.
Request::startall(size - 1, requests);
- if(smpi_op_is_commute(op)){
+ if(op != MPI_OP_NULL && op->is_commutative()){
for (int other = 0; other < size - 1; other++) {
index = Request::waitany(size - 1, requests, MPI_STATUS_IGNORE);
if(index == MPI_UNDEFINED) {
}
if(index < rank) {
// #Request is below rank: it's a irecv
- smpi_op_apply(op, tmpbufs[index], recvbuf, &count, &datatype);
+ if(op!=MPI_OP_NULL) op->apply( tmpbufs[index], recvbuf, &count, &datatype);
}
}
}else{
for (int other = 0; other < size - 1; other++) {
Request::wait(&(requests[other]), MPI_STATUS_IGNORE);
if(index < rank) {
- smpi_op_apply(op, tmpbufs[other], recvbuf, &count, &datatype);
+ if(op!=MPI_OP_NULL) op->apply( tmpbufs[other], recvbuf, &count, &datatype);
}
}
}
// Wait for completion of all comms.
Request::startall(size - 1, requests);
- if(smpi_op_is_commute(op)){
+ if(op != MPI_OP_NULL && op->is_commutative()){
for (int other = 0; other < size - 1; other++) {
index = Request::waitany(size - 1, requests, MPI_STATUS_IGNORE);
if(index == MPI_UNDEFINED) {
recvbuf_is_empty=0;
} else
// #Request is below rank: it's a irecv
- smpi_op_apply(op, tmpbufs[index], recvbuf, &count, &datatype);
+ if(op!=MPI_OP_NULL) op->apply( tmpbufs[index], recvbuf, &count, &datatype);
}
}
}else{
smpi_datatype_copy(tmpbufs[other], count, datatype, recvbuf, count, datatype);
recvbuf_is_empty = 0;
} else
- smpi_op_apply(op, tmpbufs[other], recvbuf, &count, &datatype);
+ if(op!=MPI_OP_NULL) op->apply( tmpbufs[other], recvbuf, &count, &datatype);
}
}
}