Docsity

Principles of Parallel Algorthm Design-Parallel Computing-Lecture Slides, Slides of Parallel Computing and Programming

Partial preview of the text

Download Principles of Parallel Algorthm Design-Parallel Computing-Lecture Slides and more Slides Parallel Computing and Programming in PDF only on Docsity!

Dr. Hanif Durad

Lecture Outline (1/3)

^

Introduction to Parallel Algorithms^ ^

Tasks and Decomposition  Processes and Mapping  Processes Versus Processors

^

Decomposition Techniques^ ^

Recursive Decomposition  Recursive Decomposition  Exploratory Decomposition  Hybrid Decomposition

Dr. Hanif Durad

Lecture Outline (2/3)

^

Characteristics of Tasks and Interactions^ ^

Task Generation, Granularity, and Context  Characteristics of Task Interactions

^

Mapping Techniques for Load Balancing ^ Static and Dynamic Mapping

3.1 PreliminariesDecomposition, Tasks, and

Dependency Graphs

3.1.1.1 Decomposition

^

The process of dividing a computation into smallerparts, some or all of which may potentially be executedin parallel,

^

Tasks

are programmer-defined units of computation into

which the main computation is subdivided by means ofdecomposition.

^

Simultaneous execution of multiple tasks is the key toreducing the time required to solve the entire problem.

^

Tasks can be of arbitrary size, but once defined, they areregarded as indivisible units of computation.

^

The tasks into which a problem is decomposed may notall be of the same size.

Dr. Hanif Durad

Example 3.1: Multiplying a Dense

Matrix with a Vector (1/2)

b^

y

A

n

Task 1 Task n

2 n-

n x n

n x 1

n x 1

n =

3.1.1.2 Tasks DependencyGraphs

^

Some tasks may use data produced by other tasks and thus may needto wait for these tasks to finish execution.

^

It is an abstraction used to express such dependencies among tasksand their relative order of execution^ ^

A task-dependency graph is a directed acyclic graph in which the nodesrepresent tasks and the directed edges indicate the dependencies amongst them

^ The task corresponding to a node can be executed when all tasks connected tothis node by incoming edges have completed. ^ Task-dependency graphs can be disconnected & the edge-set of a task-dependency graph can be empty.

^ The case for matrix-vector x, where each task computes a subset of the entries ofthe product vector.

^

The nodes with no incoming edges are start nodes and the nodeswith no outgoing edges are finish nodes.

Dr. Hanif Durad

ID#

Model

Year

Color

Dealer

Price

4523 Civic

Blue

MN

3476 Corolla

White

IL^

7623 Camry

Green

NY

9834 Prius

Green

CA

6734 Civic

White

OR

5342 Altima

Green

FL

3845 Maxima

Blue

NY

8354 Accord

Green

VT

4395 Civic

Red

CA

7352 Civic

Red

WA

Dr. Hanif Durad

Example: Database QueryProcessing (3/9)

^

The execution of the query can be divided intosubtasks in various ways. Each task can bethought of as generating an intermediate tableof entries that satisfy a particular clause.

Dr. Hanif Durad

Example: Database QueryProcessing (5/9)

^

Note that the same problem can bedecomposed into subtasks in other ways aswell

Dr. Hanif Durad

2001 AND (White or Green)
Green
Civic Civic AND 2001 AND (White OR Green)
White
White OR Green

Civic

White

ID#
Model
Year
Color
ColorWhiteWhite
ID#

WhiteGreenGreenWhiteGreenGreen

ID#
Color

GreenGreen

ID# 76236734534238454395
Year

Green

White

Green

ID#
Year
Color

Green 5342

Green

ID#
Color

CivicCivicCivicCivic

ID#
Model

An alternate decomposition of the given problem into subtasks, alongwith their data dependencies

Dr. Hanif Durad

2001 AND (White or Green)
Green
Civic Civic AND 2001 AND (White OR Green)
White
White OR Green

Civic

White

ID#
Model
Year
Color
ColorWhiteWhite
ID#

WhiteGreenGreenWhiteGreenGreen

ID#
Color

GreenGreen

ID# 76236734534238454395
Year

Green

White

Green

ID#
Year
Color

Green 5342

Green

ID#
Color

CivicCivicCivicCivic

ID#
Model

An alternate decomposition of the given problem into subtasks,along with their data dependencies

Dr. Hanif Durad

Example: Database QueryProcessing (9/9)

^

Different task decompositions may lead tosignificant differences with respect to theireventual parallel performance.

Dr. Hanif Durad

n

1 0

A^

y

b

...

Task 1Task 2Task 3Task 4^ A coarse grained

counterpart to the dense matrix-vector product

example. Each task in this example corresponds to the computationof^

three

elements of the result vector.

n/3 =

Dr. Hanif Durad

3.1.2.3 Maximum degree ofconcurrency

^

Maximum no. of tasks executed simultaneously in aparallel program at any given time.

^

It is usually less than the total no. tasks due todependencies among the tasks.

^

Ex.: for task-dependency graphs that are trees, equal tothe no. leaves in the tree.

^

What is the maximum degree of concurrency of thedatabase query examples?

Ans= 4