Commit 9bc09a30 authored by Xin Zhao's avatar Xin Zhao
Browse files

Initialize flag in pkt when creating RMA operation.



Here we initalize packet flag as FLAG_NONE when creating
this packet, and add flags later when needed.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent a9d968cc
......@@ -338,7 +338,7 @@ static int issue_put_op(MPIDI_RMA_Op_t * rma_op, MPID_Win *win_ptr,
rma_op->request = NULL;
put_pkt->flags = flags;
put_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
put_pkt->lock_type = target_ptr->lock_type;
......@@ -399,7 +399,7 @@ static int issue_acc_op(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
rma_op->request = NULL;
accum_pkt->flags = flags;
accum_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
accum_pkt->lock_type = target_ptr->lock_type;
......@@ -484,7 +484,7 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
/* Note: Get_accumulate uses the same packet type as accumulate */
get_accum_pkt->request_handle = resp_req->handle;
get_accum_pkt->flags = flags;
get_accum_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
get_accum_pkt->lock_type = target_ptr->lock_type;
......@@ -599,7 +599,7 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
}
get_pkt->request_handle = rma_op->request->handle;
get_pkt->flags = flags;
get_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
get_pkt->lock_type = target_ptr->lock_type;
......@@ -699,7 +699,7 @@ static int issue_cas_op(MPIDI_RMA_Op_t * rma_op,
rma_op->request->dev.source_win_handle = cas_pkt->source_win_handle;
cas_pkt->request_handle = rma_op->request->handle;
cas_pkt->flags = flags;
cas_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
cas_pkt->lock_type = target_ptr->lock_type;
......@@ -768,7 +768,7 @@ static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
fop_pkt->request_handle = resp_req->handle;
fop_pkt->flags = flags;
fop_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
fop_pkt->lock_type = target_ptr->lock_type;
......
......@@ -120,6 +120,7 @@ int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
put_pkt->source_win_handle = win_ptr->handle;
put_pkt->immed_len = 0;
put_pkt->origin_rank = rank;
put_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
/* FIXME: For contig and very short operations, use a streamlined op */
new_ptr->origin_addr = (void *) origin_addr;
......@@ -303,6 +304,7 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
get_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_pkt->source_win_handle = win_ptr->handle;
get_pkt->origin_rank = rank;
get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
/* FIXME: For contig and very short operations, use a streamlined op */
new_ptr->origin_addr = origin_addr;
......@@ -468,6 +470,7 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp
accum_pkt->source_win_handle = win_ptr->handle;
accum_pkt->immed_len = 0;
accum_pkt->origin_rank = rank;
accum_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = (void *) origin_addr;
new_ptr->origin_count = origin_count;
......@@ -658,6 +661,7 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
get_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_pkt->source_win_handle = win_ptr->handle;
get_pkt->origin_rank = rank;
get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = result_addr;
new_ptr->origin_count = result_count;
......@@ -693,6 +697,7 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
get_accum_pkt->source_win_handle = win_ptr->handle;
get_accum_pkt->immed_len = 0;
get_accum_pkt->origin_rank = rank;
get_accum_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = (void *) origin_addr;
new_ptr->origin_count = origin_count;
......@@ -982,6 +987,7 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
cas_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
cas_pkt->source_win_handle = win_ptr->handle;
cas_pkt->origin_rank = rank;
cas_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = (void *) origin_addr;
new_ptr->origin_count = 1;
......@@ -1110,6 +1116,7 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
get_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_pkt->source_win_handle = win_ptr->handle;
get_pkt->origin_rank = rank;
get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = result_addr;
new_ptr->origin_count = 1;
......@@ -1131,6 +1138,7 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
fop_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
fop_pkt->immed_len = 0;
fop_pkt->origin_rank = rank;
fop_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = (void *) origin_addr;
new_ptr->origin_count = 1;
......
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