Commit c8ecef8d authored by Xin Zhao's avatar Xin Zhao
Browse files

Bug-fix: use do_accumulate_op function for ACC computation.



do_accumulate_op() does more comprehensive work on ACC
computation than OP function. For example, MPI_REPLACE
is not defined as predefined computation and therefore
not handled by OP function, but it is safely handled
in do_accumulate_op(). This patch replace OP function
with do_accumulate_op() on target side.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 59afc29c
......@@ -1304,14 +1304,15 @@ static inline int perform_fop_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_en
/* Apply the op */
if (fop_pkt->op != MPI_NO_OP) {
MPI_User_function *uop = MPIR_OP_HDL_TO_FN(fop_pkt->op);
int one = 1;
if (fop_pkt->type == MPIDI_CH3_PKT_FOP_IMMED) {
(*uop)(fop_pkt->info.data, fop_pkt->addr, &one, &(fop_pkt->datatype));
mpi_errno = do_accumulate_op(fop_pkt->info.data, fop_pkt->addr,
1, fop_pkt->datatype, fop_pkt->op);
}
else {
(*uop)(lock_entry->data, fop_pkt->addr, &one, &(fop_pkt->datatype));
mpi_errno = do_accumulate_op(lock_entry->data, fop_pkt->addr,
1, fop_pkt->datatype, fop_pkt->op);
}
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
}
if (win_ptr->shm_allocated == TRUE)
......
......@@ -1213,9 +1213,11 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
/* Apply the op */
if (fop_pkt->op != MPI_NO_OP) {
MPI_User_function *uop = MPIR_OP_HDL_TO_FN(fop_pkt->op);
int one = 1;
(*uop)(fop_pkt->info.data, fop_pkt->addr, &one, &(fop_pkt->datatype));
mpi_errno = do_accumulate_op(fop_pkt->info.data, fop_pkt->addr,
1, fop_pkt->datatype, fop_pkt->op);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
}
}
if (win_ptr->shm_allocated == TRUE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment