MPI_Scatter and MPI_Scatterv

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.

Posted By dsuarez

David nació en Las Palmas de Gran Canaria, España. Estudió Ingeniería en Informática en la Universidad de Las Palmas de Gran Canaria (ULPGC), donde ha trabajado en investigación los últimos años. Siempre ha sentido una gran curiosidad por los ordenadores y las ciencias, y más recientemente en el mundo empresarial. Ha trabajado como programador/analista, consultor en tecnologías de la información y obtuvo la beca de Google Summer of Code en 2006. Es socio fundador de Wantudu (http://wantudu.es), empresa especializada en terminales táctiles para hoteles.

Leave a Reply