From d7394b0afa8d8d64e7184e8912426b8aeb295812 Mon Sep 17 00:00:00 2001 From: Sergey Lebedev Date: Tue, 16 Jul 2024 10:51:53 +0000 Subject: [PATCH] TL/SHARP: fix service team oob --- src/components/tl/sharp/tl_sharp_team.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/tl/sharp/tl_sharp_team.c b/src/components/tl/sharp/tl_sharp_team.c index a8bd380936..e2a67ff439 100644 --- a/src/components/tl/sharp/tl_sharp_team.c +++ b/src/components/tl/sharp/tl_sharp_team.c @@ -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. */ @@ -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 UCC_CLASS_INIT_FUNC(ucc_tl_sharp_team_t, ucc_base_context_t *tl_context, @@ -36,7 +37,13 @@ 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); } @@ -44,6 +51,9 @@ UCC_CLASS_INIT_FUNC(ucc_tl_sharp_team_t, ucc_base_context_t *tl_context, 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; } @@ -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; } @@ -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);