rank = comm->rank();
comm_size = comm->size();
- extent = smpi_datatype_get_extent(datatype);
+ extent = datatype->get_extent();
tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
- int is_commutative = smpi_op_is_commute(op);
+ int is_commutative = (op==MPI_OP_NULL || op->is_commutative());
mask = 1;
int lroot;
lroot = 0;
relrank = (rank - lroot + comm_size) % comm_size;
- smpi_datatype_extent(datatype, &true_lb, &true_extent);
+ datatype->extent(&true_lb, &true_extent);
/* adjust for potential negative lower bound in datatype */
tmp_buf = (void *)((char*)tmp_buf - true_lb);
recvbuf = (void *)((char*)recvbuf - true_lb);
}
if ((rank != root) || (sendbuf != MPI_IN_PLACE)) {
- smpi_datatype_copy(sendbuf, count, datatype, recvbuf,count, datatype);
+ Datatype::copy(sendbuf, count, datatype, recvbuf,count, datatype);
}
while (mask < comm_size) {
Request::recv(tmp_buf, count, datatype, source, tag, comm, &status);
if (is_commutative) {
- smpi_op_apply(op, tmp_buf, recvbuf, &count, &datatype);
+ if(op!=MPI_OP_NULL) op->apply( tmp_buf, recvbuf, &count, datatype);
} else {
- smpi_op_apply(op, recvbuf, tmp_buf, &count, &datatype);
- smpi_datatype_copy(tmp_buf, count, datatype,recvbuf, count, datatype);
+ if(op!=MPI_OP_NULL) op->apply( recvbuf, tmp_buf, &count, datatype);
+ Datatype::copy(tmp_buf, count, datatype,recvbuf, count, datatype);
}
}
} else {