: MPI_Scatter MPI_Scaterv.
MPI_Scatter root sendcount i- i ( ). root ( ), . comm , , , .
C:
int MPI_Scatter(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPI_Comm comm)
IN | sendbuf | - | ( - root); |
IN | sendcount | - | , ; |
IN | sendtype | - | ; |
OUT | recvbuf | - | ; |
IN | recvcount | - | ; |
IN | recvtype | - | ; |
IN | root | - | -; |
IN | comm | - | . |
sendtype recvtype , sendcount recvcount. , sendcount root - , . Scatter Gather. . 4.5 Scatter.
. 4.5. Scatter.
MPI_Scatter
MPI_Comm comm;int rbuf[100], gsize;int root, *array;......MPI_Comm_size(comm, &gsize);array = (int *) malloc(gsize * 100 * sizeof(int));......MPI_Scatter(array, 100, MPI_INT, rbuf, 100, MPI_INT, root, comm);MPI_Scaterv MPI_Scatter, . , i- , displs, - sendcounts. MPI_Gatherv.
C:
int MPI_Scatterv(void* sendbuf, int *sendcounts, int *displs,
MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, int root, MPI_Comm comm)
IN | sendbuf | - | ( - root); |
IN | sendcounts | - | ( ), , ; |
IN | displs | - | ( ), i- sendbuf , i; |
IN | sendtype | - | ; |
OUT | recvbuf | - | ; |
IN | recvcount | - | ; |
IN | recvtype | - | ; |
IN | root | - | -; |
IN | comm | - | . |
. 4.6 Scatterv.
|
|
. 4.6. Scatterv.