Skip to content

Commit 8b511c7

Browse files
committed
coll/libnbc/ireduce: silence Coverity warning CID 1440360
Signed-off-by: Mikhail Kurnosov <mkurnosov@gmail.com>
1 parent 6213d23 commit 8b511c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ompi/mca/coll/libnbc/nbc_ireduce.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,10 @@ static inline int red_sched_redscat_gather(
655655

656656
/* Find nearest power-of-two less than or equal to comm_size */
657657
int nsteps = opal_hibit(comm_size, comm->c_cube_dim + 1); /* ilog2(comm_size) */
658+
if (nsteps < 1) {
659+
/* This case never happens (for comm_size < 2 other algorithms are used) */
660+
return OMPI_ERR_NOT_SUPPORTED;
661+
}
658662
int nprocs_pof2 = 1 << nsteps; /* flp2(comm_size) */
659663

660664
ptrdiff_t lb, extent;

0 commit comments

Comments
 (0)