Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Using Template Matching to Infer Parallel Design Patterns

Published: 09 January 2015 Publication History

Abstract

The triumphant spread of multicore processors over the past decade increases the pressure on software developers to exploit the growing amount of parallelism available in the hardware. However, writing parallel programs is generally challenging. For sequential programs, the formulation of design patterns marked a turning point in software development, boosting programmer productivity and leading to more reusable and maintainable code. While the literature is now also reporting a rising number of parallel design patterns, programmers confronted with the task of parallelizing an existing sequential program still struggle with the question of which parallel pattern to apply where in their code. In this article, we show how template matching, a technique traditionally used in the discovery of sequential design patterns, can also be used to support parallelization decisions. After looking for matches in a previously extracted dynamic dependence graph, we classify code blocks of the input program according to the structure of the parallel patterns we find. Based on this information, the programmer can easily implement the detected pattern and create a parallel version of his or her program. We tested our approach with six programs, in which we successfully detected pipeline and do-all patterns.

References

[1]
Christian Bienia. 2011. Benchmarking Modern Multiprocessors. Ph.D. Dissertation. Princeton University.
[2]
Simone Campanoni, Kevin Brownell, Svilen Kanev, Timothy M. Jones, Gu-Yeon Wei, and David Brooks. 2014. HELIX-RC: An architecture-compiler co-design for automatic parallelization of irregular programs. In Proceedings of the ACM/IEEE 41st International Symposium on Computer Architecture (ISCA’14). 217--228.
[3]
Simone Campanoni, Timothy Jones, Glenn Holloway, Vijay Janapa Reddi, Gu-Yeon Wei, and David Brooks. 2012. HELIX: Automatic parallelization of irregular programs for chip multiprocessing. In Proceedings of the 10th International Symposium on Code Generation and Optimization (CGO’12). ACM, New York, NY, 84--93.
[4]
Jing Dong, Yongtao Sun, and Yajing Zhao. 2008. Design pattern detection by template matching. In Proceedings of the 2008 ACM Symposium on Applied Computing (SAC’08). ACM, New York, NY, USA, 765--769.
[5]
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 1995. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Publishing Co., Boston, MA, USA.
[6]
Saturnino Garcia, Donghwan Jeon, Christopher M. Louie, and Michael Bedford Taylor. 2011. Kremlin: Rethinking and rebooting gprof for the multicore age. In Proceedings of the 32Nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’11). ACM, New York, NY, USA, 458--469.
[7]
Manjari Gupta, Akshara Pande, and A. K. Tripathi. 2011. Design patterns detection using SOP expressions for graphs. SIGSOFT Softw. Eng. Notes 36, 1 (Jan. 2011), 1--5.
[8]
Shinpei Hayashi, Junya Katada, Ryota Sakamoto, Takashi Kobayashi, and Motoshi Saeki. 2008. Design pattern detection by using meta patterns. IEICE - Trans. Inf. Syst. E91-D, 4 (April 2008), 933--944.
[9]
Jialu Huang, Thomas B. Jablin, Stephen R. Beard, Nick P. Johnson, and David I. August. 2013. Automatically exploiting cross-invocation parallelism using runtime information. In Proceedings of the 11th International Symposium on Code Generation and Optimization. IEEE Computer Society, Shenzhen, China, 1--11.
[10]
Jialu Huang, Arun Raman, Thomas B. Jablin, Yun Zhang, Tzu-Han Hung, and David I. August. 2010. Decoupled software pipelining creates parallelization opportunities. In Proceedings of the 8th Annual IEEE/ACM International Symposium on Code Generation and Optimization (CGO’10). ACM, New York, NY, USA, 121--130.
[11]
Ralf Jahr, Mike Gerdes, and Theo Ungerer. 2013. A pattern-supported parallelization approach. In Proceedings of the 2013 International Workshop on Programming Models and Applications for Multicores and Manycores (PMAM’13). ACM, New York, NY, USA, 53--62.
[12]
Melanie Kambadur, Kui Tang, and Martha A. Kim. 2012. Harmony: Collection and analysis of parallel block vectors. SIGARCH Comput. Archit. News 40, 3 (June 2012), 452--463.
[13]
Ken Kennedy and John R. Allen. 2002. Optimizing Compilers for Modern Architectures: A Dependence-Based Approach. Morgan Kaufmann Publishers, San Francisco, CA, USA.
[14]
Alain Ketterlin and Philippe Clauss. 2012. Profiling data-dependence to assist parallelization: Framework, scope, and optimization. In Proceedings of the 45th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO-45). IEEE Computer Society, Washington, DC, USA, 437--448.
[15]
Intel Labs. 2014. Intel Advisor XE. (2014). https://software.intel.com/en-us/intel-advisor-xe.
[16]
Chris Lattner and Vikram Adve. 2004. LLVM: A compilation framework for lifelong program analysis & transformation. In Proceedings of the International Symposium on Code Generation and Optimization: Feedback-Directed and Runtime Optimization (CGO’04). IEEE Computer Society, Washington, DC, USA, 75.
[17]
I-Ting Angelina Lee, Charles E. Leiserson, Tao B. Schardl, Jim Sukha, and Zhunping Zhang. 2013. On-the-fly pipeline parallelism. In Proceedings of the 25th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA’13). ACM, New York, NY, 140--151.
[18]
Zhen Li, Rohit Atre, Zia Ul-Huda, Ali Jannesari, and Felix Wolf. 2015. DiscoPoP: A profiling tool to identify parallelization opportunities. In Tools for High Performance Computing 2014. Springer International Publishing, Springer Berlin Heidelberg, 1--10 (to appear).
[19]
Zhen Li, Ali Jannesari, and Felix Wolf. 2013. Discovery of potential parallelism in sequential programs. In Proceedings of the 42nd International Conference on Parallel Processing Workshops (ICPPW), Workshop on Parallel Software Tools and Tool Infrastructures (PSTI).
[20]
Timothy Mattson, Beverly Sanders, and Berna Massingill. 2004. Patterns for Parallel Programming. Addison-Wesley Professional.
[21]
Korbinian Molitorisz. 2013. Pattern-based refactoring process of sequential source code. In Proceedings of the 17th European Conference on Software Maintenance and Reengineering (CSMR’13). Retrieved from http://ps.ipd.kit.edu/backend/tl_files/ipd/Dateien/cat_veroeffentlichunge n/Molitorisz_CSMR2013.pdf.
[22]
Libvorbis API Overview. 2014. LibVorbis. Retrieved from http://xiph.org/vorbis/doc/libvorbis/overview.html.
[23]
Ming Qiu, Qingshan Jiang, An Gao, Ergan Chen, Di Qiu, and Shang Chai. 2010. Detecting design pattern using subgraph discovery. In Proceedings of the 2nd International Conference on Intelligent Information and Database Systems: Part I (ACIIDS’10). Springer-Verlag, Berlin, 350--359. http://dl.acm.org/citation.cfm?id=1894753.1894795.
[24]
Arun Raman, Ayal Zaks, Jae W. Lee, and David I. August. 2012. Parcae: A system for flexible parallel execution. SIGPLAN Not. 47, 6 (June 2012), 133--144.
[25]
Easwaran Raman, Guilherme Ottoni, Arun Raman, Matthew J. Bridges, and David I. August. 2008. Parallel-stage decoupled software pipelining. In Proceedings of the 6th Annual IEEE/ACM International Symposium on Code Generation and Optimization (CGO’08). ACM, New York, NY, 114--123.
[26]
Sean Rul, Hans Vandierendonck, and Koen De Bosschere. 2010. A profile-based tool for finding pipeline parallelism in sequential programs. Parallel Comput. 36, 9 (2010), 531--551.
[27]
Sean Rul, Hans Vandierendonck, and Koen De Bosschere. 2007. Function level parallelism driven by data dependencies. SIGARCH Comput. Archit. News 35, 1 (March 2007), 55--62.
[28]
Georgios Tournavitis and Björn Franke. 2010. Semi-automatic extraction and exploitation of hierarchical pipeline parallelism using profiling information. In Proceedings of the 19th International Conference on Parallel Architectures and Compilation Techniques (PACT’10). ACM, New York, NY, 377--388.
[29]
Georgios Tournavitis, Zheng Wang, Björn Franke, and Michael F. P. O’Boyle. 2009. Towards a holistic approach to auto-parallelization: Integrating profile-driven parallelism detection and machine-learning based mapping. SIGPLAN Not. 44, 6 (June 2009), 177--187.
[30]
Nikolaos Tsantalis, Alexander Chatzigeorgiou, George Stephanides, and Spyros T. Halkidis. 2006. Design pattern detection using similarity scoring. IEEE Trans. Software Eng. 32, 11 (2006), 896--909.
[31]
Neil Vachharajani, Ram Rangan, Easwaran Raman, Matthew J. Bridges, Guilherme Ottoni, and David I. August. 2007. Speculative decoupled software pipelining. In Proceedings of the 16th International Conference on Parallel Architecture and Compilation Techniques (PACT’07). IEEE Computer Society, Washington, DC, 49--59.
[32]
Hans Vandierendonck, Sean Rul, and Koen De Bosschere. 2010. The parallax infrastructure: Automatic parallelization with a helping hand. In Proceedings of the 19th International Conference on Parallel Architectures and Compilation Techniques (PACT’10). ACM, New York, NY, 389--400.
[33]
Zheng Wang, Georgios Tournavitis, Björn Franke, and Michael F. P. O’Boyle. 2014. Integrating profile-driven parallelism detection and machine-learning-based mapping. ACM Trans. Archit. Code Optim. 11, 1 (Feb. 2014), Article 2, 26 pages.
[34]
Xiangyu Zhang, Armand Navabi, and Suresh Jagannathan. 2009. Alchemist: A transparent dependence distance profiling infrastructure. In Proceedings of the 7th Annual IEEE/ACM International Symposium on Code Generation and Optimization (CGO’09). IEEE Computer Society, Washington, DC, 47--58.

Cited By

View all
  • (2024)Schematic Program Proofs with Abstract ExecutionJournal of Automated Reasoning10.1007/s10817-023-09692-068:2Online publication date: 26-Mar-2024
  • (2023)Studying the expressiveness and performance of parallelization abstractions for linear pipelinesProceedings of the 14th International Workshop on Programming Models and Applications for Multicores and Manycores10.1145/3582514.3582522(29-38)Online publication date: 25-Feb-2023
  • (2022)Pattern-based Autotuning of OpenMP Loops using Graph Neural Networks2022 IEEE/ACM International Workshop on Artificial Intelligence and Machine Learning for Scientific Applications (AI4S)10.1109/AI4S56813.2022.00010(26-31)Online publication date: Nov-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Architecture and Code Optimization
ACM Transactions on Architecture and Code Optimization  Volume 11, Issue 4
January 2015
797 pages
ISSN:1544-3566
EISSN:1544-3973
DOI:10.1145/2695583
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 January 2015
Accepted: 01 November 2014
Revised: 01 October 2014
Received: 01 June 2014
Published in TACO Volume 11, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Parallel pattern detection
  2. do-all detection
  3. parallelism
  4. pipeline detection

Qualifiers

  • Research-article
  • Research
  • Refereed

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)497
  • Downloads (Last 6 weeks)10
Reflects downloads up to 25 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Schematic Program Proofs with Abstract ExecutionJournal of Automated Reasoning10.1007/s10817-023-09692-068:2Online publication date: 26-Mar-2024
  • (2023)Studying the expressiveness and performance of parallelization abstractions for linear pipelinesProceedings of the 14th International Workshop on Programming Models and Applications for Multicores and Manycores10.1145/3582514.3582522(29-38)Online publication date: 25-Feb-2023
  • (2022)Pattern-based Autotuning of OpenMP Loops using Graph Neural Networks2022 IEEE/ACM International Workshop on Artificial Intelligence and Machine Learning for Scientific Applications (AI4S)10.1109/AI4S56813.2022.00010(26-31)Online publication date: Nov-2022
  • (2022)Ever Change a Running System: Structured Software Reengineering Using Automatically Proven-Correct Transformation RulesErnst Denert Award for Software Engineering 202010.1007/978-3-030-83128-8_10(197-226)Online publication date: 28-Feb-2022
  • (2021)ArchViMP – a Framework for Automatic Extraction of Concurrency-related Software Architectural Properties50th International Conference on Parallel Processing Workshop10.1145/3458744.3473349(1-10)Online publication date: 9-Aug-2021
  • (2020)Safer ParallelizationLeveraging Applications of Formal Methods, Verification and Validation: Engineering Principles10.1007/978-3-030-61470-6_8(117-137)Online publication date: 20-Oct-2020
  • (2019)Chunking for Dynamic Linear PipelinesACM Transactions on Architecture and Code Optimization10.1145/336381516:4(1-25)Online publication date: 18-Nov-2019
  • (2019)(Dis)Advantages of Lock-free Synchronization Mechanisms for Multicore Embedded SystemsWorkshop Proceedings of the 48th International Conference on Parallel Processing10.1145/3339186.3339191(1-8)Online publication date: 5-Aug-2019
  • (2019)Automatic construct selection and variable classification in OpenMPProceedings of the ACM International Conference on Supercomputing10.1145/3330345.3330375(330-341)Online publication date: 26-Jun-2019
  • (2018)Advances in Engineering Software for Multicore SystemsDependability Engineering10.5772/intechopen.72784Online publication date: 6-Jun-2018
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media