File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -276,10 +276,12 @@ int mca_coll_spacc_allreduce_intra_redscat_allgather(
276276 rcount [step ], dtype );
277277
278278 /* Move the current window to the received message */
279- rindex [step + 1 ] = rindex [step ];
280- sindex [step + 1 ] = rindex [step ];
281- wsize = rcount [step ];
282- step ++ ;
279+ if (step + 1 < nsteps ) {
280+ rindex [step + 1 ] = rindex [step ];
281+ sindex [step + 1 ] = rindex [step ];
282+ wsize = rcount [step ];
283+ step ++ ;
284+ }
283285 }
284286 /*
285287 * Assertion: each process has 1 / p' of the total reduction result:
Original file line number Diff line number Diff line change @@ -291,10 +291,12 @@ int mca_coll_spacc_reduce_intra_redscat_gather(
291291 rcount [step ], dtype );
292292
293293 /* Move the current window to the received message */
294- rindex [step + 1 ] = rindex [step ];
295- sindex [step + 1 ] = rindex [step ];
296- wsize = rcount [step ];
297- step ++ ;
294+ if (step + 1 < nsteps ) {
295+ rindex [step + 1 ] = rindex [step ];
296+ sindex [step + 1 ] = rindex [step ];
297+ wsize = rcount [step ];
298+ step ++ ;
299+ }
298300 }
299301 }
300302 /*
You can’t perform that action at this time.
0 commit comments