From ec154576f1c9e8971d8f2385f850497774335199 Mon Sep 17 00:00:00 2001 From: Sergey Lebedev Date: Thu, 7 Mar 2024 07:48:28 +0000 Subject: [PATCH] REVIEW: fix review comments --- src/components/tl/ucp/tl_ucp_team.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/tl/ucp/tl_ucp_team.c b/src/components/tl/ucp/tl_ucp_team.c index 8600eda5d9..6cf1eb7776 100644 --- a/src/components/tl/ucp/tl_ucp_team.c +++ b/src/components/tl/ucp/tl_ucp_team.c @@ -47,6 +47,7 @@ UCC_CLASS_INIT_FUNC(ucc_tl_ucp_team_t, ucc_base_context_t *tl_context, ucc_tl_ucp_context_t *ctx = ucc_derived_of(tl_context, ucc_tl_ucp_context_t); ucc_kn_radix_t max_radix, min_radix; + ucc_rank_t tsize; ucc_status_t status; UCC_CLASS_CALL_SUPER_INIT(ucc_tl_team_t, &ctx->super, params); @@ -91,14 +92,11 @@ UCC_CLASS_INIT_FUNC(ucc_tl_ucp_team_t, ucc_base_context_t *tl_context, } if (self->topo && !IS_SERVICE_TEAM(self) && self->topo->topo->sock_bound) { - max_radix = ucc_min(UCC_TL_TEAM_SIZE(self), - ucc_topo_max_ppn(self->topo) == 1 ? - UCC_TL_TEAM_SIZE(self): - ucc_topo_min_socket_size(self->topo)); - min_radix = ucc_min(UCC_TL_TEAM_SIZE(self), - ucc_topo_max_ppn(self->topo) == 1 ? 3: 2); - self->opt_radix = ucc_kn_get_opt_radix(UCC_TL_TEAM_SIZE(self), - min_radix, max_radix); + tsize = UCC_TL_TEAM_SIZE(self); + max_radix = (ucc_topo_max_ppn(self->topo) == 1) ? tsize : + ucc_min(tsize, ucc_topo_min_socket_size(self->topo)); + min_radix = ucc_min(tsize, ucc_topo_max_ppn(self->topo) == 1 ? 3: 2); + self->opt_radix = ucc_kn_get_opt_radix(tsize, min_radix, max_radix); tl_debug(tl_context->lib, "opt knomial radix: %d", self->opt_radix); }