extent = smpi_datatype_get_extent(datatype);
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;
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);
+ if(op!=MPI_OP_NULL) op->apply( recvbuf, tmp_buf, &count, &datatype);
smpi_datatype_copy(tmp_buf, count, datatype,recvbuf, count, datatype);
}
}