1 / 21

Pattern-based Detection and Utilization of Potential Parallelism in Software Systems

Pattern-based Detection and Utilization of Potential Parallelism in Software Systems. Doctoral Symposium. Prof. Dr. Wilhelm Hasselbring Department of Computer Science Kiel University D-24118 Kiel. Motivation. Autofutures compiler [Molitorisz2012 ] fully automatic

lynch
Download Presentation

Pattern-based Detection and Utilization of Potential Parallelism in Software 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. Pattern-based Detection and Utilization of Potential Parallelism in Software Systems Doctoral Symposium Prof. Dr. Wilhelm Hasselbring Department of Computer Science Kiel University D-24118 Kiel

  2. Motivation • Autofuturescompiler [Molitorisz2012] • fully automatic • uses static information only • limited to method invocations without any data dependencies • Helixcompiler [Campanoni2012] • fully automatic • over-approximation of indeterminable dependencies (e.g., file or network access) • limited to loop parallelization • SUIFcompiler [Hall2005] • fully automatic • uses static information only • over-approximation of indeterminable dependencies (e.g., file or network access) • limited to loop parallelization • Kismet recommendation system [Jeon2011] • requires a sample input and system constraints • estimates a realistic upper bound for speedup • localizes parallelizable code regions • gives no hint of how to parallelize • ALTERassistancesystem [Udupa2011] • requires code annotations • eliminates superfluous dependencies • limited to loop parallelization • gives no hint of what to parallelize • Janusspeculativeparallelizationsystem [Tripp2012] • requires ADT specifications and a training input • limited to loop parallelization • gives no hint of what to parallelize Code Generation RuntimeMgmt Transformation Discovery Planning The five phases in the parallelization process [Garcia2011] Many parallelization approaches available e.g., [Hall2005, Molitorisz2012, Campanoni2012,Jeon2011, Udupa2011, Tripp2012] Detection and Utilization of Potential Parallelism in Software Systems

  3. Goals G1Performance Improvement through Parallelism G2Systematic Guidance and Support in the Parallelization Process (where, what, how) G3Hide Concurrency-Specific Technical Program Constructs from the User (also for non-experts) G4 Structure and Language Independence (e.g., not only loops and particular method invocations) G5Extensibility of the Approach (most other approaches are built for a single situation without extensibility in mind) Detection and Utilization of Potential Parallelism in Software Systems

  4. Overviewofour Approach Detection and Utilization of Potential Parallelism in Software Systems

  5. S1: SDG Construction • e.g., withSootorWala controlflow dependencies dataflow hierarchy Detection and Utilization of Potential Parallelism in Software Systems

  6. S2: Runtime Information Gathering e.g., with Profiling/Monitoring Instrumentation • number of method invocations • method execution time • number of loop iterations • I/O accesses • accessed array positions Detection and Utilization of Potential Parallelism in Software Systems

  7. S3: SDG Enrichment type: method invocation name: file.updateContents(text) variable: writtenBytes type: method invocation name: file.updateContents(text) variable: writtenBytes invocations: 10 exec. time: avg: 300ms, mean: 290ms, min: 250ms, max: 600ms filenames: (“C:/../Person.java”, “C:/../Address.java”, “C:/../Cridentials.java”, …) Graph transformation Detection and Utilization of Potential Parallelism in Software Systems

  8. S4: Ranking Ranking strategy #1 Ranking strategy #2 Detection and Utilization of Potential Parallelism in Software Systems

  9. S5: Pattern Detection yes save fornextstep discard match? no Detection and Utilization of Potential Parallelism in Software Systems

  10. Excursus: Pattern Definition manual construction at the conceptual and implementation level Graph querywithsubgraphpatternmatching (e.g. Neo4J‘s Cypher) Graph descriptionformat (e.g., GXL) isReductionVariable: true Pattern asgraphrepresentation Detection and Utilization of Potential Parallelism in Software Systems

  11. S6: Transformation • graph refactoring • introduction of concurrency • introduction of synchronization • final approval by the user graphtransformation matchedinstanceof a candidatepattern correspondinginstanceof a parallelizationpattern Detection and Utilization of Potential Parallelism in Software Systems

  12. S7: Code Generation Code generation (e.g., withXTend) Detection and Utilization of Potential Parallelism in Software Systems

  13. Evaluation of G1 measure compare speedup speedup unparallelized semi-automaticallyparallelized manuallyparallelized Detection and Utilization of Potential Parallelism in Software Systems G1 Performance Improvement through Parallelism by conducting a performance evaluation of our approach use input programs of different application domains

  14. Evaluation of G2 & G3 • about the interaction with and usability of our prototype • with 30 master students and 2 professional software engineers Detection and Utilization of Potential Parallelism in Software Systems G2Systematic Guidance and Support in the Parallelization Process (where, what, how) G3Hide Concurrency-Specific Technical Aspects from the User by implementing a prototype by conducting a structured interview

  15. Evaluation of G4 Detection and Utilization of Potential Parallelism in Software Systems G4 Structure and Language Independence • by parallelizing • loop control structures, • method invocations, and • I/O operations • by supporting Java and C#

  16. Evaluation of G5 Detection and Utilization of Potential Parallelism in Software Systems G5 Extensibility of the Approach by providing two different ranking strategies (S4) by defining candidate patterns (S5) by defining parallelization patterns (S6) with respect to different code levels (e.g., at method, loop, and statement level)

  17. Conclusions http://kieker-monitoring.net/ Detection and Utilization of Potential Parallelism in Software Systems Semi-automatic parallelization approach supporting in where, what, and how to parallelize Patterns utilize static and runtime information Usable by experts and non-experts Wide range of application (not only at loop level) Extensible in prioritizing (S4), detecting (S5), and parallelizing (S6) code regions

  18. References Detection and Utilization of Potential Parallelism in Software Systems [Jeon2011] Jeon, Donghwan and Garcia, Saturnino and Louie, Chris and Taylor, Michael Bedford, “Kismet: parallel speedup estimates for serial programs”, SIGPLAN Not., 2011, p. 519-536 [Udupa2011] Udupa, Abhishek and Rajan, Kaushik and Thies, William, “ALTER: exploiting breakable dependences for parallelization”, SIGPLAN Not., 2011, p. 480-491 [Hall2005] Hall, Mary W. and Amarasinghe, Saman P. and Murphy, Brian R. and Liao, Shih-Wei and Lam, Monica S., “Interprocedural parallelization analysis in SUIF”, ACM Trans. Program. Lang. Syst., p. 662-731 [Campanoni2012] Campanoni, S. and Jones, T.M. and Holloway, G. and Gu-Yeon Wei and Brooks, D., “Helix: Making the Extraction of Thread-Level Parallelism Mainstream”, Micro, IEEE, 2012, p. 8-18 [Molitorisz2012] Molitorisz, Korbinian and Schimmel, Jochen and Otto, Frank, “AutomaticParallelizationUsingAutoFutures”, Lecture Notes in Computer Science: Multicore Software Engineering, Performance, and Tools, 2012,p. 78-81 [Tripp2012] Tripp, Omer and Manevich, Roman and Field, John and Sagiv, Mooly, “JANUS: Exploiting Parallelism via Hindsight”, In the Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation, 2012, p. 145-156 [Garcia2011] Garcia, Saturnino and Jeon, Donghwan and Louie, Christopher M. and Taylor, Michael Bedford, “Kremlin: rethinking and rebooting gprof for the multicore age”, In the Proceedings of the 32nd ACM SIGPLAN conference on Programming language design and implementation, 2011, p. 458-469 [Mattson2004] Timothy G. Mattson, Beverly A. Sanders, Berna L. Massingill, “Patterns for Parallel Programming”, Addison-Wesley

  19. I/O Dependencies unknown at compile-time • Runtime information can help in detecting I/O dependencies with the help of their URLs • Final semantic approval by the user to ensure correct generalization Detection and Utilization of Potential Parallelism in Software Systems

  20. Spurious Dependencies Detection and Utilization of Potential Parallelism in Software Systems Convergence algorithms that are robust to stale reads while (delta > threshold) { for (inti=0; i<dimA; i++) { s = read(vector) vector[i] = … } } Thread-safe data structures Statements whose order of execution is irrelevant for (inti=0; i<dimA; i++) { … if (values[i] > max) { max = values[i] } randomNumberGenerator.nextInteger() }

  21. Pattern Definition Levels ExecutorService executor = Executors.newCachedThreadPool(); pool = newThreadPool() C# Java runtime= Runtime.getRuntime() C#’s ThreadPool has only static methods numCores= runtime.availableProcessors() executor= Executors.newFixedThreadPool(numCores) “Supporting Structures Design Space“ [Mattson2004] “Implementation Mechanism Design Space” [Mattson2004] Detection and Utilization of Potential Parallelism in Software Systems Pattern constructs at the conceptual level1 (e.g., Master-Worker, Fork-Join, Thread Pool, and Shared Queue) Pattern constructs at the implementation level2 (depends on the underlying programming language and its APIs)

More Related