Fundamentals The following issues are fundamental to point-to point communication in MPl. These apply to all versions of send and receive both blocking and nonblocking, and to all send modes Source and destination Messages Sending and Receiving Messages
Fundamentals • The following issues are fundamental to point-topoint communication in MPI. These apply to all versions of send and receive, both blocking and nonblocking, and to all send modes. – Source and Destination – Messages – Sending and Receiving Messages
Source and Destination The point-to-point communication discussed here are two-sided and require active participation from the processes on both sides. One process(the source) sends and another process( the destination) receives In general, the source and destination processes operate asynchronously. Even the sending and receiving of a single message is typically not synchronized. The source process may complete sending a message long before the destination process gets around to receiving it, and the destination process may initiate receiving a message that has not yet been sent
Source and Destination • The point-to-point communication discussed here are two-sided and require active participation from the processes on both sides. One process (the source) sends, and another process (the destination) receives. • In general, the source and destination processes operate asynchronously. – Even the sending and receiving of a single message is typically not synchronized. The source process may complete sending a message long before the destination process gets around to receiving it, and the destination process may initiate receiving a message that has not yet been sent
Source and Destination Because sending and receiving are typically not synchronized, processes often have one or more messages that have been sent but not yet received These sent, but not yet received messages are called pending messages It is an important feature of MPI that pending messages are not maintained in a simple FIFo queue. Instead, each pending message has several attributes and the destination process( the receiving process)can use the attributes to determine which message to receive
Source and Destination • Because sending and receiving are typically not synchronized, processes often have one or more messages that have been sent but not yet received. • These sent, but not yet received messages are called pending messages. • It is an important feature of MPI that pending messages are not maintained in a simple FIFO queue. Instead, each pending message has several attributes and the destination process (the receiving process) can use the attributes to determine which message to receive
Messages Messages consist of 2 parts: the envelope and the message bod MPI Send (sendbuf, cnt, datatype, dest, tag, comm) message body envelope MPI Recv(recvbuf, cnt, datatype, source, tag, comm, status) MPI Message Letter Send/receive buffer letter content Count/size etter weight Source(receive) Return address Destination(send) Destination address Communicator Country
Messages • Messages consist of 2 parts: the envelope and the message body. MPI_Send(sendbuf,cnt,datatype,dest,tag,comm); MPI_Recv(recvbuf,cnt,datatype,source,tag,comm,status); MPI Message Letter Send/receive buffer letter content Count/size Letter weight Source (receive) Return address Destination (send) Destination address Communicator Country message body envelope
)Message body The message body has 3 parts Buffer It is the space in the computer's memory where the MPl message data are to be sent from or stored to Dataty pe The type of the message data to be transmitted(e.g. floating point). The datatype should be the same for the send and receive call count The number of items of data in the message. The count specified by the receive call should be equal to or greater than the count specified by the send
Message body • The message body has 3 parts: – Buffer It is the space in the computer's memory where the MPI message data are to be sent from or stored to – Datatype The type of the message data to be transmitted(e.g.floating point). The datatype should be the same for the send and receive call. – count The number of items of data in the message. The count specified by the receive call should be equal to or greater than the count specified by the send