Commit c3f87fe3 authored by James Dinan's avatar James Dinan
Browse files

Added flags field to RMA op packet headers

Added flags field to RMA operation packets that are sent from origin to target.
This will be used to piggyback RMA synchronization operations.

Reviewer: goodell
parent 90b3b2f8
......@@ -109,6 +109,15 @@ enum MPIDI_CH3_Pkt_types
};
typedef int16_t MPIDI_CH3_Pkt_type_t;
typedef uint16_t MPIDI_CH3_Pkt_flags_t;
/* Flag vector bits:*/
#define MPIDI_CH3_PKT_FLAG_NONE 0
#define MPIDI_CH3_PKT_FLAG_RMA_LOCK 1 /* ...............X */
#define MPIDI_CH3_PKT_FLAG_RMA_UNLOCK 2 /* ..............X. */
#define MPIDI_CH3_PKT_FLAG_RMA_FLUSH 4 /* .............X.. */
#define MPIDI_CH3_PKT_FLAG_RMA_REQ_ACK 8 /* ............X... */
#define MPIDI_CH3_PKT_FLAG_RMA_AT_COMPLETE 16 /* ...........X.... */
typedef struct MPIDI_CH3_Pkt_send
{
......@@ -189,6 +198,7 @@ MPIDI_CH3_PKT_DEFS
typedef struct MPIDI_CH3_Pkt_put
{
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
void *addr;
int count;
MPI_Datatype datatype;
......@@ -206,6 +216,7 @@ MPIDI_CH3_Pkt_put_t;
typedef struct MPIDI_CH3_Pkt_get
{
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
void *addr;
int count;
MPI_Datatype datatype;
......@@ -231,6 +242,7 @@ MPIDI_CH3_Pkt_get_resp_t;
typedef struct MPIDI_CH3_Pkt_accum
{
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Request request_handle; /* For get_accumulate response */
void *addr;
int count;
......@@ -257,6 +269,7 @@ MPIDI_CH3_Pkt_get_accum_resp_t;
typedef struct MPIDI_CH3_Pkt_accum_immed
{
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
void *addr;
int count;
/* FIXME: Compress datatype/op into a single word (immedate mode) */
......@@ -277,6 +290,7 @@ MPIDI_CH3_Pkt_accum_immed_t;
typedef struct MPIDI_CH3_Pkt_cas
{
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Datatype datatype;
void *addr;
MPI_Request request_handle;
......@@ -304,6 +318,7 @@ MPIDI_CH3_Pkt_cas_resp_t;
typedef struct MPIDI_CH3_Pkt_fop
{
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Datatype datatype;
void *addr;
MPI_Op op;
......@@ -354,6 +369,7 @@ typedef MPIDI_CH3_Pkt_lock_t MPIDI_CH3_Pkt_flush_t;
typedef struct MPIDI_CH3_Pkt_lock_put_unlock
{
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Win target_win_handle;
MPI_Win source_win_handle;
int lock_type;
......@@ -366,6 +382,7 @@ MPIDI_CH3_Pkt_lock_put_unlock_t;
typedef struct MPIDI_CH3_Pkt_lock_get_unlock
{
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Win target_win_handle;
MPI_Win source_win_handle;
int lock_type;
......@@ -379,6 +396,7 @@ MPIDI_CH3_Pkt_lock_get_unlock_t;
typedef struct MPIDI_CH3_Pkt_lock_accum_unlock
{
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Win target_win_handle;
MPI_Win source_win_handle;
int lock_type;
......
......@@ -559,7 +559,7 @@ static int MPIDI_CH3I_Send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
MPIDI_Pkt_init(put_pkt, MPIDI_CH3_PKT_PUT);
put_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
put_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
put_pkt->count = rma_op->target_count;
put_pkt->datatype = rma_op->target_datatype;
put_pkt->dataloop_size = 0;
......@@ -598,6 +598,7 @@ static int MPIDI_CH3I_Send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
MPIDI_Pkt_init(accum_pkt, MPIDI_CH3_PKT_GET_ACCUM);
accum_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
accum_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
accum_pkt->count = rma_op->target_count;
accum_pkt->datatype = rma_op->target_datatype;
accum_pkt->dataloop_size = 0;
......@@ -614,6 +615,7 @@ static int MPIDI_CH3I_Send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
MPIDI_Pkt_init(accum_pkt, MPIDI_CH3_PKT_ACCUMULATE);
accum_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
accum_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
accum_pkt->count = rma_op->target_count;
accum_pkt->datatype = rma_op->target_datatype;
accum_pkt->dataloop_size = 0;
......@@ -873,6 +875,7 @@ static int MPIDI_CH3I_Send_contig_acc_msg(MPIDI_RMA_Op_t *rma_op,
MPIDI_Pkt_init(accumi_pkt, MPIDI_CH3_PKT_ACCUM_IMMED);
accumi_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
accumi_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
accumi_pkt->count = rma_op->target_count;
accumi_pkt->datatype = rma_op->target_datatype;
accumi_pkt->op = rma_op->op;
......@@ -899,6 +902,7 @@ static int MPIDI_CH3I_Send_contig_acc_msg(MPIDI_RMA_Op_t *rma_op,
MPIDI_Pkt_init(accum_pkt, MPIDI_CH3_PKT_ACCUMULATE);
accum_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
accum_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
accum_pkt->count = rma_op->target_count;
accum_pkt->datatype = rma_op->target_datatype;
accum_pkt->dataloop_size = 0;
......@@ -1010,6 +1014,7 @@ static int MPIDI_CH3I_Send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
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->flags = MPIDI_CH3_PKT_FLAG_NONE;
cas_pkt->datatype = rma_op->target_datatype;
cas_pkt->target_win_handle = target_win_handle;
cas_pkt->request_handle = resp_req->handle;
......@@ -1038,6 +1043,7 @@ static int MPIDI_CH3I_Send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
fop_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
fop_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
fop_pkt->datatype = rma_op->target_datatype;
fop_pkt->target_win_handle = target_win_handle;
fop_pkt->source_win_handle = source_win_handle;
......@@ -1162,6 +1168,7 @@ static int MPIDI_CH3I_Recv_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
MPIDI_Pkt_init(get_pkt, MPIDI_CH3_PKT_GET);
get_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
get_pkt->count = rma_op->target_count;
get_pkt->datatype = rma_op->target_datatype;
get_pkt->request_handle = req->handle;
......@@ -1683,6 +1690,7 @@ int MPIDI_Win_complete(MPID_Win *win_ptr)
MPID_Request *request;
MPIDI_Pkt_init(put_pkt, MPIDI_CH3_PKT_PUT);
put_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
put_pkt->addr = NULL;
put_pkt->count = 0;
put_pkt->datatype = MPI_INT;
......
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