diff --git a/lci/experimental/coll/coll.h b/lci/experimental/coll/coll.h index f690b44b..07e4f7cf 100644 --- a/lci/experimental/coll/coll.h +++ b/lci/experimental/coll/coll.h @@ -144,7 +144,7 @@ static inline void LCIXC_mcoll_complete(LCI_endpoint_t ep, LCI_mbuffer_t buffer, LCII_comp_attr_set_comp_type(ctx->comp_attr, ep->msg_comp_type); ctx->data_type = LCI_MEDIUM; ctx->user_context = user_context; - ctx->data = (LCI_data_t){.mbuffer = buffer}; + ctx->data.mbuffer = buffer; ctx->rank = -1; /* this doesn't make much sense for collectives */ ctx->tag = tag; ctx->completion = completion; @@ -160,7 +160,7 @@ static inline void LCIXC_lcoll_complete(LCI_endpoint_t ep, LCI_lbuffer_t buffer, LCII_comp_attr_set_comp_type(ctx->comp_attr, ep->msg_comp_type); ctx->data_type = LCI_LONG; ctx->user_context = user_context; - ctx->data = (LCI_data_t){.lbuffer = buffer}; + ctx->data.lbuffer = buffer; ctx->rank = -1; /* this doesn't make much sense for collectives */ ctx->tag = tag; ctx->completion = completion; diff --git a/lci/runtime/completion/sync_flag.c b/lci/runtime/completion/sync_flag.c index 09521657..4421c5ee 100644 --- a/lci/runtime/completion/sync_flag.c +++ b/lci/runtime/completion/sync_flag.c @@ -57,9 +57,8 @@ LCI_error_t LCI_sync_signal(LCI_comp_t completion, LCI_request_t request) ctx->rank = request.rank; ctx->tag = request.tag; ctx->data_type = request.type; - ctx->data = request.data; + memcpy(&ctx->data, &request.data, sizeof(ctx->data)); ctx->user_context = request.user_context; - LCII_sync_signal(completion, ctx); return LCI_OK; } diff --git a/lci/runtime/lcii.h b/lci/runtime/lcii.h index 75cf150d..5cf8f3d1 100644 --- a/lci/runtime/lcii.h +++ b/lci/runtime/lcii.h @@ -137,7 +137,15 @@ typedef struct __attribute__((aligned(LCI_CACHE_LINE))) { // LCI_request_t fields, 52 bytes LCI_data_type_t data_type; // 4 bytes void* user_context; // 8 bytes - LCI_data_t data; // 32 bytes + union { + LCI_short_t immediate; // 32 bytes + struct { // 24 bytes + LCI_mbuffer_t mbuffer; + LCII_packet_t *packet; + }; + LCI_lbuffer_t lbuffer; // 24 bytes + LCI_iovec_t iovec; // 28 bytes + } data; // 32 bytes uint32_t rank; // 4 bytes LCI_tag_t tag; // 4 bytes // used by LCI internally @@ -200,8 +208,11 @@ static inline LCI_request_t LCII_ctx2req(LCII_context_t* ctx) .rank = ctx->rank, .tag = ctx->tag, .type = ctx->data_type, - .data = ctx->data, .user_context = ctx->user_context}; + LCI_DBG_Assert(sizeof(request.data) == sizeof(ctx->data), "Unexpected size!\n"); + memcpy(&request.data, &ctx->data, sizeof(request.data)); + LCI_DBG_Assert(request.data.mbuffer.address == ctx->data.mbuffer.address, "Invalid conversion!"); + LCI_DBG_Assert(request.data.mbuffer.length == ctx->data.mbuffer.length, "Invalid conversion!"); LCIU_free(ctx); return request; }