Skip to content

Commit

Permalink
TL/SHARP: fix service team oob
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei-Lebedev committed Jul 16, 2024
1 parent 8d34c1c commit d7394b0
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/components/tl/sharp/tl_sharp_team.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* See file LICENSE for terms.
*/
Expand All @@ -8,6 +8,7 @@
#include "components/mc/ucc_mc.h"
#include "core/ucc_ee.h"
#include "coll_score/ucc_coll_score.h"
#include "core/ucc_team.h"
#include <sharp/api/version.h>

UCC_CLASS_INIT_FUNC(ucc_tl_sharp_team_t, ucc_base_context_t *tl_context,
Expand Down Expand Up @@ -36,14 +37,23 @@ UCC_CLASS_INIT_FUNC(ucc_tl_sharp_team_t, ucc_base_context_t *tl_context,
set.map = UCC_TL_TEAM_MAP(self);

if (UCC_TL_SHARP_TEAM_LIB(self)->cfg.use_internal_oob) {
self->oob_ctx.subset = set;
status = ucc_ep_map_create_nested(&UCC_TL_CORE_TEAM(self)->ctx_map,
&UCC_TL_TEAM_MAP(self),
&self->oob_ctx.subset.map);
if (status != UCC_OK) {
return status;
}
self->oob_ctx.subset.myrank = UCC_TL_TEAM_RANK(self);
} else {
self->oob_ctx.oob = &UCC_TL_TEAM_OOB(self);
}

status = ucc_topo_init(set, ctx->super.super.ucc_context->topo, &self->topo);
if (UCC_OK != status) {
tl_error(ctx->super.super.lib, "failed to init team topo");
if (UCC_TL_SHARP_TEAM_LIB(self)->cfg.use_internal_oob) {
ucc_ep_map_destroy_nested(&self->oob_ctx.subset.map);
}
return status;
}

Expand Down Expand Up @@ -156,6 +166,9 @@ UCC_CLASS_INIT_FUNC(ucc_tl_sharp_team_t, ucc_base_context_t *tl_context,
}
}
ucc_topo_cleanup(self->topo);
if (UCC_TL_SHARP_TEAM_LIB(self)->cfg.use_internal_oob) {
ucc_ep_map_destroy_nested(&self->oob_ctx.subset.map);
}
return status;
}

Expand All @@ -180,6 +193,9 @@ UCC_CLASS_CLEANUP_FUNC(ucc_tl_sharp_team_t)
}
}
}
if (UCC_TL_SHARP_TEAM_LIB(self)->cfg.use_internal_oob) {
ucc_ep_map_destroy_nested(&self->oob_ctx.subset.map);
}
}

UCC_CLASS_DEFINE_DELETE_FUNC(ucc_tl_sharp_team_t, ucc_base_team_t);
Expand Down

0 comments on commit d7394b0

Please sign in to comment.