180 likes | 311 Vues
The Message Passing Interface (MPI) is essential for developing message-passing programs with its clean and powerful interface. This library provides standard primitives like MPI_Init, MPI_Comm_rank, and MPI_Send/Recv for effective communication. Using General Dynamic Network (GDN), messages must be packetized, enabling reassembly of logical MPI messages from raw data. The example illustrates how a tile can receive and process packets in a specified order, demonstrating the initial state, packet addition, and buffer management. Get equipped with MPI for streamlined multi-process communication.
E N D
rMPIA Message Passing Library for Raw James Psota
What is MPI? • Clean and powerful interface for writing message passing programs • A set of well-defined standard primitives with which many programmers are familiar James Psota
Six Function MPI • MPI_Init: initializes MPI system • MPI_Comm_rank: returns “id” of calling tile • MPI_Comm_size: returns number of tiles running MPI program • MPI_Send: blocking send • MPI_Recv: blocking receive • MPI_Finalize: cleans all MPI state James Psota
Packets • Use General Dynamic Network (GDN) • Must “packetize” MPI messages (GDN supports ≤ 31 words per Raw message) • Receiver must be able to re-assemble packets into logical MPI messages James Psota
Packet Structure • First packet • Later packet James Psota
Re-assembling Packets Example: tile02 does a MPI_Recv(src=0, tag=7), but also receives packets from other sources as well, in the in the following order: (note: <src,tag>) <6,1>, <0,2>, <0,7>, <6,1>, <0,7>, <6,1>, <0,7>, <0,7>, <0,7> James Psota
Initial State: empty James Psota
Add <6,1>1 James Psota
Add <0,2>1 James Psota
Add <0,7>1 James Psota
Add <6,1>2 James Psota
Add <0,7>2 James Psota
Add <6,1>3 James Psota
Add <0,7>3 James Psota
Add <0,7>4 James Psota
Add <0,7>5 James Psota
Copy Into Tile02’s Buffer James Psota
Clean-up State James Psota