Parallel Programming Patterns Eun-Gyu Kim June 10, 2004.

Slides:



Advertisements
Similar presentations
ARCHITECTURES FOR ARTIFICIAL INTELLIGENCE SYSTEMS
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Counting the bits Analysis of Algorithms Will it run on a larger problem? When will it fail?
Algorithms + L. Grewe.
CISC 879 : Software Support for Multicore Architectures John Cavazos Dept of Computer & Information Sciences University of Delaware
CISC October Goals for today: Foster’s parallel algorithm design –Partitioning –Task dependency graph Granularity Concurrency Collective communication.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Parallel Programming Models and Paradigms
CISC 879 : Software Support for Multicore Architectures John Cavazos Dept of Computer & Information Sciences University of Delaware
CS350/550 Software Engineering Lecture 1. Class Work The main part of the class is a practical software engineering project, in teams of 3-5 people There.
Course Instructor: Aisha Azeem
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE 498AL, University of Illinois, Urbana-Champaign 1 ECE 498AL Programming Massively Parallel Processors.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 11 Slide 1 Architectural Design.
Lecture 29 Fall 2006 Lecture 29: Parallel Programming Overview.
Chapter 7: Architecture Design Omar Meqdadi SE 273 Lecture 7 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
ICOM 5995: Performance Instrumentation and Visualization for High Performance Computer Systems Lecture 7 October 16, 2002 Nayda G. Santiago.
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
Techniques for Analysis and Calibration of Multi- Agent Simulations Manuel Fehler Franziska Klügl Frank Puppe Universität Würzburg Lehrstuhl für Künstliche.
CSE 219 Computer Science III Program Design Principles.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
1 Introduction to Software Engineering Lecture 1.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE 498AL, University of Illinois, Urbana-Champaign 1 Basic Parallel Programming Concepts Computational.
Lecture 4 TTH 03:30AM-04:45PM Dr. Jianjun Hu CSCE569 Parallel Computing University of South Carolina Department of.
CS 484 Designing Parallel Algorithms Designing a parallel algorithm is not easy. There is no recipe or magical ingredient Except creativity We can benefit.
Data Structures and Algorithms in Parallel Computing Lecture 2.
CS- 492 : Distributed system & Parallel Processing Lecture 7: Sun: 15/5/1435 Foundations of designing parallel algorithms and shared memory models Lecturer/
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Technology Mapping. 2 Technology mapping is the phase of logic synthesis when gates are selected from a technology library to implement the circuit. Technology.
Finding concurrency Jakub Yaghob. Finding concurrency design space Starting point for design of a parallel solution Analysis The patterns will help identify.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE 498AL, University of Illinois, Urbana-Champaign 1 ECE 498AL Spring 2010 Lecture 13: Basic Parallel.
© David Kirk/NVIDIA and Wen-mei W. Hwu, 2007 ECE 498AL, University of Illinois, Urbana-Champaign 1 ECE 498AL Lecture 15: Basic Parallel Programming Concepts.
System Design. System Design After analyzing the problem, you must decide how to approach the design. During.
D Nagesh Kumar, IIScOptimization Methods: M5L1 1 Dynamic Programming Introduction.
Paper_topic: Parallel Matrix Multiplication using Vertical Data.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE 498AL, University of Illinois, Urbana-Champaign 1 ECE 498AL Spring 2010 Programming Massively Parallel.
A Pattern Language for Parallel Programming Beverly Sanders University of Florida.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
Unit-8 Sorting Algorithms Prepared By:-H.M.PATEL.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Department of Computer Science, Johns Hopkins University Lecture 7 Finding Concurrency EN /420 Instructor: Randal Burns 26 February 2014.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Chapter 5:Architectural Design l Establishing the overall structure of a software.
Parallel programs Inf-2202 Concurrent and Data-intensive Programming Fall 2016 Lars Ailo Bongo
Auburn University
Parallel Patterns.
Algorithms and Problem Solving
Auburn University COMP7330/7336 Advanced Parallel and Distributed Computing Exploratory Decomposition Dr. Xiao Qin Auburn.
Parallel Programming By J. H. Wang May 2, 2017.
Complexity Time: 2 Hours.
Parallel Programming Patterns
Auburn University COMP7330/7336 Advanced Parallel and Distributed Computing Data Partition Dr. Xiao Qin Auburn University.
Parallel Algorithm Design
Parallel Programming in C with MPI and OpenMP
Mattan Erez The University of Texas at Austin
Mattan Erez The University of Texas at Austin
Lecture 4: Activity Diagrams
CS 584.
Sungho Kang Yonsei University
Quantum Computation and Information Chap 1 Intro and Overview: p 28-58
Algorithms and Problem Solving
Mattan Erez The University of Texas at Austin
FUNDAMENTAL CONCEPTS OF PARALLEL PROGRAMMING
Parallel Programming in C with MPI and OpenMP
Area Coverage Problem Optimization by (local) Search
Mattan Erez The University of Texas at Austin
Presentation transcript:

Parallel Programming Patterns Eun-Gyu Kim June 10, 2004

Overview Definition Algorithm Patterns Example Problems / Weakness More Examples Directions

Defining Patterns Design Patterns - Quality description of problem and solution to a frequently occurring problem in some domain. –(object oriented programming, network apps…)‏ –Description usually involves problem definition, driving forces, solution, benefits, difficulties, related patterns. Pattern Language - a collection of design patterns, guiding the users through the decision process in building a system.

Definition - we get hungry every lunch hour. - usually around 11:30am – 1:00pm. - must resolve hunger. Driving Forces - appetite, intensity of hunger, nearby restaurants Solution - eat at nearest restaurant that satisfies minimum appetite requirement. Benefits - hunger is resolved Difficulties - must not fall asleep afterwards. Related Patterns - dinner, breakfast, brunch, and snack Example Design Space “Lunch” Pattern“Eat” Pattern Language Wake-Up Breakfast Lunch Dinner Brunch

Parallel Programming Pattern : WHY? Parallel software does not fully exploit parallel hardware. –Too difficult for programmers –Parallel Programming Environments do not focus on design issues. Need a “cookbook” that will guide the programmers systematically to achieve peak parallel performance. –(decomposition, algorithm, program structure, programming environment, optimizations)‏ Provide common vocabulary to the programming community. Software reusability & modularity.

Some approaches Foster Methodology –Decomposition –Communication –Agglomeration –Mapping Massingil –FindingConcurrency data vs. control –AlgorithmStructure pipeline, replicate… –SupportingStructure SPMD, fork/join… –Implementation barriers, locks…

Common Parallel Patterns Embarassingly Parallel Replicable Repository Divide&Conquer Pipeline Recursive Data Geometric IrregularMesh Inseparable

Embarassingly Parallel A B D E Independent Tasks Problem: Need to perform same operations to tasks that are independent C A B C E D manager worker

Replicable Global Data Sets of operations need to be performed using global data structure, causing dependency. local replicate Operation IOperation IIOperation III Solution reduce

Repository Independent computations needs to applied to centralized data structure in non-deterministic way. repository Compute A Compute B Compute E Compute D Compute C Asynchronous Function calls Compute object cannot access Same element simultaneously. (Repository controls access)‏

Divide & Conquer problem A problem is structured to be solved in sub-problems independently, and merging them later. subproblem Compute subproblem Compute subproblem Compute subproblem Compute subproblem solution merge split * Split level needs to be adjusted appropriately.

Pipeline Stage 1 Stage 2 Stage 3 Stage 4 Time C1C2C3C4C5C6 C1C2C3C4C5C6 C1C2C3C4C5C6 C1C2C3C4C5C6 A series of ordered but independent computation stages need to be applied on data, where each output of a computation becomes input of subsequent computation.

Recursive Data Recursive data structures seem to have little exploitable concurrency. But in some cases, the structure can be transformed Step 1 Step 2 Step 3 Find Root Problem

Geometric Dependencies exist, but communicate in predictable (geometric) neighbor-to-neighbor paths. Neighbor-To-Neighbor communication

Irregular Mesh Communication in non-predictable paths in mesh topology. Hard to define due to varying communication patterns. Start point : Pattern that constructed this mesh.

Inseparable All other parallel patterns fails, and need explicit protection when dependent data elements are accessed. –i.e. mutual exclusion, producer-consumer. Very vague definition.

They all starts from Decomposing a sequential problem to expose concurrency. Data decomposition –Concurrency comes from working on different data elements simultaneously. Functional decomposition –Concurrency comes from working on independent functional tasks simultaneously.

It’s Parallel Programming 101 Why can’t we advance from here? Almost all of the patterns discussed are either intuitive, or covered in introductory courses. Do these patterns capture most of parallel programs today? Can these patterns be used to exploit full parallelism?

Why so trivial? Only two ways to decompose: –Data and Functional. Over-simplified just for –Intuitiveness & “natural representation” –Fitting the problem to “imperative language” By defining functional task: –We have chosen to reuse a variable. –It’s a conscious choice, and brings new constraint. –Removing this does not change the problem definition.

Same Effect In many cases, different decomposition leads to same computation. = x Owner-Compute = x Row-major Decomposition Implies / Equivalent to

Exposing Better Parallelism Loosen the “natural representation”. Free the assumptions –Variable reuse –Thinking in terms of imperative language

Non-Trivial Parallelism I :Molecular Dynamics Spatial Domain (of molecules)‏ Fast Fourier Transform K-Space Periodic Domain Repeated data of molecules can be processed better in periodic domain. (but little bit harder to represent)‏ *Decomposition is done in two domains. Spatial + Periodic

Non-Trivial Parallelism II : Climate Modeling Spatial Domain (2D/3D representation of sphere)‏ Fast Fourier Transform Spectral Domain Physics equation called “Spectral Transform Method” needs spectral domain to work on.

Direction Capture fundamental decomposition in –Systematic –Constraint-Free Ways. Document more non-trivial patterns Map patterns to programming environments Structural Patterns

Any Questions?