Implementing point-to-point communication

Point-to-point operations consist of the exchange of messages between two processes. In a perfect world, every sending operation would be perfectly synchronized with the respective reception operation. Obviously, this is not the case, and the MPI implementation must be able to preserve the data sent when the sender and recipient processes are not synchronized. Typically, this occurs using a buffer, which is transparent to the developer and entirely managed by the mpi4py library.

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

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

The Comm parameter, which is short for communicator, defines the group of processes that may communicate through message passing using comm = MPI.COMM_WORLD.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset