Skip to content

Commit

Permalink
CL/HIER: team cleanup fix (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin petrov committed May 4, 2022
1 parent 246d4f4 commit e96a6de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
19 changes: 11 additions & 8 deletions src/components/cl/hier/cl_hier_team.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ UCC_CLASS_INIT_FUNC(ucc_cl_hier_team_t, ucc_base_context_t *cl_context,

UCC_CLASS_CALL_SUPER_INIT(ucc_cl_team_t, &ctx->super, params);

memset(self->sbgps, 0, sizeof(self->sbgps));
ucc_cl_hier_enable_sbgps(self);
n_sbgp_teams = 0;
for (i = 0; i < UCC_HIER_SBGP_LAST; i++) {
hs = &self->sbgps[i];
hs->score = NULL;
hs->sbgp = NULL;
hs = &self->sbgps[i];
if (hs->state == UCC_HIER_SBGP_ENABLED) {
hs->sbgp = ucc_topo_get_sbgp(params->team->topo, hs->sbgp_type);
if (hs->sbgp->status != UCC_SBGP_ENABLED) {
Expand Down Expand Up @@ -176,12 +175,16 @@ ucc_status_t ucc_cl_hier_team_destroy(ucc_base_team_t *cl_team)
for (i = 0; i < UCC_HIER_SBGP_LAST; i++) {
hs = &team->sbgps[i];
if (hs->state == UCC_HIER_SBGP_ENABLED) {
ucc_coll_score_free_map(hs->score_map);
if (hs->score_map) {
ucc_coll_score_free_map(hs->score_map);
}
for (j = 0; j < hs->n_tls; j++) {
ucc_tl_context_put(hs->tl_ctxs[j]);
team->team_create_req
->descs[team->team_create_req->n_teams++]
.team = hs->tl_teams[j];
if (hs->tl_teams[j]) {
ucc_tl_context_put(hs->tl_ctxs[j]);
team->team_create_req
->descs[team->team_create_req->n_teams++]
.team = hs->tl_teams[j];
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/ucc_team.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ ucc_team_create_cls(ucc_context_t *context, ucc_team_t *team)
if (status < 0) {
team->n_cl_teams--;
ucc_info("failed to create CL %s team", cl_iface->super.name);
cl_iface->team.destroy(b_team);
} else if (status == UCC_INPROGRESS) {
return status;
}
Expand All @@ -270,13 +271,12 @@ ucc_team_create_cls(ucc_context_t *context, ucc_team_t *team)
&team->bp, &b_team);
if (status != UCC_OK) {
ucc_info("failed to create CL %s team", cl_iface->super.name);
/* TODO: see comment above*/
continue;
}
status = cl_iface->team.create_test(b_team);
if (status < 0) {
ucc_info("failed to create CL %s team", cl_iface->super.name);
/* TODO: see comment above */
cl_iface->team.destroy(b_team);
continue;
}
team->cl_teams[team->n_cl_teams++] =
Expand Down

0 comments on commit e96a6de

Please sign in to comment.