File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 17
17
* and Technology (RIST). All rights reserved.
18
18
* Copyright (c) 2018 Siberian State University of Telecommunications
19
19
* and Information Science. All rights reserved.
20
+ * Copyright (c) 2022 Cisco Systems, Inc. All rights reserved.
20
21
* $COPYRIGHT$
21
22
*
22
23
* Additional copyrights may follow
@@ -982,7 +983,9 @@ int ompi_coll_base_allreduce_intra_redscat_allgather(
982
983
983
984
/* Find nearest power-of-two less than or equal to comm_size */
984
985
int nsteps = opal_hibit (comm_size , comm -> c_cube_dim + 1 ); /* ilog2(comm_size) */
985
- assert (nsteps >= 0 );
986
+ if (-1 == nsteps ) {
987
+ return MPI_ERR_ARG ;
988
+ }
986
989
int nprocs_pof2 = 1 << nsteps ; /* flp2(comm_size) */
987
990
988
991
if (count < nprocs_pof2 || !ompi_op_is_commute (op )) {
Original file line number Diff line number Diff line change 17
17
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
18
18
* Copyright (c) 2018 Siberian State University of Telecommunications
19
19
* and Information Science. All rights reserved.
20
+ * Copyright (c) 2022 Cisco Systems, Inc. All rights reserved.
20
21
* $COPYRIGHT$
21
22
*
22
23
* Additional copyrights may follow
@@ -812,7 +813,9 @@ int ompi_coll_base_reduce_intra_redscat_gather(
812
813
813
814
/* Find nearest power-of-two less than or equal to comm_size */
814
815
int nsteps = opal_hibit (comm_size , comm -> c_cube_dim + 1 ); /* ilog2(comm_size) */
815
- assert (nsteps >= 0 );
816
+ if (-1 == nsteps ) {
817
+ return MPI_ERR_ARG ;
818
+ }
816
819
int nprocs_pof2 = 1 << nsteps ; /* flp2(comm_size) */
817
820
818
821
if (nprocs_pof2 < 2 || count < nprocs_pof2 || !ompi_op_is_commute (op )) {
You can’t perform that action at this time.
0 commit comments