Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrol aderholdt committed Feb 8, 2024
1 parent d9d6213 commit 058d9a1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
14 changes: 0 additions & 14 deletions src/components/tl/ucp/tl_ucp.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,28 +247,19 @@ static inline uint64_t UCC_TL_UCP_REMOTE_DYN_LEN(ucc_tl_ucp_context_t *ctx,
ucc_rank_t rank,
uint64_t seg)
{
#if 1
int seg_group_id = ctx->dyn_seg.seg_groups[seg];
uint64_t *plen = PTR_OFFSET(ctx->dyn_seg.dyn_buff, sizeof(uint64_t) * ctx->dyn_seg.num_seg_per_group[ctx->dyn_seg.seg_groups[seg]] + ctx->dyn_seg.seg_group_start[seg] + ctx->dyn_seg.seg_group_size[seg_group_id] * rank + (seg - ctx->dyn_seg.starting_seg[seg]) * sizeof(uint64_t));
return *plen;//[seg - ctx->dyn_seg.starting_seg[seg]];
#else
return 0;
#endif
}

// FIXME convert to macro
static inline uint64_t UCC_TL_UCP_REMOTE_DYN_KEY_SIZE(ucc_tl_ucp_context_t *ctx,
ucc_rank_t rank,
uint64_t seg)
{
#if 1
int seg_group_id = ctx->dyn_seg.seg_groups[seg];
uint64_t *pkey_size = PTR_OFFSET(ctx->dyn_seg.dyn_buff, 2 * sizeof(uint64_t) * ctx->dyn_seg.num_seg_per_group[ctx->dyn_seg.seg_groups[seg]] + ctx->dyn_seg.seg_group_start[seg] + ctx->dyn_seg.seg_group_size[seg_group_id] * rank + (seg - ctx->dyn_seg.starting_seg[seg]) * sizeof(uint64_t));
//printf("pkey_size: %lu\n", *pkey_size);
return *pkey_size;//[seg - ctx->dyn_seg.starting_seg[seg]];
#else
return 0;
#endif
}

// FIXME convert to macro
Expand All @@ -277,13 +268,8 @@ static inline void * UCC_TL_UCP_REMOTE_DYN_KEY(ucc_tl_ucp_context_t *ctx,
size_t offset,
uint64_t seg)
{
#if 1
int seg_group_id = ctx->dyn_seg.seg_groups[seg];
void *pkey = PTR_OFFSET(ctx->dyn_seg.dyn_buff, 3 * sizeof(uint64_t) * ctx->dyn_seg.num_seg_per_group[ctx->dyn_seg.seg_groups[seg]] + ctx->dyn_seg.seg_group_start[seg] + ctx->dyn_seg.seg_group_size[seg_group_id] * rank + offset);
// printf("pkey %p for peer %d, calced offset: %lu, group_size %lu\n", pkey, rank, (3 * sizeof(uint64_t) * ctx->dyn_seg.num_seg_per_group[ctx->dyn_seg.seg_groups[seg]] + ctx->dyn_seg.seg_group_start[seg] + ctx->dyn_seg.seg_group_size[seg_group_id] * rank + offset), ctx->dyn_seg.seg_group_size[seg_group_id]);
return pkey;
#else
return 0;
#endif
}
#endif
5 changes: 0 additions & 5 deletions src/components/tl/ucp/tl_ucp_sendrecv.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ ucc_tl_ucp_resolve_p2p_by_va(ucc_tl_ucp_team_t *team, void *va, size_t msglen, u
void *offset;
ptrdiff_t base_offset;
int i;
//ucc_rank_t rank = UCC_TL_TEAM_RANK(team);

*segment = -1;
core_rank = ucc_ep_map_eval(UCC_TL_TEAM_MAP(team), peer);
Expand Down Expand Up @@ -285,7 +284,6 @@ ucc_tl_ucp_resolve_p2p_by_va(ucc_tl_ucp_team_t *team, void *va, size_t msglen, u
size_t num_keys = 0;
void *packed_key = NULL;
size_t team_size = UCC_TL_TEAM_SIZE(team);
// printf("[%d] base: %lx end: %lx : check_base: %lx check_end: %lx\n", i, base, end, check_base, check_end);
if (check_base >= base &&
check_base < end &&
check_end <= end) {
Expand All @@ -295,12 +293,10 @@ ucc_tl_ucp_resolve_p2p_by_va(ucc_tl_ucp_team_t *team, void *va, size_t msglen, u
for (int j = 0; j < num_keys; j++) {
key_offset += UCC_TL_UCP_REMOTE_DYN_KEY_SIZE(ctx, peer, ctx->dyn_seg.starting_seg[*segment] + j);
}
// printf("[%d] offset: %lu, *segment + n_segs: %lu\n", rank, key_offset, *segment + ctx->n_rinfo_segs);
packed_key = UCC_TL_UCP_REMOTE_DYN_KEY(ctx, peer, key_offset, *segment);
/* dynamic segment keys should be placed AFTER
* the ctx's keys (i.e., num_static_segs + segment_number) */
if (ucc_unlikely(NULL == UCC_TL_UCP_DYN_REMOTE_RKEY(ctx, peer, team_size, *segment))) {
// printf("[%d] unpacking %p for peer %d\n", rank, packed_key, peer);
ucs_status_t ucs_status =
ucp_ep_rkey_unpack(*ep, packed_key,
&UCC_TL_UCP_DYN_REMOTE_RKEY(ctx, peer, team_size, *segment));
Expand All @@ -309,7 +305,6 @@ ucc_tl_ucp_resolve_p2p_by_va(ucc_tl_ucp_team_t *team, void *va, size_t msglen, u
}
}
*rkey = UCC_TL_UCP_DYN_REMOTE_RKEY(ctx, peer, team_size, *segment);
// printf("[%d] rkey: %p peer %d ep: %p\n", rank, *rkey, peer, *ep);
*packed_memh = ctx->dynamic_remote_info[i].packed_memh;
return UCC_OK;
}
Expand Down

0 comments on commit 058d9a1

Please sign in to comment.