+int PMPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
+ MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm){
+ return PMPI_Iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Iscatterv(const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+ MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
+{
+ CHECK_COMM(9)
+ if(recvbuf != MPI_IN_PLACE){
+ CHECK_BUFFER(4, recvbuf, recvcount)
+ CHECK_COUNT(5, recvcount)
+ CHECK_TYPE(7, recvtype)
+ }
+ CHECK_ROOT(9)
+ CHECK_REQUEST(10)
+ if (comm->rank() == root) {
+ CHECK_NULL(2, MPI_ERR_COUNT, sendcounts)
+ CHECK_NULL(3, MPI_ERR_ARG, displs)
+ CHECK_TYPE(4, sendtype)
+ for (int i = 0; i < comm->size(); i++){
+ CHECK_BUFFER(1, sendbuf, sendcounts[i])
+ CHECK_COUNT(2, sendcounts[i])
+ }