coll/libnbc: Adapt local copy for persistent request
`NBC_Copy` shoud not be called in `MPI_*_INIT`. `NBC_Sched_copy` should be called instead. Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
Этот коммит содержится в:
родитель
5c5de3a4fb
Коммит
ed0144bad4
@ -70,7 +70,7 @@ static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendt
|
||||
if (inplace) {
|
||||
sendtype = recvtype;
|
||||
sendcount = recvcount;
|
||||
} else {
|
||||
} else if (!persistent) { /* for persistent, the copy must be scheduled */
|
||||
/* copy my data to receive buffer */
|
||||
rbuf = (char *) recvbuf + rank * recvcount * rcvext;
|
||||
res = NBC_Copy (sendbuf, sendcount, sendtype, rbuf, recvcount, recvtype, comm);
|
||||
@ -78,7 +78,7 @@ static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendt
|
||||
return res;
|
||||
}
|
||||
}
|
||||
if (1 == p) {
|
||||
if (1 == p && (!persistent || inplace)) {
|
||||
return nbc_get_noop_request(persistent, request);
|
||||
}
|
||||
|
||||
@ -99,6 +99,17 @@ static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendt
|
||||
}
|
||||
|
||||
sbuf = (char *)recvbuf + rank * recvcount * rcvext;
|
||||
|
||||
if (persistent && !inplace) { /* for nonblocking, data has been copied already */
|
||||
/* copy my data to receive buffer (= send buffer of NBC_Sched_send) */
|
||||
res = NBC_Sched_copy ((void *)sendbuf, false, sendcount, sendtype,
|
||||
sbuf, false, recvcount, recvtype, schedule, true);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
OBJ_RELEASE(schedule);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/* do p-1 rounds */
|
||||
for(int r = 0 ; r < p ; ++r) {
|
||||
if(r != rank) {
|
||||
|
@ -58,7 +58,7 @@ static int nbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype send
|
||||
if (inplace) {
|
||||
sendtype = recvtype;
|
||||
sendcount = recvcounts[rank];
|
||||
} else {
|
||||
} else if (!persistent) { /* for persistent, the copy must be scheduled */
|
||||
/* copy my data to receive buffer */
|
||||
rbuf = (char *) recvbuf + displs[rank] * rcvext;
|
||||
res = NBC_Copy (sendbuf, sendcount, sendtype, rbuf, recvcounts[rank], recvtype, comm);
|
||||
@ -74,6 +74,16 @@ static int nbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype send
|
||||
|
||||
sbuf = (char *) recvbuf + displs[rank] * rcvext;
|
||||
|
||||
if (persistent && !inplace) { /* for nonblocking, data has been copied already */
|
||||
/* copy my data to receive buffer (= send buffer of NBC_Sched_send) */
|
||||
res = NBC_Sched_copy ((void *)sendbuf, false, sendcount, sendtype,
|
||||
sbuf, false, recvcounts[rank], recvtype, schedule, true);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
OBJ_RELEASE(schedule);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/* do p-1 rounds */
|
||||
for (int r = 1 ; r < p ; ++r) {
|
||||
speer = (rank + r) % p;
|
||||
|
@ -87,7 +87,7 @@ static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Dat
|
||||
return res;
|
||||
}
|
||||
|
||||
if (1 == p) {
|
||||
if (1 == p && (!persistent || inplace)) {
|
||||
if (!inplace) {
|
||||
/* for a single node - copy data to receivebuf */
|
||||
res = NBC_Copy(sendbuf, count, datatype, recvbuf, count, datatype, comm);
|
||||
@ -127,13 +127,18 @@ static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Dat
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
switch(alg) {
|
||||
case NBC_ARED_BINOMIAL:
|
||||
res = allred_sched_diss(rank, p, count, datatype, gap, sendbuf, recvbuf, op, inplace, schedule, tmpbuf);
|
||||
break;
|
||||
case NBC_ARED_RING:
|
||||
res = allred_sched_ring(rank, p, count, datatype, sendbuf, recvbuf, op, size, ext, schedule, tmpbuf);
|
||||
break;
|
||||
if (p == 1) {
|
||||
res = NBC_Sched_copy((void *)sendbuf, false, count, datatype,
|
||||
recvbuf, false, count, datatype, schedule, false);
|
||||
} else {
|
||||
switch(alg) {
|
||||
case NBC_ARED_BINOMIAL:
|
||||
res = allred_sched_diss(rank, p, count, datatype, gap, sendbuf, recvbuf, op, inplace, schedule, tmpbuf);
|
||||
break;
|
||||
case NBC_ARED_RING:
|
||||
res = allred_sched_ring(rank, p, count, datatype, sendbuf, recvbuf, op, size, ext, schedule, tmpbuf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
@ -348,7 +353,9 @@ static inline int allred_sched_diss(int rank, int p, int count, MPI_Datatype dat
|
||||
rbuf = recvbuf;
|
||||
tmprbuf = false;
|
||||
if (inplace) {
|
||||
res = NBC_Copy(rbuf, count, datatype, ((char *)tmpbuf) - gap, count, datatype, MPI_COMM_SELF);
|
||||
res = NBC_Sched_copy(rbuf, false, count, datatype,
|
||||
((char *)tmpbuf) - gap, false, count, datatype,
|
||||
schedule, true);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
return res;
|
||||
}
|
||||
|
@ -110,16 +110,6 @@ static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendty
|
||||
} else
|
||||
alg = NBC_A2A_LINEAR; /*NBC_A2A_PAIRWISE;*/
|
||||
|
||||
if (!inplace) {
|
||||
/* copy my data to receive buffer */
|
||||
rbuf = (char *) recvbuf + rank * recvcount * rcvext;
|
||||
sbuf = (char *) sendbuf + rank * sendcount * sndext;
|
||||
res = NBC_Copy (sbuf, sendcount, sendtype, rbuf, recvcount, recvtype, comm);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/* allocate temp buffer if we need one */
|
||||
if (alg == NBC_A2A_INPLACE) {
|
||||
span = opal_datatype_span(&recvtype->super, recvcount, &gap);
|
||||
@ -205,6 +195,19 @@ static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendty
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
if (!inplace) {
|
||||
/* copy my data to receive buffer */
|
||||
rbuf = (char *) recvbuf + rank * recvcount * rcvext;
|
||||
sbuf = (char *) sendbuf + rank * sendcount * sndext;
|
||||
res = NBC_Sched_copy (sbuf, false, sendcount, sendtype,
|
||||
rbuf, false, recvcount, recvtype, schedule, false);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
OBJ_RELEASE(schedule);
|
||||
free(tmpbuf);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
switch(alg) {
|
||||
case NBC_A2A_INPLACE:
|
||||
res = a2a_sched_inplace(rank, p, schedule, recvbuf, recvcount, recvtype, rcvext, gap, comm);
|
||||
|
@ -89,14 +89,6 @@ static int nbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int
|
||||
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
|
||||
return res;
|
||||
}
|
||||
if (sendcounts[rank] != 0) {
|
||||
rbuf = (char *) recvbuf + rdispls[rank] * rcvext;
|
||||
sbuf = (char *) sendbuf + sdispls[rank] * sndext;
|
||||
res = NBC_Copy (sbuf, sendcounts[rank], sendtype, rbuf, recvcounts[rank], recvtype, comm);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
schedule = OBJ_NEW(NBC_Schedule);
|
||||
@ -106,6 +98,17 @@ static int nbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int
|
||||
}
|
||||
|
||||
|
||||
if (!inplace && sendcounts[rank] != 0) {
|
||||
rbuf = (char *) recvbuf + rdispls[rank] * rcvext;
|
||||
sbuf = (char *) sendbuf + sdispls[rank] * sndext;
|
||||
res = NBC_Sched_copy (sbuf, false, sendcounts[rank], sendtype,
|
||||
rbuf, false, recvcounts[rank], recvtype, schedule, false);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
OBJ_RELEASE(schedule);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
if (inplace) {
|
||||
res = a2av_sched_inplace(rank, p, schedule, recvbuf, recvcounts,
|
||||
rdispls, rcvext, recvtype, gap);
|
||||
|
@ -77,13 +77,6 @@ static int nbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int
|
||||
sendcounts = recvcounts;
|
||||
sdispls = rdispls;
|
||||
sendtypes = recvtypes;
|
||||
} else if (sendcounts[rank] != 0) {
|
||||
rbuf = (char *) recvbuf + rdispls[rank];
|
||||
sbuf = (char *) sendbuf + sdispls[rank];
|
||||
res = NBC_Copy(sbuf, sendcounts[rank], sendtypes[rank], rbuf, recvcounts[rank], recvtypes[rank], comm);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
schedule = OBJ_NEW(NBC_Schedule);
|
||||
@ -92,6 +85,16 @@ static int nbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
if (!inplace && sendcounts[rank] != 0) {
|
||||
rbuf = (char *) recvbuf + rdispls[rank];
|
||||
sbuf = (char *) sendbuf + sdispls[rank];
|
||||
res = NBC_Sched_copy(sbuf, false, sendcounts[rank], sendtypes[rank],
|
||||
rbuf, false, recvcounts[rank], recvtypes[rank], schedule, false);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
if (inplace) {
|
||||
res = a2aw_sched_inplace(rank, p, schedule, recvbuf,
|
||||
recvcounts, rdispls, recvtypes);
|
||||
|
@ -64,23 +64,6 @@ static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Dataty
|
||||
rank = ompi_comm_rank (comm);
|
||||
p = ompi_comm_size (comm);
|
||||
|
||||
span = opal_datatype_span(&datatype->super, count, &gap);
|
||||
if (0 < rank) {
|
||||
tmpbuf = malloc(span);
|
||||
if (NULL == tmpbuf) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
if (inplace) {
|
||||
res = NBC_Copy(recvbuf, count, datatype, (char *)tmpbuf-gap, count, datatype, comm);
|
||||
} else {
|
||||
res = NBC_Copy(sendbuf, count, datatype, (char *)tmpbuf-gap, count, datatype, comm);
|
||||
}
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
free(tmpbuf);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NBC_CACHE_SCHEDULE
|
||||
/* search schedule in communicator specific tree */
|
||||
search.sendbuf = sendbuf;
|
||||
@ -98,6 +81,24 @@ static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Dataty
|
||||
}
|
||||
|
||||
if (rank != 0) {
|
||||
span = opal_datatype_span(&datatype->super, count, &gap);
|
||||
tmpbuf = malloc(span);
|
||||
if (NULL == tmpbuf) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
if (inplace) {
|
||||
res = NBC_Sched_copy(recvbuf, false, count, datatype,
|
||||
(char *)tmpbuf-gap, false, count, datatype, schedule, false);
|
||||
} else {
|
||||
res = NBC_Sched_copy((void *)sendbuf, false, count, datatype,
|
||||
(char *)tmpbuf-gap, false, count, datatype, schedule, false);
|
||||
}
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
OBJ_RELEASE(schedule);
|
||||
free(tmpbuf);
|
||||
return res;
|
||||
}
|
||||
|
||||
res = NBC_Sched_recv (recvbuf, false, count, datatype, rank-1, schedule, false);
|
||||
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
|
@ -71,13 +71,6 @@ static int nbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype
|
||||
if (inplace) {
|
||||
sendcount = recvcount;
|
||||
sendtype = recvtype;
|
||||
} else if (rank == root) {
|
||||
rbuf = ((char *)recvbuf) + (rank*recvcount*rcvext);
|
||||
/* if I am the root - just copy the message (only without MPI_IN_PLACE) */
|
||||
res = NBC_Copy(sendbuf, sendcount, sendtype, rbuf, recvcount, recvtype, comm);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NBC_CACHE_SCHEDULE
|
||||
@ -111,7 +104,17 @@ static int nbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype
|
||||
} else {
|
||||
for (int i = 0 ; i < p ; ++i) {
|
||||
rbuf = (char *)recvbuf + i * recvcount * rcvext;
|
||||
if (i != root) {
|
||||
if (i == root) {
|
||||
if (!inplace) {
|
||||
/* if I am the root - just copy the message */
|
||||
res = NBC_Sched_copy ((void *)sendbuf, false, sendcount, sendtype,
|
||||
rbuf, false, recvcount, recvtype, schedule, false);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
OBJ_RELEASE(schedule);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* root receives message to the right buffer */
|
||||
res = NBC_Sched_recv (rbuf, false, recvcount, recvtype, i, schedule, false);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
|
@ -72,8 +72,8 @@ static int nbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtyp
|
||||
if (i == root) {
|
||||
if (!inplace) {
|
||||
/* if I am the root - just copy the message */
|
||||
res = NBC_Copy (sendbuf, sendcount, sendtype, rbuf, recvcounts[i], recvtype,
|
||||
comm);
|
||||
res = NBC_Sched_copy ((void *)sendbuf, false, sendcount, sendtype,
|
||||
rbuf, false, recvcounts[i], recvtype, schedule, false);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
OBJ_RELEASE(schedule);
|
||||
return res;
|
||||
|
@ -85,7 +85,7 @@ static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Dataty
|
||||
}
|
||||
|
||||
/* only one node -> copy data */
|
||||
if (p == 1) {
|
||||
if (1 == p && (!persistent || inplace)) {
|
||||
if (!inplace) {
|
||||
res = NBC_Copy (sendbuf, count, datatype, recvbuf, count, datatype, comm);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
@ -140,13 +140,18 @@ static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Dataty
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
switch(alg) {
|
||||
case NBC_RED_BINOMIAL:
|
||||
res = red_sched_binomial(rank, p, root, sendbuf, redbuf, tmpredbuf, count, datatype, op, inplace, schedule, tmpbuf);
|
||||
break;
|
||||
case NBC_RED_CHAIN:
|
||||
res = red_sched_chain(rank, p, root, sendbuf, recvbuf, count, datatype, op, ext, size, schedule, tmpbuf, segsize);
|
||||
break;
|
||||
if (p == 1) {
|
||||
res = NBC_Sched_copy ((void *)sendbuf, false, count, datatype,
|
||||
recvbuf, false, count, datatype, schedule, false);
|
||||
} else {
|
||||
switch(alg) {
|
||||
case NBC_RED_BINOMIAL:
|
||||
res = red_sched_binomial(rank, p, root, sendbuf, redbuf, tmpredbuf, count, datatype, op, inplace, schedule, tmpbuf);
|
||||
break;
|
||||
case NBC_RED_CHAIN:
|
||||
res = red_sched_chain(rank, p, root, sendbuf, recvbuf, count, datatype, op, ext, size, schedule, tmpbuf, segsize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
@ -351,7 +356,9 @@ static inline int red_sched_binomial (int rank, int p, int root, const void *sen
|
||||
rbuf = redbuf;
|
||||
tmprbuf = tmpredbuf;
|
||||
if (inplace) {
|
||||
res = NBC_Copy(rbuf, count, datatype, ((char *)tmpbuf)-gap, count, datatype, MPI_COMM_SELF);
|
||||
res = NBC_Sched_copy(rbuf, false, count, datatype,
|
||||
((char *)tmpbuf)-gap, false, count, datatype,
|
||||
schedule, true);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
return res;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *re
|
||||
count += recvcounts[r];
|
||||
}
|
||||
|
||||
if (p == 1 || 0 == count) {
|
||||
if ((1 == p && (!persistent || inplace)) || 0 == count) {
|
||||
if (!inplace) {
|
||||
/* single node not in_place: copy data to recvbuf */
|
||||
res = NBC_Copy(sendbuf, recvcounts[0], datatype, recvbuf, recvcounts[0], datatype, comm);
|
||||
@ -174,8 +174,14 @@ static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *re
|
||||
}
|
||||
}
|
||||
|
||||
res = NBC_Sched_copy (lbuf, true, recvcounts[0], datatype, recvbuf, false,
|
||||
recvcounts[0], datatype, schedule, false);
|
||||
if (p == 1) {
|
||||
/* single node not in_place: copy data to recvbuf */
|
||||
res = NBC_Sched_copy ((void *)sendbuf, false, recvcounts[0], datatype,
|
||||
recvbuf, false, recvcounts[0], datatype, schedule, false);
|
||||
} else {
|
||||
res = NBC_Sched_copy (lbuf, true, recvcounts[0], datatype, recvbuf, false,
|
||||
recvcounts[0], datatype, schedule, false);
|
||||
}
|
||||
} else {
|
||||
res = NBC_Sched_recv (recvbuf, false, recvcounts[rank], datatype, 0, schedule, false);
|
||||
}
|
||||
|
@ -89,7 +89,8 @@ static int nbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int rec
|
||||
|
||||
/* copy data to redbuf if we only have a single node */
|
||||
if ((p == 1) && !inplace) {
|
||||
res = NBC_Copy (sendbuf, count, datatype, redbuf, count, datatype, comm);
|
||||
res = NBC_Sched_copy ((void *)sendbuf, false, count, datatype,
|
||||
redbuf, false, count, datatype, schedule, false);
|
||||
if (OMPI_SUCCESS != res) {
|
||||
OBJ_RELEASE(schedule);
|
||||
free(tmpbuf);
|
||||
|
@ -61,14 +61,6 @@ static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype
|
||||
rank = ompi_comm_rank (comm);
|
||||
p = ompi_comm_size (comm);
|
||||
|
||||
if (!inplace) {
|
||||
/* copy data to receivebuf */
|
||||
res = NBC_Copy (sendbuf, count, datatype, recvbuf, count, datatype, comm);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NBC_CACHE_SCHEDULE
|
||||
NBC_Scan_args *args, *found, search;
|
||||
|
||||
@ -86,6 +78,16 @@ static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
if (!inplace) {
|
||||
/* copy data to receivebuf */
|
||||
res = NBC_Sched_copy ((void *)sendbuf, false, count, datatype,
|
||||
recvbuf, false, count, datatype, schedule, false);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
OBJ_RELEASE(schedule);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
if(rank != 0) {
|
||||
span = opal_datatype_span(&datatype->super, count, &gap);
|
||||
tmpbuf = malloc (span);
|
||||
|
@ -70,15 +70,6 @@ static int nbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendty
|
||||
}
|
||||
}
|
||||
|
||||
if ((rank == root) && (!inplace)) {
|
||||
sbuf = (char *) sendbuf + rank * sendcount * sndext;
|
||||
/* if I am the root - just copy the message (not for MPI_IN_PLACE) */
|
||||
res = NBC_Copy (sbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NBC_CACHE_SCHEDULE
|
||||
NBC_Scatter_args *args, *found, search;
|
||||
|
||||
@ -109,7 +100,17 @@ static int nbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendty
|
||||
} else {
|
||||
for (int i = 0 ; i < p ; ++i) {
|
||||
sbuf = (char *) sendbuf + i * sendcount * sndext;
|
||||
if (i != root) {
|
||||
if (i == root) {
|
||||
if (!inplace) {
|
||||
/* if I am the root - just copy the message */
|
||||
res = NBC_Sched_copy (sbuf, false, sendcount, sendtype,
|
||||
recvbuf, false, recvcount, recvtype, schedule, false);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
OBJ_RELEASE(schedule);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* root sends the right buffer to the right receiver */
|
||||
res = NBC_Sched_send (sbuf, false, sendcount, sendtype, i, schedule, false);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
|
||||
|
@ -64,7 +64,8 @@ static int nbc_iscatterv(const void* sendbuf, const int *sendcounts, const int *
|
||||
if (i == root) {
|
||||
if (!inplace) {
|
||||
/* if I am the root - just copy the message */
|
||||
res = NBC_Copy (sbuf, sendcounts[i], sendtype, recvbuf, recvcount, recvtype, comm);
|
||||
res = NBC_Sched_copy (sbuf, false, sendcounts[i], sendtype,
|
||||
recvbuf, false, recvcount, recvtype, schedule, false);
|
||||
} else {
|
||||
res = OMPI_SUCCESS;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user