Skip to content

Commit

Permalink
REVIEW: code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shimmybalsam committed Sep 26, 2023
1 parent 25c86d3 commit 49be548
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 139 deletions.
114 changes: 57 additions & 57 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -36,63 +36,63 @@ nobase_dist_libucc_la_HEADERS = \
ucc/api/ucc_version.h \
ucc/api/ucc_status.h

noinst_HEADERS = \
core/ucc_global_opts.h \
core/ucc_lib.h \
core/ucc_context.h \
core/ucc_team.h \
core/ucc_ee.h \
core/ucc_progress_queue.h \
core/ucc_service_coll.h \
core/ucc_dt.h \
schedule/ucc_schedule.h \
schedule/ucc_schedule_pipelined.h \
coll_score/ucc_coll_score.h \
utils/arch/aarch64/cpu.h \
utils/arch/ppc64/cpu.h \
utils/arch/riscv64/cpu.h \
utils/arch/x86_64/cpu.h \
utils/arch/cpu.h \
utils/arch/cuda_def.h \
utils/ucc_compiler_def.h \
utils/ucc_log.h \
utils/ucc_parser.h \
utils/ucc_component.h \
utils/ucc_datastruct.h \
utils/ucc_math.h \
utils/ucc_coll_utils.h \
utils/ucc_list.h \
utils/ucc_string.h \
utils/ucc_queue.h \
utils/ucc_proc_info.h \
utils/khash.h \
utils/ini.h \
utils/ucc_spinlock.h \
utils/ucc_mpool.h \
utils/ucc_rcache.h \
utils/profile/ucc_profile.h \
utils/profile/ucc_profile_on.h \
utils/profile/ucc_profile_off.h \
utils/ucc_time.h \
utils/ucc_sys.h \
utils/ucc_assert.h \
components/base/ucc_base_iface.h \
components/cl/ucc_cl.h \
components/cl/ucc_cl_log.h \
components/cl/ucc_cl_type.h \
components/tl/ucc_tl.h \
components/tl/ucc_tl_log.h \
components/mc/ucc_mc.h \
components/mc/base/ucc_mc_base.h \
components/mc/ucc_mc_log.h \
components/ec/ucc_ec.h \
components/ec/base/ucc_ec_base.h \
components/ec/ucc_ec_log.h \
coll_patterns/recursive_knomial.h \
coll_patterns/sra_knomial.h \
coll_patterns/bruck_alltoall.h \
coll_patterns/two_tree.h \
components/topo/ucc_topo.h \
noinst_HEADERS = \
core/ucc_global_opts.h \
core/ucc_lib.h \
core/ucc_context.h \
core/ucc_team.h \
core/ucc_ee.h \
core/ucc_progress_queue.h \
core/ucc_service_coll.h \
core/ucc_dt.h \
schedule/ucc_schedule.h \
schedule/ucc_schedule_pipelined.h \
coll_score/ucc_coll_score.h \
utils/arch/aarch64/cpu.h \
utils/arch/ppc64/cpu.h \
utils/arch/riscv64/cpu.h \
utils/arch/x86_64/cpu.h \
utils/arch/cpu.h \
utils/arch/cuda_def.h \
utils/ucc_compiler_def.h \
utils/ucc_log.h \
utils/ucc_parser.h \
utils/ucc_component.h \
utils/ucc_datastruct.h \
utils/ucc_math.h \
utils/ucc_coll_utils.h \
utils/ucc_list.h \
utils/ucc_string.h \
utils/ucc_queue.h \
utils/ucc_proc_info.h \
utils/khash.h \
utils/ini.h \
utils/ucc_spinlock.h \
utils/ucc_mpool.h \
utils/ucc_rcache.h \
utils/profile/ucc_profile.h \
utils/profile/ucc_profile_on.h \
utils/profile/ucc_profile_off.h \
utils/ucc_time.h \
utils/ucc_sys.h \
utils/ucc_assert.h \
components/base/ucc_base_iface.h \
components/cl/ucc_cl.h \
components/cl/ucc_cl_log.h \
components/cl/ucc_cl_type.h \
components/tl/ucc_tl.h \
components/tl/ucc_tl_log.h \
components/mc/ucc_mc.h \
components/mc/base/ucc_mc_base.h \
components/mc/ucc_mc_log.h \
components/ec/ucc_ec.h \
components/ec/base/ucc_ec_base.h \
components/ec/ucc_ec_log.h \
coll_patterns/recursive_knomial.h \
coll_patterns/sra_knomial.h \
coll_patterns/bruck_alltoall.h \
coll_patterns/double_binary_tree.h \
components/topo/ucc_topo.h \
components/topo/ucc_sbgp.h

libucc_la_SOURCES = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* See file LICENSE for terms.
*/

#ifndef TWO_TREE_H_
#define TWO_TREE_H_
#ifndef DOUBLE_BINARY_TREE_H_
#define DOUBLE_BINARY_TREE_H_

enum {
LEFT_CHILD,
Expand Down Expand Up @@ -103,8 +103,8 @@ static inline int get_parent(int vsize, int vrank, int height, int troot)
}
}

static inline void ucc_two_tree_build_t2_mirror(ucc_dbt_single_tree_t t1,
ucc_dbt_single_tree_t *t2)
static inline void ucc_dbt_build_t2_mirror(ucc_dbt_single_tree_t t1,
ucc_dbt_single_tree_t *t2)
{
ucc_rank_t size = t1.size;
ucc_dbt_single_tree_t t;
Expand All @@ -123,8 +123,8 @@ static inline void ucc_two_tree_build_t2_mirror(ucc_dbt_single_tree_t t1,
*t2 = t;
}

static inline void ucc_two_tree_build_t2_shift(ucc_dbt_single_tree_t t1,
ucc_dbt_single_tree_t *t2)
static inline void ucc_dbt_build_t2_shift(ucc_dbt_single_tree_t t1,
ucc_dbt_single_tree_t *t2)
{
ucc_rank_t size = t1.size;
ucc_dbt_single_tree_t t;
Expand All @@ -143,12 +143,12 @@ static inline void ucc_two_tree_build_t2_shift(ucc_dbt_single_tree_t t1,
*t2 = t;
}

static inline void ucc_two_tree_build_t1(ucc_rank_t rank, ucc_rank_t size,
ucc_dbt_single_tree_t *t1)
static inline void ucc_dbt_build_t1(ucc_rank_t rank, ucc_rank_t size,
ucc_dbt_single_tree_t *t1)
{
int height = get_height(rank);
ucc_rank_t root = get_root(size);
ucc_rank_t parent = get_parent(size, rank, height, root);
int height = get_height(rank);
ucc_rank_t root = get_root(size);
ucc_rank_t parent = get_parent(size, rank, height, root);

get_children(size, rank, height, root, &t1->children[LEFT_CHILD],
&t1->children[RIGHT_CHILD]);
Expand All @@ -160,8 +160,8 @@ static inline void ucc_two_tree_build_t1(ucc_rank_t rank, ucc_rank_t size,
t1->recv = 0;
}

static inline ucc_rank_t ucc_two_tree_convert_rank_for_shift(ucc_rank_t rank,
ucc_rank_t size)
static inline ucc_rank_t ucc_dbt_convert_rank_for_shift(ucc_rank_t rank,
ucc_rank_t size)
{
ucc_rank_t i;
for (i = 0; i < size; i++) {
Expand All @@ -172,8 +172,8 @@ static inline ucc_rank_t ucc_two_tree_convert_rank_for_shift(ucc_rank_t rank,
return i;
}

static inline ucc_rank_t ucc_two_tree_convert_rank_for_mirror(ucc_rank_t rank,
ucc_rank_t size)
static inline ucc_rank_t ucc_dbt_convert_rank_for_mirror(ucc_rank_t rank,
ucc_rank_t size)
{
ucc_rank_t i;
for (i = 0; i < size; i++) {
Expand All @@ -184,27 +184,27 @@ static inline ucc_rank_t ucc_two_tree_convert_rank_for_mirror(ucc_rank_t rank,
return i;
}

static inline void ucc_two_tree_build_t2(ucc_rank_t rank, ucc_rank_t size,
ucc_dbt_single_tree_t *t2) {
static inline void ucc_dbt_build_t2(ucc_rank_t rank, ucc_rank_t size,
ucc_dbt_single_tree_t *t2) {
ucc_rank_t temp_rank = (size % 2) ?
ucc_two_tree_convert_rank_for_shift(rank, size) :
ucc_two_tree_convert_rank_for_mirror(rank, size);
ucc_dbt_convert_rank_for_shift(rank, size) :
ucc_dbt_convert_rank_for_mirror(rank, size);
ucc_dbt_single_tree_t t1_temp;

ucc_two_tree_build_t1(temp_rank, size, &t1_temp);
ucc_dbt_build_t1(temp_rank, size, &t1_temp);
if (size % 2) {
ucc_two_tree_build_t2_shift(t1_temp, t2);
ucc_dbt_build_t2_shift(t1_temp, t2);
} else {
ucc_two_tree_build_t2_mirror(t1_temp, t2);
ucc_dbt_build_t2_mirror(t1_temp, t2);
}
}

static inline void ucc_two_tree_build_trees(ucc_rank_t rank, ucc_rank_t size,
ucc_dbt_single_tree_t *t1,
ucc_dbt_single_tree_t *t2)
static inline void ucc_dbt_build_trees(ucc_rank_t rank, ucc_rank_t size,
ucc_dbt_single_tree_t *t1,
ucc_dbt_single_tree_t *t2)
{
ucc_two_tree_build_t1(rank, size, t1);
ucc_two_tree_build_t2(rank, size, t2);
ucc_dbt_build_t1(rank, size, t1);
ucc_dbt_build_t2(rank, size, t2);
}

#endif
2 changes: 1 addition & 1 deletion src/components/tl/ucp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bcast = \
bcast/bcast.c \
bcast/bcast_knomial.c \
bcast/bcast_sag_knomial.c \
bcast/bcast_two_tree.c
bcast/bcast_dbt.c

fanin = \
fanin/fanin.h \
Expand Down
6 changes: 3 additions & 3 deletions src/components/tl/ucp/bcast/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ ucc_base_coll_alg_info_t
.name = "sag_knomial",
.desc = "recursive knomial scatter followed by knomial "
"allgather (optimized for BW)"},
[UCC_TL_UCP_BCAST_ALG_TWO_TREE] =
{.id = UCC_TL_UCP_BCAST_ALG_TWO_TREE,
.name = "two_tree",
[UCC_TL_UCP_BCAST_ALG_DBT] =
{.id = UCC_TL_UCP_BCAST_ALG_DBT,
.name = "dbt",
.desc = "bcast over double binary tree where a leaf in one tree "
"will be intermediate in other (optimized for latency)"},
[UCC_TL_UCP_BCAST_ALG_LAST] = {
Expand Down
4 changes: 2 additions & 2 deletions src/components/tl/ucp/bcast/bcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
enum {
UCC_TL_UCP_BCAST_ALG_KNOMIAL,
UCC_TL_UCP_BCAST_ALG_SAG_KNOMIAL,
UCC_TL_UCP_BCAST_ALG_TWO_TREE,
UCC_TL_UCP_BCAST_ALG_DBT,
UCC_TL_UCP_BCAST_ALG_LAST
};

Expand Down Expand Up @@ -48,7 +48,7 @@ ucc_status_t
ucc_tl_ucp_bcast_sag_knomial_init(ucc_base_coll_args_t *coll_args,
ucc_base_team_t *team, ucc_coll_task_t **task_h);

ucc_status_t ucc_tl_ucp_bcast_two_tree_init(
ucc_status_t ucc_tl_ucp_bcast_dbt_init(
ucc_base_coll_args_t *coll_args, ucc_base_team_t *team,
ucc_coll_task_t **task_h);

Expand Down
Loading

0 comments on commit 49be548

Please sign in to comment.