August 2015
Intermediate to advanced
286 pages
5h 42m
English
The gather function performs the inverse of the scatter functionality. In this case, all processes send data to a root process that collects the data received. The gather function implemented in mpi4py is, as follows:
recvbuf = comm.gather(sendbuf, rank_of_root_process)
Here, sendbuf is the data that is sent and rank_of_root_process represents the process receiver of all the data:

Gathering data from processes 1, 2, 3, 4
In the following example, we wanted to represent just the condition shown in the preceding figure. Each process builds its own data that is to be sent to the root processes that are ...
Read now
Unlock full access