MPI_Scatter and MPI_Scatterv
- 13 June, 2006 //
- google SoC, informática, pfc //
- Tags :
- 0 Comments
In this post I will explain the difference between MPI_Scatter and MPI_Scatterv and why this last is needed.
MPI_Scatter sends a vector of data along the processes in the MPI communicator, sending the same number of data to each process. ie, if there is a vector[100] and there are 10 processes, each process will receive a 10 ints vector.
Suppose there is a matrix of size (x, y) and you want to send each column of size (1, y) to a MPI process using MPI_Scatter; but there are only n < x processes. There will be a problem because MPI_Scatter sends the same quantity of data to each process.
MPI_Scatterv allows to control the number of data sent to each process, in such a way you can control the above problem, sending a determinate number of columns to each process.