multi-core. what is parallel programming ? classification of parallel architectures dimension of...

19
Multi-core

Upload: nathaniel-mckinney

Post on 01-Jan-2016

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Multi-core

Page 2: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

What is parallel programming ? Classification of parallel architectures

Dimension of instruction Dimension of data

Memory models for parallel programming Distributed memory model Share memory model

Multi-core architectures Steps in parallelization

Jaruloj Chongstitvatana 2Parallel Programming: Introduction

Page 3: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

CONCURRENT

Two or more actions progress at the same time.

PARALLEL

Two or more actions execute simultaneously.

Jaruloj Chongstitvatana Parallel Programming: Introduction 3

How to write a program that can execute correctly on two proccesors or more.

Page 4: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Design considerations Correctness Efficiency Simplicity Scalability

Jaruloj Chongstitvatana Parallel Programming: Introduction 4

Page 5: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Single Instruction Single Data: SISD

Single Instruction Multiple Data: SIMD

Multiple Instruction Single Data: MISD

Multiple Instruction Multiple Data: MIMD

Jaruloj Chongstitvatana Parallel Programming: Introduction 5

Page 6: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

No parallelism

Jaruloj Chongstitvatana Parallel Programming: Introduction 6

Page 7: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Vector machine Graphic processors

Jaruloj Chongstitvatana Parallel Programming: Introduction 7

Page 8: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

No application (at this time)

Jaruloj Chongstitvatana Parallel Programming: Introduction 8

Page 9: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Multi-core architectures

Jaruloj Chongstitvatana Parallel Programming: Introduction 9

Page 10: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

SHARED MEMORY MODEL

Multiple processors connect to one shared memory.

All processors can access same memory locations.

DISTRIBUTED MEMORY MODEL

Each processor connects to its private memory.

Jaruloj Chongstitvatana Parallel Programming: Introduction 10

Page 11: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

SHARED MEMORY

Bottleneck for memory access

No data transfer

Easy for share data

DISTRIBUTED MEMORY

Better memory access

Data transfer from non-local memory

Easy for private data

Jaruloj Chongstitvatana Parallel Programming: Introduction 11

Page 12: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

AMD Multicore Opteron Sun UltraSparc T1 IBM Cell Broadband Engine (CBE) Intel Core2 Duo

Jaruloj Chongstitvatana Parallel Programming: Introduction 12

Page 13: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Jaruloj Chongstitvatana Parallel Programming: Introduction 13

Source: C. Hughes &T. Hughes, Professional Multicore Programming: Design and Implementation for C++ Developers, Wiley, 2008.

Page 14: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Jaruloj Chongstitvatana Parallel Programming: Introduction 14

Source: C. Hughes &T. Hughes, Professional Multicore Programming: Design and Implementation for C++ Developers, Wiley, 2008.

Page 15: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Jaruloj Chongstitvatana Parallel Programming: Introduction 15

Source: C. Hughes &T. Hughes, Professional Multicore Programming: Design and Implementation for C++ Developers, Wiley, 2008.

Page 16: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Jaruloj Chongstitvatana Parallel Programming: Introduction 16

Source: C. Hughes &T. Hughes, Professional Multicore Programming: Design and Implementation for C++ Developers, Wiley, 2008.

Page 17: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Jaruloj Chongstitvatana Parallel Programming: Introduction 17

Source: C. Hughes &T. Hughes, Professional Multicore Programming: Design and Implementation for C++ Developers, Wiley, 2008.

Page 18: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Starting from sequential code

Identify possible concurrency Design and implement Test for correctness Tuning for performance

May effect correctness If tuning is impossible, consider redesign

Jaruloj Chongstitvatana Parallel Programming: Introduction 18

Page 19: Multi-core.  What is parallel programming ?  Classification of parallel architectures  Dimension of instruction  Dimension of data  Memory models

Data race Deadlock

Notes: Results might be slightly different for each

run due to round-off error for different sequence of operations.

Jaruloj Chongstitvatana Parallel Programming: Introduction 19