Skip to content

Commit 5fceca2

Browse files
committed
coll/spacc: silence more coverity warnings in mca_coll_spacc_allreduce_intra_redscat_allgather()
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 2f0f476 commit 5fceca2

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

ompi/mca/coll/spacc/coll_spacc_allreduce.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -281,22 +281,20 @@ int mca_coll_spacc_allreduce_intra_redscat_allgather(
281281
wsize = rcount[step];
282282
step++;
283283
}
284-
}
285-
/*
286-
* Assertion: each process has 1 / p' of the total reduction result:
287-
* rcount[nsteps - 1] elements in the rbuf[rindex[nsteps - 1], ...].
288-
*/
289-
290-
/*
291-
* Step 3. Allgather by the recursive doubling algorithm.
292-
* Each process has 1 / p' of the total reduction result:
293-
* rcount[nsteps - 1] elements in the rbuf[rindex[nsteps - 1], ...].
294-
* All exchanges are executed in reverse order relative
295-
* to recursive doubling (previous step).
296-
*/
297-
298-
if (vrank != -1) {
299-
step = nsteps - 1; /* step = ilog2(p') - 1 */
284+
/*
285+
* Assertion: each process has 1 / p' of the total reduction result:
286+
* rcount[nsteps - 1] elements in the rbuf[rindex[nsteps - 1], ...].
287+
*/
288+
289+
/*
290+
* Step 3. Allgather by the recursive doubling algorithm.
291+
* Each process has 1 / p' of the total reduction result:
292+
* rcount[nsteps - 1] elements in the rbuf[rindex[nsteps - 1], ...].
293+
* All exchanges are executed in reverse order relative
294+
* to recursive doubling (previous step).
295+
*/
296+
297+
step--;
300298

301299
for (int mask = nprocs_pof2 >> 1; mask > 0; mask >>= 1) {
302300
int vdest = vrank ^ mask;

0 commit comments

Comments
 (0)