Download presentation
Presentation is loading. Please wait.
Published byRoland Benson Modified over 9 years ago
1
Featherweight X10: A Core Calculus for Async-Finish Parallelism Jonathan K. Lee, Jens Palsberg Presented By- Vasvi Kakkad
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 { async S3 f() } S2: finish { f() async S4 }
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 | | √ – 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 { async S3 f() } S2: finish { f() async S4 }
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.