1 / 19

Featherweight X10: A Core Calculus for Async -Finish Parallelism

Featherweight X10: A Core Calculus for Async -Finish Parallelism. Jonathan K. Lee, Jens Palsberg Presented By- Vasvi Kakkad. Outline. Introduction Featherweight X10 May-Happen-in-Parallel Analysis Type Inference Context-insensitive Analysis. Introduction. Two key constructs of X10

Télécharger la présentation

Featherweight X10: A Core Calculus for Async -Finish Parallelism

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. Featherweight X10: A Core Calculus for Async-Finish Parallelism Jonathan K. Lee, Jens Palsberg Presented By- VasviKakkad

  2. Outline • Introduction • Featherweight X10 • May-Happen-in-Parallel Analysis • Type Inference • Context-insensitive Analysis

  3. Introduction • Two key constructs of X10 • Async • Finish • Goal: May-happen-in-parallel (MHP) • Identify pairs of statement that happen in parallel • Use of Type system • Context sensitive analysis

  4. Prior work • Intra-procedural MHP for X10 by Agarwal • First determines what can not happen in parallel • Take complement • No correctness proof • Inter-procedural analysis of concurrent programs by Barik/Sarkar • Different from MHP

  5. Example – Intraprocedural Analysis void main() { S0: finish { S1: async { S13: finish { S5: ... S6: async S11 S7: async S12 } S8: ... } S2: ... } S3: ... }

  6. Example – Modular Inter-procedural Analysis void f() { async S5 } void main() { S1: finish { asyncS3 f() } S2: finish { f() asyncS4 } }

  7. Featherweight X10 • Subset of X10 • While-loop, assignments, and a single one-dimensional integer array • Methods and method calls, and • The async and finish statements • Informal semantics • Async - || • Finish - ▷

  8. Example – How semantics works

  9. Grammar of Featherweight X10

  10. Semantics • Semantic Structures • A ∈ Array = N -> Z • Tree: T ::= T ⊳ T | T ∥ T | <s> | √ • State = Program X Array X Tree

  11. MHP Analysis • Use of Type System for • Modular, Context-sensitive MHP Analysis • Every program has a type • Can derive MHP information for all program • 3 – abstract domain • 9 – helper functions • 12 – type rules

  12. MHP Analysis – Abstract domains • LabelSet = P(Label) • A, B, O, R • LabelPairSet = P(Label X Label) • M • TypeEnv = MethodName -> (LabelPairSet X LabelPairSet) • E

  13. MHP Analysis – Type Rules • Type judgment 1) ⊦ p : E 2) p, E, R ⊦ T : M 3) p, E, R ⊦ s : M, O • Provides soundness and correctness proof

  14. Type Inference • Problem: given a program p, find E such that ⊦ p : E • 2 steps • Rephrase inference problem as constraint problem • Solve the constraint problem

  15. Type Inference • Constraints • Two levels: level – 1 and level - 2 • Valuations • D – domain of valuation • Maps each r and o variable in C to a subset of L • Maps each m variable in C to a subset of L X L • Constraint generation • Type and constraints are equivalent • Theorem: ⊦ p : E if and only if there exists a solution φ of C(p) where φ extends E.

  16. Type Inference • Solving constraints • Iterative data flow analysis algorithm • F : D -> D • F : λφ ∈ D.λv. φ(rhs) • F - monotone function from finite lattice D to itself • F has least fixed point and coincide with the solution of C(p)

  17. Context-insensitive Analysis • Merges information from different call sites • More conservative • Produces additional label pairs in MHP sets • Requires more time and space • Number of increased pairs – for async bodies in different methods

  18. Example – Modular Inter-procedural Analysis void f() { async S5 } void main() { S1: finish { asyncS3 f() } S2: finish { f() asyncS4 } }

  19. Conclusion • Core calculus for async-finish parallelism • Using Type system for modular, context-sensitive, MHP analysis • Type inference is straightforward • Generate and solve constraints in polynomial time • Faster and uses less space than context-insensitive • Good basis for type system and static analysis

More Related