Skip to content

Commit

Permalink
REVIEW: fix a2a without memmap
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrol aderholdt committed Feb 20, 2025
1 parent deb0e84 commit ebc57c5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/components/cl/basic/cl_basic_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ UCC_CLASS_CLEANUP_FUNC(ucc_cl_basic_context_t)
}

ucc_status_t ucc_cl_basic_mem_map(const ucc_base_context_t *context, int type, /* NOLINT */
void *address, size_t len, void *memh,
void *tl_h)
void *address, size_t len, void *memh, /* NOLINT */
void *tl_h) /* NOLINT */
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_cl_basic_mem_unmap(const ucc_base_context_t *context, int type, /* NOLINT */
void *tl_h)
void *tl_h) /* NOLINT */
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_cl_basic_memh_pack(const ucc_base_context_t *context, /* NOLINT */
void *memh, void **packed_buffer)
void *memh, void **packed_buffer) /* NOLINT */
{
return UCC_ERR_NOT_SUPPORTED;
}
Expand Down
37 changes: 20 additions & 17 deletions src/components/tl/ucp/alltoall/alltoall_onesided.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,27 @@ ucc_status_t ucc_tl_ucp_alltoall_onesided_start(ucc_coll_task_t *ctask)
nelems = (nelems / gsize) * ucc_dt_size(TASK_ARGS(task).src.info.datatype);
dest = dest + grank * nelems;

UCPCHECK_GOTO(
ucc_tl_ucp_put_nb((void *)(src + start * nelems), (void *)dest, nelems,
start, *src_memh, dst_memh[start], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, start, *src_memh,
dst_memh[start], team),
task, out);

for (peer = (start + 1) % gsize; peer != start; peer = (peer + 1) % gsize) {
UCPCHECK_GOTO(ucc_tl_ucp_put_nb(
(void *)(src + peer * nelems), (void *)dest, nelems,
peer, *src_memh, dst_memh[peer], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, *src_memh,
dst_memh[peer], team),
task, out);
if (ucc_likely(!(src_memh && dst_memh))) {
for (peer = start; task->onesided.put_posted < gsize; peer = (peer + 1) % gsize) {
UCPCHECK_GOTO(ucc_tl_ucp_put_nb(
(void *)(src + peer * nelems), (void *)dest, nelems,
peer, NULL, NULL, team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, NULL,
NULL, team),
task, out);
}
} else {
for (peer = start; task->onesided.put_posted < gsize; peer = (peer + 1) % gsize) {
UCPCHECK_GOTO(ucc_tl_ucp_put_nb(
(void *)(src + peer * nelems), (void *)dest, nelems,
peer, *src_memh, dst_memh[peer], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, *src_memh,
dst_memh[peer], team),
task, out);
}
}

return ucc_progress_queue_enqueue(UCC_TL_CORE_CTX(team)->pq, &task->super);
out:
return task->super.status;
Expand Down
11 changes: 6 additions & 5 deletions src/components/tl/ucp/tl_ucp_sendrecv.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,19 +421,21 @@ static inline ucc_status_t ucc_tl_ucp_put_nb(void *buffer, void *target,
int segment = 0;
ucp_rkey_h rkey = NULL;
uint64_t rva = 0;
void *ucp_memh = NULL;
ucs_status_ptr_t ucp_status;
ucc_status_t status;
ucp_ep_h ep;
void *ucp_memh = NULL;

status = ucc_tl_ucp_get_ep(team, dest_group_rank, &ep);
if (ucc_unlikely(UCC_OK != status)) {
return status;
}

status = ucc_tl_ucp_get_memh(team, src_memh, &ucp_memh);
if (ucc_unlikely(UCC_OK != status)) {
return status;
if (src_memh) {
status = ucc_tl_ucp_get_memh(team, src_memh, &ucp_memh);
if (ucc_unlikely(UCC_OK != status)) {
return status;
}
}

status = ucc_tl_ucp_resolve_p2p_by_va(team, target, &ep, dest_group_rank,
Expand All @@ -442,7 +444,6 @@ static inline ucc_status_t ucc_tl_ucp_put_nb(void *buffer, void *target,
return status;
}


req_param.op_attr_mask =
UCP_OP_ATTR_FIELD_CALLBACK | UCP_OP_ATTR_FIELD_USER_DATA;
req_param.cb.send = ucc_tl_ucp_put_completion_cb;
Expand Down

0 comments on commit ebc57c5

Please sign in to comment.