1 Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 Parallel Hardware and Parallel Software An Introduction to Parallel Programming Peter Pacheco.

Slides:



Advertisements
Similar presentations
1 Lecture 13: Cache and Virtual Memroy Review Cache optimization approaches, cache miss classification, Adapted from UCB CS252 S01.
Advertisements

Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Chapter 5 Computing Components. The (META) BIG IDEA Cool, idea but maybe too big DATA – Must be stored somewhere in a storage device PROCESSING – Data.
1 Copyright © 2012, Elsevier Inc. All rights reserved. Chapter 2 (and Appendix B) Memory Hierarchy Design Computer Architecture A Quantitative Approach,
Computer Systems. Computer System Components Computer Networks.
CSCE 212 Chapter 7 Memory Hierarchy Instructor: Jason D. Bakos.
1 Lecture 20 – Caching and Virtual Memory  2004 Morgan Kaufmann Publishers Lecture 20 Caches and Virtual Memory.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Memory Organization.
MEMORY MANAGEMENT By KUNAL KADAKIA RISHIT SHAH. Memory Memory is a large array of words or bytes, each with its own address. It is a repository of quickly.
Overview: Memory Memory Organization: General Issues (Hardware) –Objectives in Memory Design –Memory Types –Memory Hierarchies Memory Management (Software.
GCSE Computing - The CPU
What’s on the Motherboard? The two main parts of the CPU are the control unit and the arithmetic logic unit. The control unit retrieves instructions from.
Basic Operational Concepts of a Computer
Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Computer Organization Computer Organization & Assembly Language: Module 2.
Computer Systems 1 Fundamentals of Computing The CPU & Von Neumann.
Invitation to Computer Science 5th Edition
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
CS 1308 Computer Literacy and the Internet. Introduction  Von Neumann computer  “Naked machine”  Hardware without any helpful user-oriented features.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
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.
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
Advanced Computer Architecture 0 Lecture # 1 Introduction by Husnain Sherazi.
The variety Of Processors And Computational Engines CS – 355 Chapter- 4 `
5-1 Computer Components Consider the following ad.
Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
The Central Processing Unit (CPU) and the Machine Cycle.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
Chapter 5 Computing Components. 5-2 Chapter Goals List the components and their function in a von Neumann machine Describe the fetch-decode-execute cycle.
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
Chapter 2 Data Manipulation. © 2005 Pearson Addison-Wesley. All rights reserved 2-2 Chapter 2: Data Manipulation 2.1 Computer Architecture 2.2 Machine.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
CS 1308 Computer Literacy and the Internet. Objectives In this chapter, you will learn about:  The components of a computer system  Putting all the.
CENTRAL PROCESSING UNIT. CPU Does the actual processing in the computer. A single chip called a microprocessor. Composed of an arithmetic and logic unit.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  What Operating Systems Do  Computer-System Organization  Computer-System Architecture  Operating-System Structure.
Lecture on Central Process Unit (CPU)
1 Chapter 2 Parallel Hardware and Parallel Software An Introduction to Parallel Programming.
Von Neumann Computers Article Authors: Rudolf Eigenman & David Lilja
The Central Processing Unit (CPU)
Lecture 3 CSS314 Parallel Computing Book: “An Introduction to Parallel Programming” by Peter Pacheco PhD, Bogdanchikov.
CS4315A. Berrached:CMS:UHD1 Introduction to Operating Systems Chapter 1.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
M211 – Central Processing Unit
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 2: IA-32 Processor Architecture (c) Pearson Education, All rights reserved. You.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
Software Design and Development Computer Architecture Computing Science.
Chapter 3 Getting Started. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To give an overview of the structure of a contemporary.
Computer Architecture Lecture 25 Fasih ur Rehman.
Chapter 1 Introduction.
Chapter Overview General Concepts IA-32 Processor Architecture
GCSE Computing - The CPU
Computer Organization and Architecture Lecture 1 : Introduction
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Memory COMPUTER ARCHITECTURE
Assembly Language for Intel-Based Computers, 5th Edition
Architecture Background
IB Computer Science Topic 2.1.1
Teaching Computing to GCSE
Functional Units.
Chapter 5: Computer Systems Organization
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
The University of Adelaide, School of Computer Science
1-2 – Central Processing Unit
Chapter 2 Operating System Overview
GCSE Computing - The CPU
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Presentation transcript:

1 Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 Parallel Hardware and Parallel Software An Introduction to Parallel Programming Peter Pacheco

2 Copyright © 2010, Elsevier Inc. All rights Reserved Roadmap Some background Modifications to the von Neumann model Parallel hardware Parallel software Input and output Performance Parallel program design Writing and running parallel programs Assumptions # Chapter Subtitle

3 SOME BACKGROUND Copyright © 2010, Elsevier Inc. All rights Reserved

4 Serial hardware and software Copyright © 2010, Elsevier Inc. All rights Reserved input output programs Computer runs one program at a time.

5 Copyright © 2010, Elsevier Inc. All rights Reserved The von Neumann Architecture # Chapter Subtitle Figure 2.1

6 Main memory This is a collection of locations, each of which is capable of storing both instructions and data. Every location consists of an address, which is used to access the location, and the contents of the location. Copyright © 2010, Elsevier Inc. All rights Reserved

7 Central processing unit (CPU) Divided into two parts. Control unit - responsible for deciding which instruction in a program should be executed. (the boss) Arithmetic and logic unit (ALU) - responsible for executing the actual instructions. (the worker) Copyright © 2010, Elsevier Inc. All rights Reserved add 2+2

8 Key terms Register – very fast storage, part of the CPU. Program counter – stores address of the next instruction to be executed. Bus – wires and hardware that connects the CPU and memory. Copyright © 2010, Elsevier Inc. All rights Reserved

9 memory CPU fetch/read

10 Copyright © 2010, Elsevier Inc. All rights Reserved memory CPU write/store

11 von Neumann bottleneck Copyright © 2010, Elsevier Inc. All rights Reserved

12 An operating system “process” An instance of a computer program that is being executed. Components of a process: The executable machine language program. A block of memory. Descriptors of resources the OS has allocated to the process. Security information. Information about the state of the process. Copyright © 2010, Elsevier Inc. All rights Reserved

13 Multitasking Gives the illusion that a single processor system is running multiple programs simultaneously. Each process takes turns running. (time slice) After its time is up, it waits until it has a turn again. (blocks) Copyright © 2010, Elsevier Inc. All rights Reserved

14 Threading Threads are contained within processes. They allow programmers to divide their programs into (more or less) independent tasks. The hope is that when one thread blocks because it is waiting on a resource, another will have work to do and can run. Copyright © 2010, Elsevier Inc. All rights Reserved

15 A process and two threads Copyright © 2010, Elsevier Inc. All rights Reserved Figure 2.2 the “master” thread starting a thread Is called forking terminating a thread Is called joining

16 MODIFICATIONS TO THE VON NEUMANN MODEL Copyright © 2010, Elsevier Inc. All rights Reserved

17 Basics of caching A collection of memory locations that can be accessed in less time than some other memory locations. A CPU cache is typically located on the same chip, or one that can be accessed much faster than ordinary memory. Copyright © 2010, Elsevier Inc. All rights Reserved

18 Principle of locality Accessing one location is followed by an access of a nearby location. Spatial locality – accessing a nearby location. Temporal locality – accessing in the near future. Copyright © 2010, Elsevier Inc. All rights Reserved

19 Principle of locality Copyright © 2010, Elsevier Inc. All rights Reserved float z[1000]; … sum = 0.0; for (i = 0; i < 1000; i++) sum += z[i];

20 Levels of Cache Copyright © 2010, Elsevier Inc. All rights Reserved L1 L2 L3 smallest & fastest largest & slowest

21 Cache hit Copyright © 2010, Elsevier Inc. All rights Reserved L1 L2 L3 x sum y z total A[ ] radius r1 center fetch x

22 Cache miss Copyright © 2010, Elsevier Inc. All rights Reserved L1 L2 L3 y sum r1 z total A[ ] radius center fetch x x main memory

23 Issues with cache When a CPU writes data to cache, the value in cache may be inconsistent with the value in main memory. Write-through caches handle this by updating the data in main memory at the time it is written to cache. Write-back caches mark data in the cache as dirty. When the cache line is replaced by a new cache line from memory, the dirty line is written to memory. Copyright © 2010, Elsevier Inc. All rights Reserved

24 Virtual memory (1) If we run a very large program or a program that accesses very large data sets, all of the instructions and data may not fit into main memory. Virtual memory functions as a cache for secondary storage. Copyright © 2010, Elsevier Inc. All rights Reserved

25 Virtual memory (2) It exploits the principle of spatial and temporal locality. It only keeps the active parts of running programs in main memory. Copyright © 2010, Elsevier Inc. All rights Reserved

26 Virtual memory (3) Swap space - those parts that are idle are kept in a block of secondary storage. Pages – blocks of data and instructions. Usually these are relatively large. Most systems have a fixed page size that currently ranges from 4 to 16 kilobytes. Copyright © 2010, Elsevier Inc. All rights Reserved