1 Chapter 1 Why Parallel Computing? An Introduction to Parallel Programming Peter Pacheco.

Slides:



Advertisements
Similar presentations
1 Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 1 Why Parallel Computing? An Introduction to Parallel Programming Peter Pacheco.
Advertisements

OpenMP Optimization National Supercomputing Service Swiss National Supercomputing Center.
Concurrency The need for speed. Why concurrency? Moore’s law: 1. The number of components on a chip doubles about every 18 months 2. The speed of computation.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Development of Parallel Simulator for Wireless WCDMA Network Hong Zhang Communication lab of HUT.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Multicore & Parallel Processing P&H Chapter ,
Revisiting a slide from the syllabus: CS 525 will cover Parallel and distributed computing architectures – Shared memory processors – Distributed memory.
Reference: Message Passing Fundamentals.
Henry Hexmoor1 Chapter 7 Henry Hexmoor Registers and RTL.
1 Tuesday, November 07, 2006 “If anything can go wrong, it will.” -Murphy’s Law.
DISTRIBUTED AND HIGH-PERFORMANCE COMPUTING CHAPTER 7: SHARED MEMORY PARALLEL PROGRAMMING.
12a.1 Introduction to Parallel Computing UNC-Wilmington, C. Ferner, 2008 Nov 4, 2008.
Parallel Computing Overview CS 524 – High-Performance Computing.
Multi-core processors. History In the early 1970’s the first Microprocessor was developed by Intel. It was a 4 bit machine that was named the 4004 The.
1 TRAPEZOIDAL RULE IN MPI Copyright © 2010, Elsevier Inc. All rights Reserved.
Advances in Language Design
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 5 Shared Memory Programming with OpenMP An Introduction to Parallel Programming Peter Pacheco.
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.
Lecture 2 CSS314 Parallel Computing
1 OpenMP Writing programs that use OpenMP. Using OpenMP to parallelize many serial for loops with only small changes to the source code. Task parallelism.
Multi-Core Architectures
Multi-core Programming Introduction Topics. Topics General Ideas Moore’s Law Amdahl's Law Processes and Threads Concurrency vs. Parallelism.
Lecture 1: Performance EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2013, Dr. Rozier.
1 Computer Architecture Research Overview Rajeev Balasubramonian School of Computing, University of Utah
The University of Adelaide, School of Computer Science
What have mr aldred’s dirty clothes got to do with the cpu
C OMPUTER O RGANIZATION AND D ESIGN The Hardware/Software Interface 5 th Edition Chapter 1 Computer Abstractions and Technology Sections 1.5 – 1.11.
Chapter 2 Parallel Architecture. Moore’s Law The number of transistors on a chip doubles every years. – Has been valid for over 40 years – Can’t.
Parallel Processing Sharing the load. Inside a Processor Chip in Package Circuits Primarily Crystalline Silicon 1 mm – 25 mm on a side 100 million to.
Lecture 3 Books: “Hadoop in Action” by Chuck Lam, “An Introduction to Parallel Programming” by Peter Pacheco.
Lecture 2 Books: “Hadoop in Action” by Chuck Lam, “An Introduction to Parallel Programming” by Peter Pacheco.
CS- 492 : Distributed system & Parallel Processing Lecture 7: Sun: 15/5/1435 Foundations of designing parallel algorithms and shared memory models Lecturer/
MULTICORE PROCESSOR TECHNOLOGY.  Introduction  history  Why multi-core ?  What do you mean by multicore?  Multi core architecture  Comparison of.
OpenMP for Networks of SMPs Y. Charlie Hu, Honghui Lu, Alan L. Cox, Willy Zwaenepoel ECE1747 – Parallel Programming Vicky Tsang.
Threaded Programming Lecture 1: Concepts. 2 Overview Shared memory systems Basic Concepts in Threaded Programming.
Computer Organization CS224 Fall 2012 Lesson 52. Introduction  Goal: connecting multiple computers to get higher performance l Multiprocessors l Scalability,
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 OS 1.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Parallel Computing Presented by Justin Reschke
SMP Basics KeyStone Training Multicore Applications Literature Number: SPRPxxx 1.
Concurrency and Performance Based on slides by Henri Casanova.
1/50 University of Turkish Aeronautical Association Computer Engineering Department Ceng 541 Introduction to Parallel Computing Dr. Tansel Dökeroğlu
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
08/23/2012CS4230 CS4230 Parallel Programming Lecture 2: Introduction to Parallel Algorithms Mary Hall August 23,
CPU (Central Processing Unit). The CPU is the brain of the computer. Sometimes referred to simply as the processor or central processor, the CPU is where.
INTRODUCTION TO HIGH PERFORMANCE COMPUTING AND TERMINOLOGY.
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
CPU Central Processing Unit
Parallel Programming By J. H. Wang May 2, 2017.
The University of Adelaide, School of Computer Science
Parallel Programming in C with MPI and OpenMP
L21: Putting it together: Tree Search (Ch. 6)
EE 193: Parallel Computing
CPU Central Processing Unit
Teaching Computing to GCSE
What is Parallel and Distributed computing?
CSCI1600: Embedded and Real Time Software
Chapter 4: Threads.
CPU Central Processing Unit
Chapter 4: Threads.
Dr. Tansel Dökeroğlu University of Turkish Aeronautical Association Computer Engineering Department Ceng 442 Introduction to Parallel.
Multithreaded Programming
Multithreading Why & How.
Chapter 4: Threads & Concurrency
Registers Today we’ll see some common sequential devices: counters and registers. They’re good examples of sequential analysis and design. They are also.
CSCI1600: Embedded and Real Time Software
Presentation transcript:

1 Chapter 1 Why Parallel Computing? An Introduction to Parallel Programming Peter Pacheco

2 Roadmap Why we need ever-increasing performance. Why we’re building parallel systems. Why we need to write parallel programs. How do we write parallel programs? What we’ll be doing. Concurrent, parallel, distributed!

3 Changing times From 1986 – 2002, microprocessors were speeding like a rocket, increasing in performance an average of 50% per year. Generally, improving performance by increasing clock speed. Since then, it’s dropped to about a 20% increase per year.

4 An intelligent solution Instead of designing and building faster microprocessors, put multiple processors on a single integrated circuit.

5 Now it’s up to the programmers Adding more processors doesn’t help much if programmers aren’t aware of them… … or don’t know how to use them. Serial programs don’t benefit from this approach (in most cases).

6 Why we need ever-increasing performance Computational power is increasing, but so are our computation problems and needs. Problems we never dreamed of have been solved because of past increases, such as decoding the human genome. More complex problems are still waiting to be solved.

7 Climate modeling

8 Protein folding

9 Drug discovery

10 Energy research

11 Data analysis

12 Why we’re building parallel systems Up to now, performance increases have been attributable to increasing density of transistors. But there are inherent problems.

13 A little physics lesson Smaller transistors = faster processors (shorter distance for electricity to travel; can’t have cycle speed faster than it takes for answer to flow out of circuits). Faster processors = increased power consumption. Increased power consumption = increased heat. Increased heat = unreliable processors.

14 Solution Move away from single-core systems to multicore processors. “core” = central processing unit (CPU) Introducing parallelism!!!

15 Why we need to write parallel programs Running multiple instances of a serial program often isn’t very useful. Think of running multiple instances of your favorite game. What you really want is for it to run faster.

16 Approaches to the serial problem Rewrite serial programs so that they’re parallel. Write translation programs that automatically convert serial programs into parallel programs. This is very difficult to do. Success has been limited.

17 More problems Some coding constructs can be recognized by an automatic program generator, and converted to a parallel construct. However, it’s likely that the result will be a very inefficient program. Sometimes the best parallel solution is to step back and devise an entirely new algorithm.

18 Example Compute n values and add them together. Serial solution:

19 Example (cont.) We have p cores, p much smaller than n. Each core performs a partial sum of approximately n/p values. Each core uses it’s own private variables and executes this block of code independently of the other cores.

20 Example (cont.) After each core completes execution of the code, there is a private variable my_sum containing the sum of the values computed by its calls to Compute_next_value. Once all the cores are done computing their private my_sum, they form a global sum by sending results to a designated “master” core which adds the final result

21 Example (cont.)

22 But wait! There’s a much better way to compute the global sum.

23 Better parallel algorithm Don’t make the master core do all the work. Share it among the other cores. Pair the cores so that core 0 adds its result with core 1’s result. Core 2 adds its result with core 3’s result, etc. Work with odd and even numbered pairs of cores.

24 Better parallel algorithm (cont.) Repeat the process now with only the evenly ranked cores. Core 0 adds result from core 2. Core 4 adds the result from core 6, etc. Now cores divisible by 4 repeat the process, and so forth, until core 0 has the final result.

25 Multiple cores forming a global sum

26 Analysis In the first example, the master core performs 7 receives and 7 additions. In the second example, the master core performs 3 receives and 3 additions. The improvement is more than a factor of 2!

27 Analysis (cont.) The difference is more dramatic with a larger number of cores. If we have 1000 cores: The first example would require the master to perform 999 receives and 999 additions. The second example would only require 10 receives and 10 additions. That’s an improvement of almost a factor of 100!

28 How do we write parallel programs? Task parallelism Partition various tasks of the problem among the cores. Data parallelism Partition the data used in solving the problem among the cores. Each core carries out similar operations on it’s part of the data.

29 Professor P 15 questions 300 exams

30 Professor P’s grading assistants Grader #1 Grader #2 Grader #3

31 Division of work – data parallelism Grader #1 Grader #2 Grader #3 100 exams

32 Division of work – task parallelism Grader #1 Grader #2 Grader #3 Questions Questions Questions

33 Division of work – data parallelism

34 Division of work – task parallelism Tasks 1) Receiving 2) Addition

35 Coordination Cores usually need to coordinate their work. Communication – one or more cores send their current partial sums to another core. Load balancing – share the work evenly among the cores so that one is not heavily loaded. Synchronization – because each core works at its own pace, make sure cores do not get too far ahead of the rest.

36 What we’ll be doing Learning to write programs that are explicitly parallel. Using the C language. Using three different extensions to C. Posix Threads (Pthreads) Message-Passing Interface (MPI) OpenMP (time permitting)

37 Type of parallel systems Shared-memory The cores can share access to the computer’s memory. Coordinate the cores by having them examine and update shared memory locations. Distributed-memory Each core has its own, private memory. The cores must communicate explicitly by sending messages across a network.

38 Type of parallel systems Shared-memoryDistributed-memory

39 Terminology Concurrent computing – a program is one in which multiple tasks can be in progress at any instant. Parallel computing – a program is one in which multiple tasks cooperate closely to solve a problem Distributed computing – a program may need to cooperate with other programs to solve a problem.

40 Concluding Remarks (1) The laws of physics have brought us to the doorstep of multicore technology. Serial programs typically don’t benefit from multiple cores. Automatic parallel program generation from serial program code isn’t the most efficient approach to get high performance from multicore computers.

41 Concluding Remarks (2) Learning to write parallel programs involves learning how to coordinate the cores. Parallel programs are usually very complex and therefore, require sound program techniques and development.