32
1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. - Anonymous

1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

  • View
    217

  • Download
    2

Embed Size (px)

Citation preview

Page 1: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

1

Friday, September 29, 2006

If all you have is a hammer, then everything looks like

a nail.

- Anonymous

Page 2: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

2

Domain Decomposition1. Divide data in approx. equal parts

2. Partition the computation

Functional Decomposition1. Divide the computation into disjoint tasks

2. Determine data requirements of these tasks

Page 3: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

3

Domain Decomposition1. Divide data in approx. equal parts

2. Partition the computation

Functional Decomposition1. Divide the computation into disjoint tasks

2. Determine data requirements of these tasks If data is disjoint then partition is complete If there is significant overlap consider

domain decomposition.

Page 4: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

4

Task dependency graph?

Page 5: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

5

Typically maximum degree of concurrency is less than the total number of tasks.

Page 6: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

6

Typically maximum degree of concurrency is less than the total number of tasks.

Degree of concurrency depends on shape of task dependency graph.

Page 7: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

7

Degree of concurrency depends on shape of task dependency graph.

Page 8: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

8

Mapping

Maximize use of concurrency.Task dependencies and interactions are

important in selection of good mapping.Minimize completion time by making

sure that the processes on critical path execute as soon as they are ready.

Page 9: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

9

Mapping

Maximize concurrency and minimize interaction among processors Place tasks that are able to execute

independently on different processors to increase concurrency.

Place tasks that communicate frequently on same processor to increase locality.

Page 10: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

10

Mapping

Cannot use more than 4 processors. Why?

Page 11: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

11

Mapping

Prevent inter-task interaction from becoming inter-process interaction

Page 12: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

12

Agglomeration

Page 13: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

13

Data partitioning: Block distribution

Higher dimensional distributions may help reduce the amount of shared data that needs to be accessed

Page 14: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

14

Data partitioning: Block distribution

Higher dimensional distributions may help reduce the amount of shared data that needs to be accessed.

n2/p +n2 vs.

2n2/√p

Page 15: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

15

Sum N numbers

N numbers are distributed among N tasks

Centralized algorithm

Page 16: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

16

Sum N numbers

N numbers are distributed among N tasks

Distributing computation

Page 17: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

17

Recursive Decomposition

Divide and conquerSet of independent sub-problems

Page 18: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

18

Recursive Decomposition

Sum N numbers.

How many steps required?

Page 19: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

19

Page 20: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

20

Page 21: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

21

Hybrid decomposition

Possible to combine different techniquesFinding minimum of a large set of

numbers by purely recursive decomposition is not efficient.

Page 22: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

22

Hybrid decomposition

Page 23: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

23

Exploratory Decomposition

Page 24: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

24

Unfinished tasks can be terminated once solution is found

Page 25: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

25

Page 26: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

26

Read: Speculative Decomposition

Page 27: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

27

Communications

Most parallel problems need to communicate data between different tasks.

Page 28: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

28

Embarrassingly Parallel Applications

No communication between tasks.One end of spectrum of parallelization

Examples?

Page 29: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

29

Factors involving communication

Machine cycles and resources that could be used for computation are instead used to package and transmit data.

Sending many small messages can cause latency to dominate communication overheads.

Package small messages into a larger message results in increased bandwidth.

Page 30: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

30

Factors involving communicationSynchronous communications.

Asynchronous communications.

Interleaving computation with communication.

Page 31: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

31

npoints = 10000

circle_count = 0

do j = 1,npoints

generate 2 random numbers between 0 and 1

xcoordinate = random1 ; ycoordinate = random2 ;

if (xcoordinate, ycoordinate) inside circle then circle_count = circle_count + 1

end do

PI = 4.0*circle_count/npoints

Page 32: 1 Friday, September 29, 2006 If all you have is a hammer, then everything looks like a nail. -Anonymous

32