Skip to content

Commit

Permalink
fix(rdv): fix iovec when LCI_RDV_PROTOCOL=writeimm
Browse files Browse the repository at this point in the history
  • Loading branch information
JiakunYan committed Nov 28, 2023
1 parent 4c4273b commit e842f1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions lci/runtime/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct __attribute__((packed)) LCII_packet_rtr_rbuffer_info_t {
struct __attribute__((packed)) LCII_packet_rtr_t {
uintptr_t
send_ctx; /* the address of the related context on the source side */
LCII_rdv_type_t rdv_type; /* type of this rendezvous message */
union {
// When using writeimm protocol
uint32_t
Expand Down
10 changes: 6 additions & 4 deletions lci/runtime/rendezvous.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,11 @@ static inline void LCII_handle_rts(LCI_endpoint_t ep, LCII_packet_t* packet,

static inline void LCII_handle_rtr(LCI_endpoint_t ep, LCII_packet_t* packet)
{
LCII_rdv_type_t rdv_type = packet->data.rtr.rdv_type;
LCII_context_t* ctx = (LCII_context_t*)packet->data.rtr.send_ctx;
// Set up the "extended context" for write protocol
void* ctx_to_pass = ctx;
if (LCI_RDV_PROTOCOL == LCI_RDV_WRITE) {
if (LCI_RDV_PROTOCOL == LCI_RDV_WRITE || rdv_type == LCII_RDV_IOVEC) {
LCII_extended_context_t* ectx =
LCIU_malloc(sizeof(LCII_extended_context_t));
LCII_initilize_comp_attr(ectx->comp_attr);
Expand Down Expand Up @@ -333,16 +334,17 @@ static inline void LCII_handle_rtr(LCI_endpoint_t ep, LCII_packet_t* packet)
LCII_PCOUNTER_END(rtr_mem_reg_timer);
// issue the put/putimm
LCII_PCOUNTER_START(rtr_put_timer);
if (LCI_RDV_PROTOCOL == LCI_RDV_WRITE) {
if (LCI_RDV_PROTOCOL == LCI_RDV_WRITE || rdv_type == LCII_RDV_IOVEC) {
LCIS_post_put_bq(ep->bq_p, ep->bq_spinlock_p,
ep->device->endpoint_progress->endpoint, (int)ctx->rank,
lbuffer->address, lbuffer->length, lbuffer->segment->mr,
packet->data.rtr.rbuffer_info_p[i].remote_addr_base,
packet->data.rtr.rbuffer_info_p[i].remote_addr_offset,
packet->data.rtr.rbuffer_info_p[i].rkey, ctx_to_pass);
} else {
LCI_DBG_Assert(LCI_RDV_PROTOCOL == LCI_RDV_WRITEIMM,
"Unexpected rdv protocol!\n");
LCI_DBG_Assert(
LCI_RDV_PROTOCOL == LCI_RDV_WRITEIMM && rdv_type != LCII_RDV_IOVEC,
"Unexpected rdv protocol!\n");
LCIS_post_putImm_bq(ep->bq_p, ep->bq_spinlock_p,
ep->device->endpoint_progress->endpoint,
(int)ctx->rank, lbuffer->address, lbuffer->length,
Expand Down

0 comments on commit e842f1a

Please sign in to comment.