1
1
Add check for bounds of sindex[] and rindex[].

Signed-off-by: Mikhail Kurnosov <mkurnosov@gmail.com>
Этот коммит содержится в:
Mikhail Kurnosov 2017-06-07 22:40:18 +07:00 коммит произвёл Gilles Gouaillardet
родитель 5fceca235b
Коммит 44acc92104
2 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -276,11 +276,13 @@ int mca_coll_spacc_allreduce_intra_redscat_allgather(
rcount[step], dtype); rcount[step], dtype);
/* Move the current window to the received message */ /* Move the current window to the received message */
if (step + 1 < nsteps) {
rindex[step + 1] = rindex[step]; rindex[step + 1] = rindex[step];
sindex[step + 1] = rindex[step]; sindex[step + 1] = rindex[step];
wsize = rcount[step]; wsize = rcount[step];
step++; step++;
} }
}
/* /*
* Assertion: each process has 1 / p' of the total reduction result: * Assertion: each process has 1 / p' of the total reduction result:
* rcount[nsteps - 1] elements in the rbuf[rindex[nsteps - 1], ...]. * rcount[nsteps - 1] elements in the rbuf[rindex[nsteps - 1], ...].

Просмотреть файл

@ -291,12 +291,14 @@ int mca_coll_spacc_reduce_intra_redscat_gather(
rcount[step], dtype); rcount[step], dtype);
/* Move the current window to the received message */ /* Move the current window to the received message */
if (step + 1 < nsteps) {
rindex[step + 1] = rindex[step]; rindex[step + 1] = rindex[step];
sindex[step + 1] = rindex[step]; sindex[step + 1] = rindex[step];
wsize = rcount[step]; wsize = rcount[step];
step++; step++;
} }
} }
}
/* /*
* Assertion: each process has 1 / p' of the total reduction result: * Assertion: each process has 1 / p' of the total reduction result:
* rcount[nsteps - 1] elements in the rbuf[rindex[nsteps - 1], ...]. * rcount[nsteps - 1] elements in the rbuf[rindex[nsteps - 1], ...].