Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Douglas Comer
Computer Science Department
Purdue University
250 N. University Street
West Lafayette, IN 47907-2066
http://www.cs.purdue.edu/people/comer
Copyright 2006. All rights reserved. This document may not
be reproduced by any means without written consent of the author.
XVII
Parallelism
CS250 -- Chapt. 17
2006
CS250 -- Chapt. 17
2006
Parallelism
d Multiple copies of hardware unit used
d All copies can operate simultaneously
d Occurs at many levels of architecture
d Term parallel computer applied when parallelism dominates
entire architecture
CS250 -- Chapt. 17
2006
Characterizations Of Parallelism
d Microscopic vs. macroscopic
d Symmetric vs. asymmetric
d Fine-grain vs. coarse-grain
d Explicit vs. implicit
CS250 -- Chapt. 17
2006
CS250 -- Chapt. 17
2006
CS250 -- Chapt. 17
2006
d Asymmetric parallelism
CS250 -- Chapt. 17
2006
Level Of Parallelism
d Fine-grain
d Coarse-grain parallelism
CS250 -- Chapt. 17
2006
Visible to programmer
d Implicit
Invisible to programmer
CS250 -- Chapt. 17
2006
Parallel Architectures
d Design in which computer has reasonably large number of
processors
d Intended for scaling
d Example: computer with thirty-two processors
d Not generally classified as parallel computer
CS250 -- Chapt. 17
10
2006
Name
Meaning
22222222222222222222222222222222222222222222222222
SISD
Single Instruction Single Data stream
SIMD
Single Instruction Multiple Data streams
MIMD
Multiple Instructions Multiple Data streams
CS250 -- Chapt. 17
11
2006
Sequential architecture
Uniprocessor
CS250 -- Chapt. 17
12
2006
CS250 -- Chapt. 17
13
2006
Vector Processor
d Uses SIMD architecture
d Applies a single floating point operation to an entire array of
values
d Example use: normalize values in a set
CS250 -- Chapt. 17
14
2006
CS250 -- Chapt. 17
15
2006
CS250 -- Chapt. 17
16
2006
Graphics Processors
d Graphics hardware uses sequential bytes in memory to store
pixels
d To move a window, software copies bytes
d SIMD architecture allows copies in parallel
CS250 -- Chapt. 17
17
2006
CS250 -- Chapt. 17
18
2006
CS250 -- Chapt. 17
19
2006
CS250 -- Chapt. 17
20
2006
P1
Main
Memory
(various
modules)
P2
Pi+1
Pi+2
Devices
Pi
CS250 -- Chapt. 17
PN
21
2006
CS250 -- Chapt. 17
22
2006
Special-purpose processor
d I/O Processor
Programmable
CS250 -- Chapt. 17
23
2006
CS250 -- Chapt. 17
24
2006
Multiprocessor Overhead
d Having many processors is not always a clear win
d Overhead arises from
Communication
Coordination
Contention
CS250 -- Chapt. 17
25
2006
Communication
d Needed
Among processors
CS250 -- Chapt. 17
26
2006
Coordination
d Needed when processors work together
d May require one processor to coordinate others
CS250 -- Chapt. 17
27
2006
Contention
d Processors contend for resources
Memory
I/O devices
CS250 -- Chapt. 17
28
2006
Performance Of Multiprocessors
d Disappointing
d Bottlenecks
CS250 -- Chapt. 17
29
2006
CS250 -- Chapt. 17
30
2006
Definition Of Speedup
d Defined relative to single processor
1
333
Speedup =
N
d 1 denotes the execution time on a single processor
d N denotes the execution time on a multiprocessor
d Goal: speedup is linear in number of processors
CS250 -- Chapt. 17
31
2006
Speedup
16
ideal
12
actual
8
1
1
12
16
CS250 -- Chapt. 17
32
2006
Speedup
32
24
ideal
16
actual
8
1
1
CS250 -- Chapt. 17
16
Number of processors (N)
33
24
32
2006
Summary Of Speedup
CS250 -- Chapt. 17
34
2006
CS250 -- Chapt. 17
35
2006
d Typical code is
load x, R5
incr R5
store R5, x
CS250 -- Chapt. 17
36
2006
CS250 -- Chapt. 17
37
2006
Hardware Locks
d Prevent simultaneous access
d Separate lock assigned to each item
d Code is
lock 17
load x, R5
incr R5
store R5, x
release 17
CS250 -- Chapt. 17
38
2006
d Explicit parallelism
CS250 -- Chapt. 17
39
2006
CS250 -- Chapt. 17
40
2006
CS250 -- Chapt. 17
41
2006
CS250 -- Chapt. 17
42
2006
CS250 -- Chapt. 17
43
2006
Cluster Computer
d Distributed computer system
d All computers work on a single problem
d Works best if problem can be partitioned into pieces
CS250 -- Chapt. 17
44
2006
Grid Computing
d Form of loosely-coupled distributed computing
d Uses computers on the Internet
d Popular for large, scientific computations
CS250 -- Chapt. 17
45
2006
Summary
d Parallelism is a fundamental optimization
d Computers classified as
CS250 -- Chapt. 17
46
2006
Summary
(continued)
d Multiprocessors can be
Symmetric or asymmetric
CS250 -- Chapt. 17
47
2006
Questions?