August 2015
Intermediate to advanced
286 pages
5h 42m
English
The scatter functionality is very similar to a scatter broadcast but has one major difference, while comm.bcast sends the same data to all listening processes, comm.scatter can send the chunks of data in an array to different processes. The following figure illustrates the functionality of scatter:

Scattering data from process 0 to processes 1, 2, 3, 4
The comm.scatter function takes the elements of the array and distributes them to the processes according to their rank, for which the first element will be sent to the process zero, the second element to the process 1, and so on. The function implemented in
Read now
Unlock full access