1 meshes of trees (mot) and applications in integer arithmetic panagiotis voulgaris petros mol...

19
1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

Upload: zoe-lamb

Post on 17-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

1

Meshes of Trees (MoT) and Applications in Integer Arithmetic

Panagiotis VoulgarisPetros Mol

Course: Parallel Algorithms

Page 2: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

2

Outline of the talk

The two-Dimensional Mesh of Trees• Definitions• Properties• Variations

Integer Arithmetic Applications• Multiplication• Division• Powering• Root Finding

Page 3: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

3

Definition

Construction:

N N gridMesh of Trees

23 2N N Nodes

Page 4: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

4

Properties

1)Diameter (maximum distance between any pair of processors): 4logN

Proof

u

v

Case 1: u belongs to a row tree and v to a column tree

Dist<=2logN +2logN

v

u

Page 5: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

5

Properties (cont.)

Case 2:u,v belong only to row trees (or only to column trees)

v

u

v u

u

Dist=logN –r +2logN + logN + s<=4logNsince r>=s

Page 6: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

6

Properties (cont)

Thus meshes of trees enjoy both small diameter and large bisection width.

This fact makes them a more efficient structure than arrays and simple trees

2)Bisection Width(the minimum number of wires that have to be removed in order to disconnect the network into two halves with “almost” identical number of processors) :N

(Proof omitted)

Page 7: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

7

Recursive Decomposition

N N Mesh of trees 2 2

N NFour disjoint copies of Mesh of trees

Importance: This property makes mesh of trees appropriate for recursive algorithms for parallel computation

Page 8: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

8

“Ideal” Parallel Computer

P+MP+M P+MP+M

P+MP+M P+MP+M

P+MP+M

P+MP+M

P+MP+M

P+MP+M

P: Processor

M: Memory

Every processor is linked to every other processor.

Advantage: Speed !!

Drawback: Cost

Page 9: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

9

“Ideal” Parallel Computer…

PP

PP

PP

PP

MM

MM

MM

MM

Process/Memory separation

Again here the degree of each node becomes large as the number of processor increases

Idea: Why not “simulate” the complete bipartite graph?

Every Processor has direct access to a memory register

Page 10: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

10

“Ideal” Parallel Computer

Page 11: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

11

“Ideal” Parallel Computer

Page 12: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

12

“Ideal” Parallel Computer

Page 13: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

13

Benefits and Drawbacks

+Simulation of any step of in 2logN steps

,N NK

,N NK

+Bounded degree graph with essentially the computational power as

+We have actually constructed the NxN mesh of Trees

- The mesh of Trees has nearly nodes whereas the initial complete bipartite graph had only 2NSolution: Later

23N

Page 14: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

14

Back

Transformation to mesh of Trees

Page 15: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

15

Variations

1)

Page 16: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

16

Variations (cont)

Page 17: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

17

Variations (cont)

2)

Page 18: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

18

Variations (cont.)

3)

Page 19: 1 Meshes of Trees (MoT) and Applications in Integer Arithmetic Panagiotis Voulgaris Petros Mol Course: Parallel Algorithms

19

Variations (cont.)

4)