dimanche 29 mars 2015

how to use MPI_Scatterv() properly



I am having a problem using MPI_Scatterv in a parallel program. Here is how it is defined :


int MPI_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)


the way I understood it , the deference between MPI_Scatterv and MPI_Scatter is the fact that in MPI_Scatterv segments do not have to be of the same length and they don't have to be continuous (gaps in memory are allowed). the part I do not understand is if the recvbuf can be an array of different size for each process then what should be used for recvcount! (lets say I want to send 5 element of sendbuf to process 0 and 15 to process 1 ! what should be the value of recvcount?)


Thank you in advance




Aucun commentaire:

Enregistrer un commentaire