A Pattern-based Transformation Approach to Parallelise Software Systems using a System Dependency Graph Johanna E. Krause 27 January 2016 Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 1 / 37
Outline 1. Motivation 2. Goals 3. Approach Mining of Candidate and Parallelisation Patterns Formalising Candidate Patterns Transformation 4. Live Demonstration 5. Evaluation 6. Conclusion and Future Work Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 2 / 37
Motivation for (Semi-)Automatic Parallelisation Motivation ◮ Parallel programs are mostly more performant Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 3 / 37
Motivation for (Semi-)Automatic Parallelisation Motivation ◮ Parallel programs are mostly more performant ◮ Many legacy systems would benefit from parallelisation Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 3 / 37
Motivation for (Semi-)Automatic Parallelisation Motivation ◮ Parallel programs are mostly more performant ◮ Many legacy systems would benefit from parallelisation ◮ Manual adjustments are time and cost consuming Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 3 / 37
Goals Overall Approach Goals Legend: Static S1 : SDG Construction information S2 : Gathering S3 : SDG Enrichment S4 : Ranking S4 S3 S5 : Pattern Detection Runtime S6 : Transformation information S7: Code Generation Parallelism Sequential program plan System dependency graph (SDG) S5 Semi-automatic transformation S7 S6 Parallel program Candidate Parallelization pattern pattern Christian Wulf ― 18.02.2015 Figure 1 : Pattern-based detection and utilization of potential parallelism in software systems [Wulf14] Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 4 / 37
Goals Goals ◮ Goal 1: Mining of Candidate and Parallelisation Patterns Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 5 / 37
Goals Goals ◮ Goal 1: Mining of Candidate and Parallelisation Patterns ◮ Goal 2: Formalising Candidate Patterns Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 5 / 37
Goals Goals ◮ Goal 1: Mining of Candidate and Parallelisation Patterns ◮ Goal 2: Formalising Candidate Patterns ◮ G2.1: Formalising as System Dependency Graph (SDG) Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 5 / 37
Goals Goals ◮ Goal 1: Mining of Candidate and Parallelisation Patterns ◮ Goal 2: Formalising Candidate Patterns ◮ G2.1: Formalising as System Dependency Graph (SDG) ◮ G2.2: Formalising as Cypher Match Query (CMQ) Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 5 / 37
Goals Goals ◮ Goal 1: Mining of Candidate and Parallelisation Patterns ◮ Goal 2: Formalising Candidate Patterns ◮ G2.1: Formalising as System Dependency Graph (SDG) ◮ G2.2: Formalising as Cypher Match Query (CMQ) ◮ Goal 3: Transforming Candidate Patterns to Parallelisation Patterns Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 5 / 37
Goals Goals ◮ Goal 1: Mining of Candidate and Parallelisation Patterns ◮ Goal 2: Formalising Candidate Patterns ◮ G2.1: Formalising as System Dependency Graph (SDG) ◮ G2.2: Formalising as Cypher Match Query (CMQ) ◮ Goal 3: Transforming Candidate Patterns to Parallelisation Patterns ◮ G3.1: Formalising as SDG Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 5 / 37
Goals Goals ◮ Goal 1: Mining of Candidate and Parallelisation Patterns ◮ Goal 2: Formalising Candidate Patterns ◮ G2.1: Formalising as System Dependency Graph (SDG) ◮ G2.2: Formalising as Cypher Match Query (CMQ) ◮ Goal 3: Transforming Candidate Patterns to Parallelisation Patterns ◮ G3.1: Formalising as SDG ◮ G3.2: Formalising as Cypher Update Query (CUQ) Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 5 / 37
Goals Goals ◮ Goal 1: Mining of Candidate and Parallelisation Patterns ◮ Goal 2: Formalising Candidate Patterns ◮ G2.1: Formalising as System Dependency Graph (SDG) ◮ G2.2: Formalising as Cypher Match Query (CMQ) ◮ Goal 3: Transforming Candidate Patterns to Parallelisation Patterns ◮ G3.1: Formalising as SDG ◮ G3.2: Formalising as Cypher Update Query (CUQ) ◮ Goal 4: Evaluating the Speed-Up of the Transformed Application Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 5 / 37
Approach for the Thesis Approach Sequential Program JAVA 0. Pattern Mining 4. Evaluation create SDG choose 1. prototype 2. Parallelised Neo4J Program Cypher Match Query Database formalise pattern execute MATCH (node1) generate JAVA -[:related_to]-> (node2) Candidate WHERE ... Pattern RETURN node1, node2 parallelise 3. Cypher Update Query Resulting candidates: formalise 1) transformation execute MATCH node... WHERE ... CREATE/DELETE ... 2) Parallelisation RETURN node... Pattern ... Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 6 / 37
❢♦r ✭ ■♠♣♦rt❛♥t❖❜❥❡❝t ♦ ✿ ❧✐st✮ ④ r❡s✉❧t ❂ ❝❛❧❝✉❧❛t❡❙♦♠❡t❤✐♥❣❋♦r◗✉✐t❡❆❲❤✐❧❡ ✭♦✮❀ ✇r✐t❡❘❡s✉❧t■♥❉❛t❛❜❛s❡ ✭r❡s✉❧t ✮❀ ⑥ ✐♥t s✉♠ ❂ ✵❀ ❢♦r ✭✐♥t ✐ ❂ ✵❀ ✐ ❁ ❛rr❛②✳❧❡♥❣t❤❀ ✐✰✰✮ ④ s✉♠ ❂ s✉♠ ✰ ❛rr❛②❬✐❪❀ ⑥ Solving Goal 1: Pattern Mining Approach ⊲ Mining of Candidate and Parallelisation Patterns Independent Successive Method Calls ❞❛t❛s❡r✈❡r✳❝♦♥♥❡❝t ✭✮❀ ❡✈❡♥ts❡r✈❡r✳❝♦♥♥❡❝t ✭✮❀ Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 7 / 37
✐♥t s✉♠ ❂ ✵❀ ❢♦r ✭✐♥t ✐ ❂ ✵❀ ✐ ❁ ❛rr❛②✳❧❡♥❣t❤❀ ✐✰✰✮ ④ s✉♠ ❂ s✉♠ ✰ ❛rr❛②❬✐❪❀ ⑥ Solving Goal 1: Pattern Mining Approach ⊲ Mining of Candidate and Parallelisation Patterns Independent Successive Method Calls ❞❛t❛s❡r✈❡r✳❝♦♥♥❡❝t ✭✮❀ ❡✈❡♥ts❡r✈❡r✳❝♦♥♥❡❝t ✭✮❀ Independent For-Each Loop ❢♦r ✭ ■♠♣♦rt❛♥t❖❜❥❡❝t ♦ ✿ ❧✐st✮ ④ r❡s✉❧t ❂ ❝❛❧❝✉❧❛t❡❙♦♠❡t❤✐♥❣❋♦r◗✉✐t❡❆❲❤✐❧❡ ✭♦✮❀ ✇r✐t❡❘❡s✉❧t■♥❉❛t❛❜❛s❡ ✭r❡s✉❧t ✮❀ ⑥ Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 7 / 37
Solving Goal 1: Pattern Mining Approach ⊲ Mining of Candidate and Parallelisation Patterns Independent Successive Method Calls ❞❛t❛s❡r✈❡r✳❝♦♥♥❡❝t ✭✮❀ ❡✈❡♥ts❡r✈❡r✳❝♦♥♥❡❝t ✭✮❀ Independent For-Each Loop ❢♦r ✭ ■♠♣♦rt❛♥t❖❜❥❡❝t ♦ ✿ ❧✐st✮ ④ r❡s✉❧t ❂ ❝❛❧❝✉❧❛t❡❙♦♠❡t❤✐♥❣❋♦r◗✉✐t❡❆❲❤✐❧❡ ✭♦✮❀ ✇r✐t❡❘❡s✉❧t■♥❉❛t❛❜❛s❡ ✭r❡s✉❧t ✮❀ ⑥ Array Reduction ✐♥t s✉♠ ❂ ✵❀ ❢♦r ✭✐♥t ✐ ❂ ✵❀ ✐ ❁ ❛rr❛②✳❧❡♥❣t❤❀ ✐✰✰✮ ④ s✉♠ ❂ s✉♠ ✰ ❛rr❛②❬✐❪❀ ⑥ [Molitorisz12, Mattson04] Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 7 / 37
Solving Goal 1: Pattern Mining Approach ⊲ Mining of Candidate and Parallelisation Patterns Independent Successive Method Calls ❞❛t❛s❡r✈❡r✳❝♦♥♥❡❝t ✭✮❀ ❡✈❡♥ts❡r✈❡r✳❝♦♥♥❡❝t ✭✮❀ Independent For-Each Loop ❢♦r ✭ ■♠♣♦rt❛♥t❖❜❥❡❝t ♦ ✿ ❧✐st✮ ④ r❡s✉❧t ❂ ❝❛❧❝✉❧❛t❡❙♦♠❡t❤✐♥❣❋♦r◗✉✐t❡❆❲❤✐❧❡ ✭♦✮❀ ✇r✐t❡❘❡s✉❧t■♥❉❛t❛❜❛s❡ ✭r❡s✉❧t ✮❀ ⑥ Array Reduction ✐♥t s✉♠ ❂ ✵❀ ❢♦r ✭✐♥t ✐ ❂ ✵❀ ✐ ❁ ❛rr❛②✳❧❡♥❣t❤❀ ✐✰✰✮ ④ s✉♠ ❂ s✉♠ ✰ ❛rr❛②❬✐❪❀ ⑥ [Molitorisz12, Mattson04] Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 7 / 37
Solving Goal 2: Pattern Matching SDG of Candidate Pattern Approach ⊲ Formalising Candidate Patterns ... Method MethodCall calls ?? ?? avDur > 200ms ... MethodCall/ Method Assignment calls ?? ?? avDur > 200ms ... Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 8 / 37
Solving Goal 2: Pattern Matching Initial CMQ Approach ⊲ Formalising Candidate Patterns MATCH (m1: MethodCall ) − [:CONTROL_FLOW*1..5] − > (m2: MethodCall ) RETURN c o l l e c t ( DISTINCT id (m1) ) Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 9 / 37
Solving Goal 2: Pattern Matching Restriction: Minimum Average Duration Approach ⊲ Formalising Candidate Patterns MATCH (m1: MethodCall ) − [:CONTROL_FLOW*1..5] − > (m2: MethodCall ) WHERE m1. avgDurInMs > 200 AND m2. avgDurInMs > 200 RETURN c o l l e c t ( DISTINCT id (m1) ) Johanna E. Krause Parallelise Software Systems using an SDG 27 January 2016 10 / 37
Recommend
More recommend