Add support for MPI_IN_PLACE for the easy operations.
This commit was SVN r7344.
Этот коммит содержится в:
родитель
ad647b105d
Коммит
da87169d17
@ -48,8 +48,9 @@ mca_coll_basic_allgather_intra(void *sbuf, int scount,
|
|||||||
|
|
||||||
err = comm->c_coll.coll_gather(sbuf, scount, sdtype, rbuf, rcount,
|
err = comm->c_coll.coll_gather(sbuf, scount, sdtype, rbuf, rcount,
|
||||||
rdtype, 0, comm);
|
rdtype, 0, comm);
|
||||||
if (MPI_SUCCESS != err)
|
if (MPI_SUCCESS != err) {
|
||||||
return err;
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
err = comm->c_coll.coll_bcast(rbuf, rcount * size, rdtype, 0, comm);
|
err = comm->c_coll.coll_bcast(rbuf, rcount * size, rdtype, 0, comm);
|
||||||
return err;
|
return err;
|
||||||
|
@ -71,8 +71,10 @@ mca_coll_basic_gather_intra(void *sbuf, int scount,
|
|||||||
/* simple optimization */
|
/* simple optimization */
|
||||||
|
|
||||||
if (i == rank) {
|
if (i == rank) {
|
||||||
|
if (MPI_IN_PLACE != sbuf) {
|
||||||
err = ompi_ddt_sndrcv(sbuf, scount, sdtype, ptmp,
|
err = ompi_ddt_sndrcv(sbuf, scount, sdtype, ptmp,
|
||||||
rcount, rdtype);
|
rcount, rdtype);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
err = MCA_PML_CALL(recv(ptmp, rcount, rdtype, i,
|
err = MCA_PML_CALL(recv(ptmp, rcount, rdtype, i,
|
||||||
MCA_COLL_BASE_TAG_GATHER,
|
MCA_COLL_BASE_TAG_GATHER,
|
||||||
|
@ -76,9 +76,10 @@ mca_coll_basic_gatherv_intra(void *sbuf, int scount,
|
|||||||
|
|
||||||
if (i == rank) {
|
if (i == rank) {
|
||||||
/* simple optimization */
|
/* simple optimization */
|
||||||
if ((0 < scount) && (0 < rcounts[i]))
|
if (MPI_IN_PLACE != sbuf && (0 < scount) && (0 < rcounts[i])) {
|
||||||
err = ompi_ddt_sndrcv(sbuf, scount, sdtype,
|
err = ompi_ddt_sndrcv(sbuf, scount, sdtype,
|
||||||
ptmp, rcounts[i], rdtype);
|
ptmp, rcounts[i], rdtype);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Only receive if there is something to receive */
|
/* Only receive if there is something to receive */
|
||||||
if (rcounts[i] > 0) {
|
if (rcounts[i] > 0) {
|
||||||
|
@ -75,9 +75,11 @@ mca_coll_basic_scatter_intra(void *sbuf, int scount,
|
|||||||
/* simple optimization */
|
/* simple optimization */
|
||||||
|
|
||||||
if (i == rank) {
|
if (i == rank) {
|
||||||
|
if (MPI_IN_PLACE != recvbuf) {
|
||||||
err =
|
err =
|
||||||
ompi_ddt_sndrcv(ptmp, scount, sdtype, rbuf, rcount,
|
ompi_ddt_sndrcv(ptmp, scount, sdtype, rbuf, rcount,
|
||||||
rdtype);
|
rdtype);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
err = MCA_PML_CALL(send(ptmp, scount, sdtype, i,
|
err = MCA_PML_CALL(send(ptmp, scount, sdtype, i,
|
||||||
MCA_COLL_BASE_TAG_SCATTER,
|
MCA_COLL_BASE_TAG_SCATTER,
|
||||||
|
@ -79,11 +79,10 @@ mca_coll_basic_scatterv_intra(void *sbuf, int *scounts,
|
|||||||
|
|
||||||
if (i == rank) {
|
if (i == rank) {
|
||||||
/* simple optimization or a local operation */
|
/* simple optimization or a local operation */
|
||||||
if (0 == scounts[i]) {
|
if (scounts[i] > 0 && MPI_IN_PLACE != rbuf) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
err = ompi_ddt_sndrcv(ptmp, scounts[i], sdtype, rbuf, rcount,
|
err = ompi_ddt_sndrcv(ptmp, scounts[i], sdtype, rbuf, rcount,
|
||||||
rdtype);
|
rdtype);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Only send if there is something to send */
|
/* Only send if there is something to send */
|
||||||
if (scounts[i] > 0) {
|
if (scounts[i] > 0) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user