Skip to content

Commit 96f8805

Browse files
authored
Merge pull request #5948 from mkurnosov/coll-ireduce-silence-coverity
coll/libnbc/ireduce: silence Coverity warning CID 1440360
2 parents 593db29 + 8b511c7 commit 96f8805

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
@@ -656,6 +656,10 @@ static inline int red_sched_redscat_gather(
656656

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

661665
ptrdiff_t lb, extent;

0 commit comments

Comments
 (0)