Lecture 5 Principles of Parallel Algorithm Design
Lecture 5 Principles of Parallel Algorithm Design
Multithreaded:
for (row = 0; row < n; row++)
for (column = 0; column < n; column++)
c[row][column] = create_thread( dot_product(get_row(a, row),
get_col(b, col)));
Task Dependency Graph
• The tasks in the previous examples are independent and
can be performed in any sequence.
• In most of the problems, there exist some sort of
dependencies between the tasks.
• An abstraction used to express such dependencies among
tasks and their relative order of execution is known as a
task-dependency graph.
Task Dependency Graph (Cont.)
• “It is a directed acyclic graph in which node are tasks and
the directed edges indicate the dependencies between
them”
• The task corresponding to a node can be executed when all
tasks connected to this node by incoming edges have
completed.
Some tasks may use data produced by other tasks and thus may need to
wait for these tasks to finish execution
Database Query
• Rule of thumb: For task-dependency graphs that are trees, the maximum
degree of concurrency is always equal to the number of leaves in the
tree
Maximum Degree of Concurrency (Cont.)
• Determine Maximum Degree of Concurrency?
Average Degree of Concurrency
• A relatively better measure for the performance of a parallel
program