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(
276
276
rcount [step ], dtype );
277
277
278
278
/* 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
+ }
283
285
}
284
286
/*
285
287
* 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(
291
291
rcount [step ], dtype );
292
292
293
293
/* 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
+ }
298
300
}
299
301
}
300
302
/*
You can’t perform that action at this time.
0 commit comments