Skip to content

Commit 7a1a4e6

Browse files
committed
Dont redirect to another allreduce algorithm.
The decision to switch to a different algorithm based on count does not belong to the base algorithms, it should be done in the upper level decision functions. Signed-off-by: George Bosilca <gbosilca@nvidia.com>
1 parent 42c744e commit 7a1a4e6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ompi/mca/coll/base/coll_base_allreduce.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* Copyright (c) 2022 Cisco Systems, Inc. All rights reserved.
2121
* Copyright (c) Amazon.com, Inc. or its affiliates.
2222
* All rights reserved.
23+
* Copyright (c) 2024 NVIDIA Corporation. All rights reserved.
2324
* $COPYRIGHT$
2425
*
2526
* Additional copyrights may follow
@@ -983,14 +984,7 @@ int ompi_coll_base_allreduce_intra_redscat_allgather(
983984
"coll:base:allreduce_intra_redscat_allgather: rank %d/%d",
984985
rank, comm_size));
985986

986-
/* Find nearest power-of-two less than or equal to comm_size */
987-
int nsteps = opal_hibit(comm_size, comm->c_cube_dim + 1); /* ilog2(comm_size) */
988-
if (-1 == nsteps) {
989-
return MPI_ERR_ARG;
990-
}
991-
int nprocs_pof2 = 1 << nsteps; /* flp2(comm_size) */
992-
993-
if (count < (size_t) nprocs_pof2 || !ompi_op_is_commute(op)) {
987+
if (!ompi_op_is_commute(op)) {
994988
OPAL_OUTPUT((ompi_coll_base_framework.framework_output,
995989
"coll:base:allreduce_intra_redscat_allgather: rank %d/%d "
996990
"count %zu switching to basic linear allreduce",
@@ -999,6 +993,12 @@ int ompi_coll_base_allreduce_intra_redscat_allgather(
999993
op, comm, module);
1000994
}
1001995

996+
/* Find nearest power-of-two less than or equal to comm_size */
997+
int nsteps = opal_hibit(comm_size, comm->c_cube_dim + 1); /* ilog2(comm_size) */
998+
if (-1 == nsteps) {
999+
return MPI_ERR_ARG;
1000+
}
1001+
int nprocs_pof2 = 1 << nsteps; /* flp2(comm_size) */
10021002
int err = MPI_SUCCESS;
10031003
ptrdiff_t lb, extent, dsize, gap = 0;
10041004
ompi_datatype_get_extent(dtype, &lb, &extent);

0 commit comments

Comments
 (0)