Presentation is loading. Please wait.

Presentation is loading. Please wait.

Non-Blocking I/O CS550 Operating Systems. Outline Continued discussion of semaphores from the previous lecture notes, as necessary. MPI Types What is.

Similar presentations


Presentation on theme: "Non-Blocking I/O CS550 Operating Systems. Outline Continued discussion of semaphores from the previous lecture notes, as necessary. MPI Types What is."— Presentation transcript:

1 Non-Blocking I/O CS550 Operating Systems

2 Outline Continued discussion of semaphores from the previous lecture notes, as necessary. MPI Types What is non-blocking I/O? Review of MPI_Irecv and MPI_Isend Example Code

3 MPI Types MPI_CHARMPI_LONG MPI_SHORTMPI_FLOAT MPI_INTMPI_DOUBLE Many other types exist These types are analogous to C primitive types See the MPI Reference Manual for more examples

4 Blocking I/O In blocking I/O, when a message is sent, a process waits until it has acknowledgement that the message has been received before it can continue processing. Similarly, when a message is requested (a receive method/function is called) the program waits until the message has been received before continuing processing.

5 Blocking I/O Example Process1 Process2 +------------+ 1.send msg +------------+ |MPI_Send | --------> |MPI_Recv | |wait for ack| |wait for msg| |ack received| <-------- |ack receipt | |3b.continue | 2.send ack |3a.continue | +------------+

6 Non-Blocking I/O Non-blocking I/O allows for messages to be sent or requested for receipt without waiting for an acknowledgement that the message has been received. This means that programs may continue processing immediately after sending a message or after requesting that a message be received.

7 Non-Blocking I/O Example Process1 Process2 +------------+ 1.send msg +-------------+ |MPI_Isend | --------> |MPI_Irecv | |2a.continue | |2b.continue | | | |3. Do WORK | | | |MPI_Wait | | | |4.wait on msg| | | |5.work on msg| +------------+ +-------------+

8 Non-Blocking I/O Example 2 Process1 Process2 +------------+ +-------------+ | | |MPI_Irecv | |1a.Do WORK | |1b.continue | | | |2. Do WORK | | | |MPI_Wait | | MPI_Isend | 5.send msg |4.wait on msg| | | --------> |6.work on msg| +------------+ +-------------+

9 MPI Non-blocking I/O Functions MPI_Get_count – used to determine the length of a received message MPI_Irecv – non-blocking receive MPI_Isend – non-blocking send MPI_Wait – waits for one message to be received after performing a non-blocking send. MPI_Waitall – waits for all specified messages (e.g. a list of messages) to be received. MPI_Wait_some – waits for at least one message out of a list of messages to be received, then continues processing

10 Example Code See the non-blocking I/O examples from the course webpage


Download ppt "Non-Blocking I/O CS550 Operating Systems. Outline Continued discussion of semaphores from the previous lecture notes, as necessary. MPI Types What is."

Similar presentations


Ads by Google