Commit 2c91fc9b authored by James Dinan's avatar James Dinan
Browse files

[svn-r10202] Added missing disp_unit to CAS address calculation.

Reviewer: buntinas
parent 7a1e4bba
......@@ -196,12 +196,10 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
* so there's no need to check it again here. */
if (target_rank == rank) {
void *dest_addr = (char *) win_ptr->base + target_disp;
void *dest_addr = (char *) win_ptr->base + win_ptr->disp_unit * target_disp;
int len;
MPID_Datatype_get_size_macro(datatype, len);
MPIU_Assert(len <= sizeof(MPIDI_CH3_CAS_Immed_u));
MPIU_Memcpy(result_addr, dest_addr, len);
if (MPIR_Compare_equal(compare_addr, dest_addr, datatype)) {
......
......@@ -879,7 +879,7 @@ static int MPIDI_CH3I_Send_immed_rmw_msg(MPIDI_RMA_ops *rma_op,
MPIDI_Pkt_init(cas_pkt, MPIDI_CH3_PKT_CAS);
}
cas_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] + rma_op->target_disp;
cas_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] + win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
cas_pkt->datatype = rma_op->target_datatype;
cas_pkt->target_win_handle = target_win_handle;
cas_pkt->request_handle = resp_req->handle;
......
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