Lecture 1 – Parallel Programming Primer

Slides:



Advertisements
Similar presentations
Multiple Processor Systems
Advertisements

Multiple Processor Systems
Multiprocessors— Large vs. Small Scale Multiprocessors— Large vs. Small Scale.
Class CS 775/875, Spring 2011 Amit H. Kumar, OCCS Old Dominion University.
Super computers Parallel Processing By: Lecturer \ Aisha Dawood.
Master/Slave Architecture Pattern Source: Pattern-Oriented Software Architecture, Vol. 1, Buschmann, et al.
Reference: Message Passing Fundamentals.
Parallel Programming Models and Paradigms
Mapping Techniques for Load Balancing
Lecture 2 – MapReduce CPE 458 – Parallel Programming, Spring 2009 Except as otherwise noted, the content of this presentation is licensed under the Creative.
Lecture 1 – Parallel Programming Primer CPE 458 – Parallel Programming, Spring 2009 Except as otherwise noted, the content of this presentation is licensed.
Parallel Architectures
Reference: / Parallel Programming Paradigm Yeni Herdiyeni Dept of Computer Science, IPB.
KUAS.EE Parallel Computing at a Glance. KUAS.EE History Parallel Computing.
Computer System Architectures Computer System Software
Lecture 4: Parallel Programming Models. Parallel Programming Models Parallel Programming Models: Data parallelism / Task parallelism Explicit parallelism.
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
Multiple Processor Systems. Multiprocessor Systems Continuous need for faster and powerful computers –shared memory model ( access nsec) –message passing.
Introduction, background, jargon Jakub Yaghob. Literature T.G.Mattson, B.A.Sanders, B.L.Massingill: Patterns for Parallel Programming, Addison- Wesley,
Chapter 3 Parallel Programming Models. Abstraction Machine Level – Looks at hardware, OS, buffers Architectural models – Looks at interconnection network,
Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Multiprocessors.
Lecture 3 : Performance of Parallel Programs Courtesy : MIT Prof. Amarasinghe and Dr. Rabbah’s course note.
CS- 492 : Distributed system & Parallel Processing Lecture 7: Sun: 15/5/1435 Foundations of designing parallel algorithms and shared memory models Lecturer/
Outline Why this subject? What is High Performance Computing?
Lecture 3: Computer Architectures
3/12/2013Computer Engg, IIT(BHU)1 PARALLEL COMPUTERS- 2.
3/12/2013Computer Engg, IIT(BHU)1 INTRODUCTION-1.
Parallel Computing Presented by Justin Reschke
Lecture 1 – Introduction CSE 490h – Introduction to Distributed Computing, Winter 2008 Except as otherwise noted, the content of this presentation is licensed.
SMP Basics KeyStone Training Multicore Applications Literature Number: SPRPxxx 1.
CDA-5155 Computer Architecture Principles Fall 2000 Multiprocessor Architectures.
Background Computer System Architectures Computer System Software.
Introduction Goal: connecting multiple computers to get higher performance – Multiprocessors – Scalability, availability, power efficiency Job-level (process-level)
COMP7330/7336 Advanced Parallel and Distributed Computing Task Partitioning Dr. Xiao Qin Auburn University
Lecture 13 Parallel Processing. 2 What is Parallel Computing? Traditionally software has been written for serial computation. Parallel computing is the.
INTRODUCTION TO HIGH PERFORMANCE COMPUTING AND TERMINOLOGY.
Group Members Hamza Zahid (131391) Fahad Nadeem khan Abdual Hannan AIR UNIVERSITY MULTAN CAMPUS.
These slides are based on the book:
Auburn University COMP8330/7330/7336 Advanced Parallel and Distributed Computing Parallel Hardware Dr. Xiao Qin Auburn.
Introduction to Parallel Computing: MPI, OpenMP and Hybrid Programming
CMSC 611: Advanced Computer Architecture
CS5102 High Performance Computer Systems Thread-Level Parallelism
Distributed Processors
Processes and Threads Processes and their scheduling
Parallel Programming By J. H. Wang May 2, 2017.
CS 147 – Parallel Processing
Task Scheduling for Multicore CPUs and NUMA Systems
Parallel Programming in C with MPI and OpenMP
Multi-Processing in High Performance Computer Architecture:
CMSC 611: Advanced Computer Architecture
What is Parallel and Distributed computing?
Guoliang Chen Parallel Computing Guoliang Chen
Chapter 17 Parallel Processing
Outline Midterm results summary Distributed file systems – continued
Multiple Processor Systems
Chapter 1 Introduction.
Introduction to Operating Systems
Threads Chapter 4.
Distributed Systems CS
Introduction to Operating Systems
COMP60621 Fundamentals of Parallel and Distributed Systems
Multithreaded Programming
Prof. Leonardo Mostarda University of Camerino
Parallel Algorithm Models
Chapter 4: Threads & Concurrency
Chapter 4 Multiprocessors
Database System Architectures
Chapter 01: Introduction
COMP60611 Fundamentals of Parallel and Distributed Systems
Mattan Erez The University of Texas at Austin
Presentation transcript:

Lecture 1 – Parallel Programming Primer CPE 458 – Parallel Programming, Spring 2009 Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.http://creativecommons.org/licenses/by/2.5

Outline Introduction to Parallel Computing Parallel Architectures Parallel Algorithms Common Parallel Programming Models Message-Passing Shared Address Space

Introduction to Parallel Computing Moore’s Law The number of transistors that can be placed inexpensively on an integrated circuit will double approximately every 18 months. Self-fulfilling prophecy Computer architect goal Software developer assumption

Introduction to Parallel Computing Impediments to Moore’s Law Theoretical Limit What to do with all that die space? Design complexity How do you meet the expected performance increase?

Introduction to Parallel Computing Parallelism Continue to increase performance via parallelism.

Introduction to Parallel Computing From a software point-of-view, need to solve demanding problems Engineering Simulations Scientific Applications Commercial Applications Need the performance, resource gains afforded by parallelism

Introduction to Parallel Computing Engineering Simulations Aerodynamics Engine efficiency

Introduction to Parallel Computing Scientific Applications Bioinformatics Thermonuclear processes Weather modeling

Introduction to Parallel Computing Commercial Applications Financial transaction processing Data mining Web Indexing

Introduction to Parallel Computing Unfortunately, greatly increases coding complexity Coordinating concurrent tasks Parallelizing algorithms Lack of standard environments and support

Introduction to Parallel Computing The challenge Provide the abstractions , programming paradigms, and algorithms needed to effectively design, implement, and maintain applications that exploit the parallelism provided by the underlying hardware in order to solve modern problems.

Parallel Architectures Standard sequential architecture RAM CPU BUS Bottlenecks

Parallel Architectures Use multiple Datapaths Memory units Processing units

Parallel Architectures SIMD Single instruction stream, multiple data stream Processing Unit Interconnect Processing Unit Control Unit Processing Unit Processing Unit Processing Unit

Parallel Architectures SIMD Advantages Performs vector/matrix operations well EX: Intel’s MMX chip Disadvantages Too dependent on type of computation EX: Graphics Performance/resource utilization suffers if computations aren’t “embarrasingly parallel”.

Parallel Architectures MIMD Multiple instruction stream, multiple data stream Processing/Control Unit Interconnect Processing/Control Unit Processing/Control Unit Processing/Control Unit

Parallel Architectures MIMD Advantages Can be built with off-the-shelf components Better suited to irregular data access patterns Disadvantages Requires more hardware (!sharing control unit) Store program/OS at each processor Ex: Typical commodity SMP machines we see today.

Parallel Architectures Task Communication Shared address space Use common memory to exchange data Communication and replication are implicit Message passing Use send()/receive() primitives to exchange data Communication and replication are explicit

Parallel Architectures Shared address space Uniform memory access (UMA) Access to a memory location is independent of which processing unit makes the request. Non-uniform memory access (NUMA) Access to a memory location depends on the location of the processing unit relative to the memory accessed.

Parallel Architectures Message passing Each processing unit has its own private memory Exchange of messages used to pass data APIs Message Passing Interface (MPI) Parallel Virtual Machine (PVM)

Parallel Algorithms Algorithm Parallel Algorithm a sequence of finite instructions, often used for calculation and data processing. Parallel Algorithm An algorithm that which can be executed a piece at a time on many different processing devices, and then put back together again at the end to get the correct result

Parallel Algorithms Challenges Identifying work that can be done concurrently. Mapping work to processing units. Distributing the work Managing access to shared data Synchronizing various stages of execution.

Parallel Algorithms Models A way to structure a parallel algorithm by selecting decomposition and mapping techniques in a manner to minimize interactions.

Parallel Algorithms Models Data-parallel Task graph Work pool Master-slave Pipeline Hybrid

Parallel Algorithms Data-parallel Mapping of Work Mapping of Data Static Tasks -> Processes Mapping of Data Independent data items assigned to processes (Data Parallelism)

Parallel Algorithms Data-parallel Computation Load Balancing Tasks process data, synchronize to get new data or exchange results, continue until all data processed Load Balancing Uniform partitioning of data Synchronization Minimal or barrier needed at end of a phase Ex: Ray Tracing

Parallel Algorithms Data-parallel O P D D O P D D O P D O P O P

Parallel Algorithms Task graph Mapping of Work Mapping of Data Static Tasks are mapped to nodes in a data dependency task dependency graph (Task parallelism) Mapping of Data Data moves through graph (Source to Sink)

Parallel Algorithms Task graph Computation Load Balancing Each node processes input from previous node(s) and send output to next node(s) in the graph Load Balancing Assign more processes to a given task Eliminate graph bottlenecks Synchronization Node data exchange Ex: Parallel Quicksort, Divide and Conquer approaches

Parallel Algorithms Task graph P P P P O D P D O D P

Parallel Algorithms Work pool Mapping of Work/Data Computation No desired pre-mapping Any task performed by any process Computation Processes work as data becomes available (or requests arrive)

Parallel Algorithms Work pool Load Balancing Synchronization Dynamic mapping of tasks to processes Synchronization Adding/removing work from input queue Ex: Web Server

Parallel Algorithms Work pool Work Pool Output queue Input queue P P P

Parallel Algorithms Master-slave Modification to Worker Pool Model One or more Master processes generate and assign work to worker processes Load Balancing A Master process can better distribute load to worker processes

Parallel Algorithms Pipeline Mapping of work Mapping of Data Processes are assigned tasks that correspond to stages in the pipeline Static Mapping of Data Data processed in FIFO order Stream parallelism

Parallel Algorithms Pipeline Computation Load Balancing Data is passed through a succession of processes, each of which will perform some task on it Load Balancing Insure all stages of the pipeline are balanced (contain the same amount of work) Synchronization Producer/Consumer buffers between stages Ex: Processor pipeline, graphics pipeline

Parallel Algorithms Pipeline Input queue Output queue buffer buffer P

Common Parallel Programming Models Message-Passing Shared Address Space

Common Parallel Programming Models Message-Passing Most widely used for programming parallel computers (clusters of workstations) Key attributes: Partitioned address space Explicit parallelization Process interactions Send and receive data

Common Parallel Programming Models Message-Passing Communications Sending and receiving messages Primitives send(buff, size, destination) receive(buff, size, source) Blocking vs non-blocking Buffered vs non-buffered Message Passing Interface (MPI) Popular message passing library ~125 functions

Common Parallel Programming Models Message-Passing send(buff1, 1024, p3) receive(buff3, 1024, p1) Workstation Workstation Workstation Workstation P1 P2 P3 P4 Data

Common Parallel Programming Models Shared Address Space Mostly used for programming SMP machines (multicore chips) Key attributes Shared address space Threads Shmget/shmat UNIX operations Implicit parallelization Process/Thread communication Memory reads/stores

Common Parallel Programming Models Shared Address Space Communication Read/write memory EX: x++; Posix Thread API Popular thread API Operations Creation/deletion of threads Synchronization (mutexes, semaphores) Thread management

Common Parallel Programming Models Shared Address Space Workstation T1 T2 T3 T4 Data RAM SMP

Parallel Programming Pitfalls Synchronization Deadlock Livelock Fairness Efficiency Maximize parallelism Reliability Correctness Debugging

Prelude to MapReduce MapReduce is a paradigm designed by Google for making a subset (albeit a large one) of distributed problems easier to code Automates data distribution & result aggregation Restricts the ways data can interact to eliminate locks (no shared state = no locks!)

Prelude to MapReduce Next time… MapReduce parallel programming paradigm

References Introduction to Parallel Computing, Grama et al., Pearson Education, 2003 Distributed Systems http://code.google.com/edu/parallel/index.html Distributed Computing Principles and Applications, M.L. Liu, Pearson Education 2004