Skip to content

Commit

Permalink
CODESTYLE: fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrol aderholdt committed Jan 16, 2025
1 parent 93547ea commit 4a2f9c6
Show file tree
Hide file tree
Showing 20 changed files with 275 additions and 227 deletions.
11 changes: 6 additions & 5 deletions src/components/tl/cuda/tl_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ ucc_status_t ucc_tl_cuda_get_context_attr(const ucc_base_context_t *context,
ucc_base_ctx_attr_t *base_attr);

ucc_status_t ucc_tl_cuda_mem_map(const ucc_base_context_t *context, int type,
void *address,
size_t len,
void *memh, void *tl_h);
void *address, size_t len, void *memh,
void *tl_h);

ucc_status_t ucc_tl_cuda_mem_unmap(const ucc_base_context_t *context, int type, void *memh);
ucc_status_t ucc_tl_cuda_mem_unmap(const ucc_base_context_t *context, int type,
void *memh);

ucc_status_t ucc_tl_cuda_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer);
ucc_status_t ucc_tl_cuda_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer);

UCC_CLASS_DEFINE_NEW_FUNC(ucc_tl_cuda_context_t, ucc_base_context_t,
const ucc_base_context_params_t *,
Expand Down
10 changes: 5 additions & 5 deletions src/components/tl/cuda/tl_cuda_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ UCC_CLASS_INIT_FUNC(ucc_tl_cuda_context_t,
}

ucc_status_t ucc_tl_cuda_mem_map(const ucc_base_context_t *context,
void *address,
size_t len,
void *memh)
void *address, size_t len, void *memh)
{
return UCC_ERR_NOT_IMPLEMENTED;
}

ucc_status_t ucc_tl_cuda_mem_unmap(const ucc_base_context_t *context, void *memh)
ucc_status_t ucc_tl_cuda_mem_unmap(const ucc_base_context_t *context,
void *memh)
{
return UCC_ERR_NOT_IMPLEMENTED;
}

ucc_status_t ucc_tl_cuda_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer)
ucc_status_t ucc_tl_cuda_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_IMPLEMENTED;
}
Expand Down
11 changes: 6 additions & 5 deletions src/components/tl/mlx5/tl_mlx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ ucc_status_t ucc_tl_mlx5_get_context_attr(const ucc_base_context_t *context,
ucc_base_ctx_attr_t * base_attr);

ucc_status_t ucc_tl_mlx5_mem_map(const ucc_base_context_t *context, int type,
void *address,
size_t len,
void *memh, void *tl_h);
void *address, size_t len, void *memh,
void *tl_h);

ucc_status_t ucc_tl_mlx5_mem_unmap(const ucc_base_context_t *context, int type, void *memh);
ucc_status_t ucc_tl_mlx5_mem_unmap(const ucc_base_context_t *context, int type,
void *memh);

ucc_status_t ucc_tl_mlx5_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer);
ucc_status_t ucc_tl_mlx5_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer);

ucc_status_t ucc_tl_mlx5_get_lib_properties(ucc_base_lib_properties_t *prop);

Expand Down
11 changes: 6 additions & 5 deletions src/components/tl/mlx5/tl_mlx5_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,19 +304,20 @@ ucc_status_t ucc_tl_mlx5_context_create_epilog(ucc_base_context_t *context)
}

ucc_status_t ucc_tl_mlx5_mem_map(const ucc_base_context_t *context, int type,
void *address,
size_t len,
void *memh, void *tl_h)
void *address, size_t len, void *memh,
void *tl_h)
{
return UCC_ERR_NOT_IMPLEMENTED;
}

ucc_status_t ucc_tl_mlx5_mem_unmap(const ucc_base_context_t *context, int type, void *memh)
ucc_status_t ucc_tl_mlx5_mem_unmap(const ucc_base_context_t *context, int type,
void *memh)
{
return UCC_ERR_NOT_IMPLEMENTED;
}

ucc_status_t ucc_tl_mlx5_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer)
ucc_status_t ucc_tl_mlx5_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_IMPLEMENTED;
}
11 changes: 6 additions & 5 deletions src/components/tl/nccl/tl_nccl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ ucc_status_t ucc_tl_nccl_get_context_attr(const ucc_base_context_t *context,
ucc_base_ctx_attr_t *base_attr);

ucc_status_t ucc_tl_nccl_mem_map(const ucc_base_context_t *context, int type,
void *address,
size_t len,
void *memh, void *tl_h);
void *address, size_t len, void *memh,
void *tl_h);

ucc_status_t ucc_tl_nccl_mem_unmap(const ucc_base_context_t *context, int type, void *memh);
ucc_status_t ucc_tl_nccl_mem_unmap(const ucc_base_context_t *context, int type,
void *memh);

ucc_status_t ucc_tl_nccl_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer);
ucc_status_t ucc_tl_nccl_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer);

static ucc_config_field_t ucc_tl_nccl_lib_config_table[] = {
{"", "", NULL, ucc_offsetof(ucc_tl_nccl_lib_config_t, super),
Expand Down
11 changes: 6 additions & 5 deletions src/components/tl/nccl/tl_nccl_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,20 @@ ucc_tl_nccl_get_context_attr(const ucc_base_context_t *context, /* NOLINT */
}

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

ucc_status_t ucc_tl_nccl_mem_unmap(const ucc_base_context_t *context, int type, void *memh)
ucc_status_t ucc_tl_nccl_mem_unmap(const ucc_base_context_t *context, int type,
void *memh)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_nccl_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer)
ucc_status_t ucc_tl_nccl_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
}
11 changes: 6 additions & 5 deletions src/components/tl/rccl/tl_rccl.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ ucc_status_t ucc_tl_rccl_get_context_attr(const ucc_base_context_t *context,
ucc_base_ctx_attr_t *base_attr);

ucc_status_t ucc_tl_rccl_mem_map(const ucc_base_context_t *context, int type,
void *address,
size_t len,
void *memh, void *tl_h);
void *address, size_t len, void *memh,
void *tl_h);

ucc_status_t ucc_tl_rccl_mem_unmap(const ucc_base_context_t *context, int type, void *memh);
ucc_status_t ucc_tl_rccl_mem_unmap(const ucc_base_context_t *context, int type,
void *memh);

ucc_status_t ucc_tl_rccl_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer);
ucc_status_t ucc_tl_rccl_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer);

static ucc_config_field_t ucc_tl_rccl_lib_config_table[] = {
{"", "", NULL, ucc_offsetof(ucc_tl_rccl_lib_config_t, super),
Expand Down
11 changes: 6 additions & 5 deletions src/components/tl/rccl/tl_rccl_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,20 @@ ucc_tl_rccl_get_context_attr(const ucc_base_context_t *context, /* NOLINT */
}

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

ucc_status_t ucc_tl_rccl_mem_unmap(const ucc_base_context_t *context, int type, void *memh)
ucc_status_t ucc_tl_rccl_mem_unmap(const ucc_base_context_t *context, int type,
void *memh)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_rccl_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer)
ucc_status_t ucc_tl_rccl_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
}
11 changes: 6 additions & 5 deletions src/components/tl/self/tl_self.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ ucc_status_t ucc_tl_self_get_context_attr(const ucc_base_context_t *context,
ucc_base_ctx_attr_t *base_attr);

ucc_status_t ucc_tl_self_mem_map(const ucc_base_context_t *context, int type,
void *address,
size_t len,
void *memh, void *tl_h);
void *address, size_t len, void *memh,
void *tl_h);

ucc_status_t ucc_tl_self_mem_unmap(const ucc_base_context_t *context, int type, void *memh);
ucc_status_t ucc_tl_self_mem_unmap(const ucc_base_context_t *context, int type,
void *memh);

ucc_status_t ucc_tl_self_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer);
ucc_status_t ucc_tl_self_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer);

ucc_status_t ucc_tl_self_get_lib_properties(ucc_base_lib_properties_t *prop);

Expand Down
13 changes: 7 additions & 6 deletions src/components/tl/self/tl_self_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,21 @@ ucc_tl_self_get_context_attr(const ucc_base_context_t *context, /* NOLINT */
return UCC_OK;
}

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

ucc_status_t ucc_tl_self_mem_unmap(const ucc_base_context_t *context, int type, void *memh)
ucc_status_t ucc_tl_self_mem_unmap(const ucc_base_context_t *context, int type,
void *memh)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_self_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer)
ucc_status_t ucc_tl_self_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
}
11 changes: 6 additions & 5 deletions src/components/tl/sharp/tl_sharp.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ ucc_status_t ucc_tl_sharp_get_context_attr(const ucc_base_context_t *context,
ucc_base_ctx_attr_t *base_attr);

ucc_status_t ucc_tl_sharp_mem_map(const ucc_base_context_t *context, int type,
void *address,
size_t len,
void *memh, void *tl_h);
void *address, size_t len, void *memh,
void *tl_h);

ucc_status_t ucc_tl_sharp_mem_unmap(const ucc_base_context_t *context, int type, void *memh);
ucc_status_t ucc_tl_sharp_mem_unmap(const ucc_base_context_t *context, int type,
void *memh);

ucc_status_t ucc_tl_sharp_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer);
ucc_status_t ucc_tl_sharp_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer);

static ucc_config_field_t ucc_tl_sharp_lib_config_table[] = {
{"", "", NULL, ucc_offsetof(ucc_tl_sharp_lib_config_t, super),
Expand Down
11 changes: 6 additions & 5 deletions src/components/tl/sharp/tl_sharp_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,19 +513,20 @@ ucc_status_t ucc_tl_sharp_get_context_attr(const ucc_base_context_t *context, /*
}

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

ucc_status_t ucc_tl_sharp_mem_unmap(const ucc_base_context_t *context, int type, void *memh)
ucc_status_t ucc_tl_sharp_mem_unmap(const ucc_base_context_t *context, int type,
void *memh)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_sharp_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer)
ucc_status_t ucc_tl_sharp_memh_pack(const ucc_base_context_t *context,
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
}
45 changes: 25 additions & 20 deletions src/components/tl/ucp/alltoall/alltoall_onesided.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,40 @@ void ucc_tl_ucp_alltoall_onesided_progress(ucc_coll_task_t *ctask);

ucc_status_t ucc_tl_ucp_alltoall_onesided_start(ucc_coll_task_t *ctask)
{
ucc_tl_ucp_task_t *task = ucc_derived_of(ctask, ucc_tl_ucp_task_t);
ucc_tl_ucp_team_t *team = TASK_TEAM(task);
ptrdiff_t src = (ptrdiff_t)TASK_ARGS(task).src.info.buffer;
ptrdiff_t dest = (ptrdiff_t)TASK_ARGS(task).dst.info.buffer;
size_t nelems = TASK_ARGS(task).src.info.count;
ucc_rank_t grank = UCC_TL_TEAM_RANK(team);
ucc_rank_t gsize = UCC_TL_TEAM_SIZE(team);
ucc_rank_t start = (grank + 1) % gsize;
long * pSync = TASK_ARGS(task).global_work_buffer;
ucc_mem_map_mem_h *src_memh = TASK_ARGS(task).src_memh.global_memh;
ucc_mem_map_mem_h *dst_memh = TASK_ARGS(task).dst_memh.global_memh;
ucc_tl_ucp_task_t *task = ucc_derived_of(ctask, ucc_tl_ucp_task_t);
ucc_tl_ucp_team_t *team = TASK_TEAM(task);
ptrdiff_t src = (ptrdiff_t)TASK_ARGS(task).src.info.buffer;
ptrdiff_t dest = (ptrdiff_t)TASK_ARGS(task).dst.info.buffer;
size_t nelems = TASK_ARGS(task).src.info.count;
ucc_rank_t grank = UCC_TL_TEAM_RANK(team);
ucc_rank_t gsize = UCC_TL_TEAM_SIZE(team);
ucc_rank_t start = (grank + 1) % gsize;
long *pSync = TASK_ARGS(task).global_work_buffer;
ucc_mem_map_mem_h *src_memh = TASK_ARGS(task).src_memh.global_memh;
ucc_mem_map_mem_h *dst_memh = TASK_ARGS(task).dst_memh.global_memh;
ucc_rank_t peer;

ucc_tl_ucp_task_reset(task, UCC_INPROGRESS);
/* TODO: change when support for library-based work buffers is complete */
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[start], dst_memh[start], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, start, src_memh[start], dst_memh[start], team), task, out);
UCPCHECK_GOTO(
ucc_tl_ucp_put_nb((void *)(src + start * nelems), (void *)dest, nelems,
start, src_memh[start], dst_memh[start], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, start, src_memh[start],
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[peer], dst_memh[peer], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, src_memh[peer], dst_memh[peer], team), task,
out);
UCPCHECK_GOTO(ucc_tl_ucp_put_nb(
(void *)(src + peer * nelems), (void *)dest, nelems,
peer, src_memh[peer], dst_memh[peer], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, src_memh[peer],
dst_memh[peer], team),
task, out);
}

return ucc_progress_queue_enqueue(UCC_TL_CORE_CTX(team)->pq, &task->super);
Expand Down
10 changes: 6 additions & 4 deletions src/components/tl/ucp/alltoallv/alltoallv_onesided.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ ucc_status_t ucc_tl_ucp_alltoallv_onesided_start(ucc_coll_task_t *ctask)
ucc_aint_t *d_disp = TASK_ARGS(task).dst.info_v.displacements;
size_t sdt_size = ucc_dt_size(TASK_ARGS(task).src.info_v.datatype);
size_t rdt_size = ucc_dt_size(TASK_ARGS(task).dst.info_v.datatype);
ucc_mem_map_mem_h *src_memh = TASK_ARGS(task).src_memh.global_memh;
ucc_mem_map_mem_h *dst_memh = TASK_ARGS(task).dst_memh.global_memh;
ucc_mem_map_mem_h *src_memh = TASK_ARGS(task).src_memh.global_memh;
ucc_mem_map_mem_h *dst_memh = TASK_ARGS(task).dst_memh.global_memh;
ucc_rank_t peer;
size_t sd_disp, dd_disp, data_size;

Expand All @@ -48,9 +48,11 @@ ucc_status_t ucc_tl_ucp_alltoallv_onesided_start(ucc_coll_task_t *ctask)

UCPCHECK_GOTO(ucc_tl_ucp_put_nb(PTR_OFFSET(src, sd_disp),
PTR_OFFSET(dest, dd_disp),
data_size, peer, src_memh[peer], dst_memh[peer], team, task),
data_size, peer, src_memh[peer],
dst_memh[peer], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, src_memh[peer], dst_memh[peer], team), task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, src_memh[peer],
dst_memh[peer], team), task, out);
}
return ucc_progress_queue_enqueue(UCC_TL_CORE_CTX(team)->pq, &task->super);
out:
Expand Down
13 changes: 6 additions & 7 deletions src/components/tl/ucp/tl_ucp.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ ucc_status_t ucc_tl_ucp_get_lib_properties(ucc_base_lib_properties_t *prop);
ucc_status_t ucc_tl_ucp_get_context_attr(const ucc_base_context_t *context,
ucc_base_ctx_attr_t *base_attr);

ucc_status_t ucc_tl_ucp_mem_map(const ucc_base_context_t *context,
int type,
void *address,
size_t len,
void *memh,
ucc_status_t ucc_tl_ucp_mem_map(const ucc_base_context_t *context, int type,
void *address, size_t len, void *memh,
void *tl_h);

ucc_status_t ucc_tl_ucp_memh_pack(const ucc_base_context_t *context, void *memh, void **pack_buffer);
ucc_status_t ucc_tl_ucp_memh_pack(const ucc_base_context_t *context, void *memh,
void **pack_buffer);

ucc_status_t ucc_tl_ucp_mem_unmap(const ucc_base_context_t *context, int type, void *memh);
ucc_status_t ucc_tl_ucp_mem_unmap(const ucc_base_context_t *context, int type,
void *memh);

ucc_config_field_t ucc_tl_ucp_lib_config_table[] = {
{"", "", NULL, ucc_offsetof(ucc_tl_ucp_lib_config_t, super),
Expand Down
6 changes: 3 additions & 3 deletions src/components/tl/ucp/tl_ucp.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ typedef struct ucc_tl_ucp_remote_info {

typedef struct ucc_tl_ucp_memh_data {
ucc_tl_ucp_remote_info_t rinfo;
void *packed_memh;
size_t packed_memh_len;
ucp_rkey_h rkey;
void *packed_memh;
size_t packed_memh_len;
ucp_rkey_h rkey;
} ucc_tl_ucp_memh_data_t;

typedef struct ucc_tl_ucp_worker {
Expand Down
Loading

0 comments on commit 4a2f9c6

Please sign in to comment.