Skip to content

Commit

Permalink
Format sliding window changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Sarkauskas committed Jan 22, 2024
1 parent fb40bb8 commit 66faa8b
Show file tree
Hide file tree
Showing 7 changed files with 541 additions and 573 deletions.
344 changes: 160 additions & 184 deletions src/components/tl/ucp/allreduce/allreduce_sliding_window.c

Large diffs are not rendered by default.

232 changes: 109 additions & 123 deletions src/components/tl/ucp/allreduce/allreduce_sliding_window_setup.c

Large diffs are not rendered by default.

79 changes: 31 additions & 48 deletions src/components/tl/ucp/tl_ucp_coll.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,57 +26,40 @@

const ucc_tl_ucp_default_alg_desc_t
ucc_tl_ucp_default_alg_descs[UCC_TL_UCP_N_DEFAULT_ALG_SELECT_STR] = {
{
.select_str = NULL,
.str_get_fn = ucc_tl_ucp_allgather_score_str_get
},
{
.select_str = NULL,
.str_get_fn = ucc_tl_ucp_alltoall_score_str_get
},
{
.select_str = UCC_TL_UCP_ALLREDUCE_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL
},
{
.select_str = UCC_TL_UCP_BCAST_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL
},
{
.select_str = UCC_TL_UCP_REDUCE_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL
},
{
.select_str = UCC_TL_UCP_REDUCE_SCATTER_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL
},
{
.select_str = UCC_TL_UCP_REDUCE_SCATTERV_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL
},
{
.select_str = UCC_TL_UCP_ALLTOALLV_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL
}
};
{.select_str = NULL, .str_get_fn = ucc_tl_ucp_allgather_score_str_get},
{.select_str = NULL, .str_get_fn = ucc_tl_ucp_alltoall_score_str_get},
{.select_str = UCC_TL_UCP_ALLREDUCE_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL},
{.select_str = UCC_TL_UCP_BCAST_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL},
{.select_str = UCC_TL_UCP_REDUCE_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL},
{.select_str = UCC_TL_UCP_REDUCE_SCATTER_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL},
{.select_str = UCC_TL_UCP_REDUCE_SCATTERV_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL},
{.select_str = UCC_TL_UCP_ALLTOALLV_DEFAULT_ALG_SELECT_STR,
.str_get_fn = NULL}};

ucc_status_t ucc_tl_ucp_team_default_score_str_alloc(ucc_tl_ucp_team_t *team,
char *default_select_str[UCC_TL_UCP_N_DEFAULT_ALG_SELECT_STR])
ucc_status_t ucc_tl_ucp_team_default_score_str_alloc(
ucc_tl_ucp_team_t *team,
char * default_select_str[UCC_TL_UCP_N_DEFAULT_ALG_SELECT_STR])
{
ucc_status_t st = UCC_OK;
int i;
int i;

for (i = 0; i < UCC_TL_UCP_N_DEFAULT_ALG_SELECT_STR; i++) {
if (ucc_tl_ucp_default_alg_descs[i].select_str) {
default_select_str[i] = strdup(ucc_tl_ucp_default_alg_descs[i].select_str);
default_select_str[i] =
strdup(ucc_tl_ucp_default_alg_descs[i].select_str);
} else {
default_select_str[i] = ucc_tl_ucp_default_alg_descs[i].str_get_fn(team);
default_select_str[i] =
ucc_tl_ucp_default_alg_descs[i].str_get_fn(team);
}
if (!default_select_str[i]) {
st = UCC_ERR_NO_MEMORY;
goto exit;
}

}

exit:
Expand Down Expand Up @@ -134,7 +117,7 @@ void ucc_tl_ucp_get_completion_cb(void *request, ucs_status_t status,

void ucc_tl_ucp_recv_completion_cb(void *request, ucs_status_t status,
const ucp_tag_recv_info_t *info, /* NOLINT */
void *user_data)
void * user_data)
{
ucc_tl_ucp_task_t *task = (ucc_tl_ucp_task_t *)user_data;
if (ucc_unlikely(UCS_OK != status)) {
Expand All @@ -156,11 +139,11 @@ ucc_status_t ucc_tl_ucp_coll_finalize(ucc_coll_task_t *coll_task)
}

ucc_status_t ucc_tl_ucp_coll_init(ucc_base_coll_args_t *coll_args,
ucc_base_team_t *team,
ucc_coll_task_t **task_h)
ucc_base_team_t * team,
ucc_coll_task_t ** task_h)
{
ucc_tl_ucp_task_t *task = ucc_tl_ucp_init_task(coll_args, team);
ucc_status_t status;
ucc_tl_ucp_task_t *task = ucc_tl_ucp_init_task(coll_args, team);
ucc_status_t status;

switch (coll_args->args.coll_type) {
case UCC_COLL_TYPE_BARRIER:
Expand Down Expand Up @@ -298,8 +281,8 @@ ucc_status_t ucc_tl_ucp_alg_id_to_init(int alg_id, const char *alg_id_str,
*init = ucc_tl_ucp_bcast_dbt_init;
break;
default:
status = UCC_ERR_INVALID_PARAM;
break;
status = UCC_ERR_INVALID_PARAM;
break;
};
break;
case UCC_COLL_TYPE_ALLTOALL:
Expand Down Expand Up @@ -343,8 +326,8 @@ ucc_status_t ucc_tl_ucp_alg_id_to_init(int alg_id, const char *alg_id_str,
*init = ucc_tl_ucp_reduce_dbt_init;
break;
default:
status = UCC_ERR_INVALID_PARAM;
break;
status = UCC_ERR_INVALID_PARAM;
break;
};
break;
case UCC_COLL_TYPE_REDUCE_SCATTER:
Expand Down
Loading

0 comments on commit 66faa8b

Please sign in to comment.