Multi-Pass Parallel Algorithms
Resolving data dependencies by precomputing subproblems.
Kevin Lin, with thanks to many others.
1
Parallel Prefix Count Greater Than 10
2
Q
6
4
16
10
16
14
2
8
arr
Q1: Fill in the up pass and down pass for parallel prefix count-of-items-greater-than-10.
Parallel Prefix Count Greater Than 10
3
A
6
4
16
10
16
14
2
8
arr
Compare and Contrast
Compare and contrast these three problems and describe a parallel algorithm for each one.
Return an int total count of integers in the input array greater than 10.
Return an int[] of prefix counts of integers in the input array greater than 10.
Return an int[] of only integers in the input array greater than 10 in the input order.
4
Q
Compare and contrast these three problems and describe a parallel algorithm for each one.
Q1: Return an int total count of integers in the input array greater than 10.
Q2: Return an int[] of prefix counts of integers in the input array greater than 10.
Q3: Return an int[] of only integers in the input array greater than 10 in the input order.
Compare and Contrast
Return an int total count of integers in the input array greater than 10.
Return an int[] of prefix counts of integers in the input array greater than 10.
Return an int[] of only integers in the input array greater than 10 in the input order.
5
A
Expand
Describe a parallel algorithm for expand, which takes an int[] and returns an int[] where each item a[x] appears a[x] times in the input order.
6
Q
Q1: Describe a parallel algorithm for expand, which takes an int[] and returns an int[] where each item a[x] appears a[x] times in the input order.
Expand
Describe a parallel algorithm for expand, which takes an int[] and returns an int[] where each item a[x] appears a[x] times in the input order.
7
A
Weird Parallel Merge
Say we pick the median from the smaller sorted array and run binary search to find the split point in the larger sorted array. Give a recurrence for the worst-case span of parallel merge.
8
Q
Q1: Say we pick the median from the smaller sorted array and run binary search to find the split point in the larger sorted array. Give a recurrence for the worst-case span of parallel merge.
Weird Parallel Merge
Say we pick the median from the smaller sorted array and run binary search to find the split point in the larger sorted array. Give a recurrence for the worst-case span of parallel merge.
9
A