1 / 91

On the Complexity of Buffer Allocation in Message Passing Systems

On the Complexity of Buffer Allocation in Message Passing Systems. Joint work with Jan B. Pedersen & Alan Wagner. Alex Brodsky. University of British Columbia. Outline. Motivation Definitions Buffer Allocation Problem Buffer Sufficiency Problem Nonblocking Buffer Allocation Problem

murdockm
Download Presentation

On the Complexity of Buffer Allocation in Message Passing Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. On the Complexity of Buffer Allocation in Message Passing Systems Joint work with Jan B. Pedersen & Alan Wagner Alex Brodsky University of British Columbia

  2. Outline • Motivation • Definitions • Buffer Allocation Problem • Buffer Sufficiency Problem • Nonblocking Buffer Allocation Problem • Other Models and Related Problems • Conclusion

  3. Motivation

  4. Motivation

  5. Motivation

  6. What is the Problem? send(p2,...) send(p1,...) recv(p2,...) recv(p1,...) Unless there is somewhere to put the message the senders will deadlock. So....

  7. What is the Problem? send(p2,...) send(p1,...) recv(p2,...) recv(p1,...) Unless there is somewhere to put the message the senders will deadlock. So, buffers are used.

  8. What is the Problem? send(p2,...) send(p1,...) send(p2,...) send(p1,...) send(p2,...) send(p1,...) recv(p1,...) recv(p2,...)

  9. Problem Statement • Not all systems have unrestricted amounts of buffers. • e.g., clusters that offload message passing functionality to the network interface card (NIC). • Hence, we must determine the number of buffers needed for a safe program execution. • This is the Buffer Allocation Problem (BAP). • Question: What is the complexity of BAP?

  10. Assumptions

  11. Assumptions • Processes are asynchronous.

  12. Assumptions • Processes are asynchronous. • The communication pattern is static. • i.e., doesn't change from execution to execution.

  13. Assumptions • Processes are asynchronous. • The communication pattern is static. • i.e., doesn't change from execution to execution. • Send/recv calls are explicitly matched. send(p2,...) recv(p1,...)

  14. Assumptions • Processes are asynchronous. • The communication pattern is static. • i.e., doesn't change from execution to execution. • Send/recv calls are explicitly matched. • Buffers are allocated on the receiver.

  15. Assumptions • Processes are asynchronous. • The communication pattern is static. • i.e., doesn't change from execution to execution. • Send/recv calls are explicitly matched. • Buffers are allocated on the receiver. • Sends block if • no buffers are available • & receiver is not ready.

  16. Problem Input

  17. Problem Input • What is the invariant across executions of a program?

  18. Problem Input • What is the invariant across executions of a program? • The static communication pattern

  19. Problem Input • What is the invariant across executions of a program? • The static communication pattern. • Use communication graphs to represent communication patterns. • The communication graph becomes the problem input.

  20. Communication Graph P0 P1 P2 P3 P4 P5 Time Process component Processes are denoted by vertical process arcs (up to down).

  21. Communication Graph P0 P1 start Event send recv end Events (start, end, send, receive) are denoted by vertices.

  22. Communication Graph P0 P1 send Communication arcs denote sends from one process to another.

  23. Communication Graph P0 P1 P2 P3 P4 P5 Examples of communication graphs.

  24. Arrival != Receipt P0 P1 P2 P3 Arrival interval Receive event occurs when message is received.

  25. Arrival != Receipt P0 P1 P2 P3 Arrival interval Messages can arrive before receive events.

  26. Dependencies P0 P1 All events depend on start events.

  27. Dependencies P0 P1 Receive events depend on send events.

  28. Dependencies P0 P1 If there are NO buffers, send events depend on receive events.

  29. Dependencies P2 P3 A send event depends on the preceding event.

  30. Dependencies P2 P3 The arrival interval is defined by a receive event and its dependency within the same process.

  31. Circular Dependency & Deadlock P4 P5 With no buffers, the send/receive events depend on each other.

  32. Circular Dependency & Deadlock P4 P5 A circular dependency (with no buffers) represents deadlock.

  33. The t-ring P0 P1 P2 P3 P4 P5 We call such a circular dependency a t-ring, e.g., t=6.

  34. Solving Deadlock P0 P1 P2 P3 P4 P5 0 1 0 2 0 0 To solve deadlock, we use buffers.

  35. Buffer Assignment P0 P1 P2 P3 P4 P5 0 1 0 2 0 0 Each process is assigned 0 or more buffers.

  36. Solving Deadlock P0 P1 0 1 Initially, neither process can complete a send.

  37. Solving Deadlock P0 P1 0 1 Message from process 0 is buffered by process 1.

  38. Solving Deadlock P0 P1 0 1 Process 0 can proceed to receive from process 1.

  39. Solving Deadlock P0 P1 0 1 Finally, process 1 receives from process 0.

  40. Solving Deadlock P2 P3 P4 P5 0 2 0 0 Initially, none of the sends can complete.

  41. Solving Deadlock P2 P3 P4 P5 0 2 0 0 Since message arrival is nondeterministic, 2 buffers are needed.

  42. Solving Deadlock P2 P3 P4 P5 0 2 0 0 Process P4 can complete its receives.

  43. Solving Deadlock P2 P3 P4 P5 0 2 0 0 Process P3 can complete its receives.

  44. A program is k-safe if k buffers are sufficient to guarantee deadlock free execution. Safety

  45. Informal Question: How many buffers does a program need to avoid deadlock? Formal Question: Given a communication graph, how many buffers are needed to avoid deadlock in the corresponding program? Decision Question (BAP): Given a communication graph and integer k, is the corresponding program k-safe? Buffer Allocation Problem (BAP)

  46. Thm: BAP is NP-hard • Proof by reduction from 3SAT • 3SAT Decision Problem: Does the formula of the form ∧i (ai ∨ bi∨ ci) have a satisfying assignment where each ai, bi, ci, is a either a variable xj or its negation, (n variables). • Idea: For any 3SAT formula we show how to construct a corresponding communication graph to test n-safety (requires n buffers). • 2 widgets: fix assignment and check clauses

  47. The Construction x0 ~x0 x1 ~x1 x2 ~x2 x3 ~x3 For a formula over n variables create a graph with 2n processes.

  48. Fixing the assignment x0 ~x0 x1 ~x1 x2 ~x2 x3 ~x3 The 2-rings are used to fix a variable assignment.

  49. Fixing the assignment x0 ~x0 x1 ~x1 x2 ~x2 x3 ~x3 0 1 1 0 1 0 0 1 A buffer assignment fixes the variables, e.g., ~x0, x1, x2, ~x3. No more than n buffers may be selected, (testing for n-safety).

  50. Use a 3-ring for each Clause x0 ~x0 x1 ~x1 x2 ~x2 x3 ~x3 0 1 1 0 1 0 0 1 (x0+x1+x3) (x0+~x2+x3) Each clause is represented by a 3-ring. Which will not deadlock only if one of the processes has a buffer.

More Related