static size_t ucp_tag_pack_eager_middle_dt(void *dest, void *arg) { ucp_eager_middle_hdr_t *hdr = dest; ucp_request_t *req = arg; size_t length; length = ucp_ep_get_max_bcopy(req->send.ep, req->send.lane) - sizeof(*hdr); hdr->msg_id = req->send.tag.message_id; hdr->offset = req->send.state.dt.offset; return sizeof(*hdr) + ucp_dt_pack(req->send.datatype, hdr + 1, req->send.buffer, &req->send.state.dt, length); }
static size_t ucp_tag_pack_eager_only_dt(void *dest, void *arg) { ucp_eager_hdr_t *hdr = dest; ucp_request_t *req = arg; size_t length; hdr->super.tag = req->send.tag.tag; ucs_assert(req->send.state.dt.offset == 0); length = ucp_dt_pack(req->send.datatype, hdr + 1, req->send.buffer, &req->send.state.dt, req->send.length); ucs_assert(length == req->send.length); return sizeof(*hdr) + length; }
static size_t ucp_tag_pack_eager_middle_dt(void *dest, void *arg) { ucp_eager_hdr_t *hdr = dest; ucp_request_t *req = arg; size_t length; length = ucp_ep_config(req->send.ep)->am.max_bcopy - sizeof(*hdr); ucs_debug("pack eager_middle paylen %zu offset %zu", length, req->send.state.offset); hdr->super.tag = req->send.tag; return sizeof(*hdr) + ucp_dt_pack(req->send.datatype, hdr + 1, req->send.buffer, &req->send.state, length); }
static size_t ucp_tag_pack_eager_last_dt(void *dest, void *arg) { ucp_eager_middle_hdr_t *hdr = dest; ucp_request_t *req = arg; size_t length, ret_length; length = req->send.length - req->send.state.dt.offset; hdr->msg_id = req->send.tag.message_id; hdr->offset = req->send.state.dt.offset; ret_length = ucp_dt_pack(req->send.datatype, hdr + 1, req->send.buffer, &req->send.state.dt, length); ucs_assertv(ret_length == length, "length=%zu, max_length=%zu", ret_length, length); return sizeof(*hdr) + ret_length; }
static size_t ucp_tag_pack_eager_sync_only_dt(void *dest, void *arg) { ucp_eager_sync_hdr_t *hdr = dest; ucp_request_t *req = arg; size_t length; hdr->super.super.tag = req->send.tag.tag; hdr->req.sender_uuid = req->send.ep->worker->uuid; hdr->req.reqptr = (uintptr_t)req; ucs_assert(req->send.state.dt.offset == 0); length = ucp_dt_pack(req->send.datatype, hdr + 1, req->send.buffer, &req->send.state.dt, req->send.length); ucs_assert(length == req->send.length); return sizeof(*hdr) + length; }
static size_t ucp_tag_pack_eager_last_dt(void *dest, void *arg) { ucp_eager_hdr_t *hdr = dest; ucp_request_t *req = arg; size_t length, ret_length; length = req->send.length - req->send.state.offset; hdr->super.tag = req->send.tag; ret_length = ucp_dt_pack(req->send.datatype, hdr + 1, req->send.buffer, &req->send.state, length); ucs_debug("pack eager_last paylen %zu offset %zu", length, req->send.state.offset); ucs_assertv(ret_length == length, "length=%zu, max_length=%zu", ret_length, length); return sizeof(*hdr) + ret_length; }
static size_t ucp_tag_pack_eager_first_dt(void *dest, void *arg) { ucp_eager_first_hdr_t *hdr = dest; ucp_request_t *req = arg; size_t length; length = ucp_ep_config(req->send.ep)->am.max_bcopy - sizeof(*hdr); hdr->super.super.tag = req->send.tag; hdr->total_len = req->send.length; ucs_debug("pack eager_first paylen %zu", length); ucs_assert(req->send.state.offset == 0); ucs_assert(req->send.length > length); return sizeof(*hdr) + ucp_dt_pack(req->send.datatype, hdr + 1, req->send.buffer, &req->send.state, length); }
static size_t ucp_tag_pack_eager_first_dt(void *dest, void *arg) { ucp_eager_first_hdr_t *hdr = dest; ucp_request_t *req = arg; size_t length; ucs_assert(req->send.lane == ucp_ep_get_am_lane(req->send.ep)); length = ucp_ep_get_max_bcopy(req->send.ep, req->send.lane) - sizeof(*hdr); hdr->super.super.tag = req->send.tag.tag; hdr->total_len = req->send.length; hdr->msg_id = req->send.tag.message_id; ucs_assert(req->send.state.dt.offset == 0); ucs_assert(req->send.length > length); return sizeof(*hdr) + ucp_dt_pack(req->send.datatype, hdr + 1, req->send.buffer, &req->send.state.dt, length); }