1 Matching Annotations
- Nov 2017
-
mpitutorial.com mpitutorial.com
-
MPI ping pong program
- world_rank, partner_rank: private for each process?
- ping_pong_count: shared?
-> NO! Each process spawns an instance of the same program with its own memory space. Operations that a process carries out on the variables in its memory space does not affect the values of the variables of another process' memory space. To communicate a value of a variable from one process to another (e.g., update the newly computed value of a variable X to its value in another process), we can use MPI_Send and MPI_Recv.
**After MPI_Send, the sent data is packed into a buffer and the program continues (e.g., it needs no receiver for the program to continue).
However, after MPI_Recv, the program waits until it receives the data. **
-