180 likes | 305 Views
rMPI A Message Passing Library for Raw. 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. Six Function MPI. MPI_Init : initializes MPI system
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