O'Reilly logo

Python Parallel Programming Cookbook by Giancarlo Zaccone

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Point-to-point communication

One of the most important features among those provided by MPI is the point-to-point communication, which is a mechanism that enables data transmission between two processes: a process receiver, and process sender.

The Python module mpi4py enables point-to-point communication via two functions:

  • Comm.Send(data, process_destination): This sends data to the destination process identified by its rank in the communicator group
  • Comm.Recv(process_source): This receives data from the source process, which is also identified by its rank in the communicator group

The Comm parameter, which stands for communicator, defines the group of processes, that may communicate through message passing:

comm = MPI.COMM_WORLD

How to do it…

In the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required