Docsity

Concurrency Mapping - Parallel Computing - Lecture Slides, Slides of Parallel Computing and Programming

Partial preview of the text

Download Concurrency Mapping - Parallel Computing - Lecture Slides and more Slides Parallel Computing and Programming in PDF only on Docsity!

Principles of Parallel

Algorithm Design:

Concurrency and Mapping

2

  • Introduction to parallel algorithms

—tasks and decomposition —processes and mapping —processes versus processors

  • Decomposition techniques - part 1

—recursive decomposition —data decomposition

4

Exploratory Decomposition

  • Exploration (search) of a state space of solutions

—problem decomposition reflects shape of execution

  • Examples —discrete optimization - 0/1 integer programming —theorem proving —game playing

5

Exploratory Decomposition Example

Solving a 15 puzzle

  • Sequence of three moves from state (a) to final state (d)
  • From an arbitrary state, must search for a solution

7

Exploratory Decomposition Speedup

  • Parallel formulation may perform a different amount of work
  • Can cause super- or sub-linear speedup

m m m m m m m m

total serial work = 2m + 1

total parallel work = 4

total serial work = m

total parallel work = 4m

solution

8

Speculative Decomposition

  • Dependencies between tasks are not always known^ a-priori

—makes it impossible to identify independent tasks

  • Conservative approach —identify independent tasks only when no dependencies left
  • Optimistic (speculative) approach —schedule tasks even when they may potentially be erroneous
  • Drawbacks for each

—conservative approaches

  • may yield little concurrency —optimistic approaches
  • may require a roll-back mechanism if a dependence is encountered

10

Hybrid Decomposition

Use multiple decomposition strategies together

Often necessary for adequate concurrency

  • Quicksort —recursive decomposition alone limits concurrency (why?)

—augmenting recursive with data decomposition is better

  • can use data decomposition on input data to compute a split
  • Discrete event simulation —data parallelism may be possible when processing a task

11

Topics for Today

  • Decomposition techniques - part 2 —exploratory decomposition —hybrid decomposition
  • Characteristics of tasks and interactions —task generation, granularity, and context —characteristics of task interactions
  • Mapping techniques for load balancing —static mappings —dynamic mappings
  • Methods for minimizing interaction overheads
  • Parallel algorithm design templates

☛

13

Task Generation

  • Static task generation —identify concurrent tasks a-priori —typically decompose using data or recursive decomposition —examples - matrix operations - graph algorithms - image processing applications - other regularly structured problems
  • Dynamic task generation —identify concurrent tasks as a computation unfolds —typically decompose using exploratory or speculative decompositions —examples - puzzle solving - game playing

14

Task Sizes

  • Uniform: all the same size
  • Non-uniform

—sometimes sizes known or can be estimated a-priori —sometimes not

  • example: tasks in quicksort size of each partition depends upon pivot selected

16

Characteristics of Task Interactions

Orthogonal classification criteria

  • Static vs. dynamic
  • Regular vs. irregular
  • Read-only vs. read-write
  • One-sided vs. two-sided

17

Characteristics of Task Interactions

  • Static interactions

—tasks and interactions are known a-priori —simpler to code

  • Dynamic interactions —timing or interacting tasks cannot be determined a-priori —harder to code - especially using two-sided message passing APIs

19

Static Regular Task Interaction Pattern

Image operations, e.g., edge detection

Nearest neighbor interactions on a 2D mesh

Sobel Edge Detection Stencils

20

Static Irregular Task Interaction Pattern

Sparse matrix-vector multiply