Parallel Sorting Flashcards

1
Q

What is the best sequential comparison-based sorting algorithm running time?

A

O(nlogn)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between a compare exchange operation and a compare split operation?

A

Compare split contains more than one element per processor with each of the two processors have n/p elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the computational cost of performing a compare split operation when processors contain sub-arrays of size n/p?

A

ts + (tw * n / p)

ts = comparison time
tw = data transfer time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can we parallelize divide-and-conquer-based sorting algorithms using functional decomposition?
Is functional decomposition sufficient to obtain an efficient comparison-based parallel sorting algorithm?

A

By dividing the problem into smaller independent subproblems thru functional decomposition, we can parallelize these independent sections to achieve faster execution times.

We need data decomposition because data is always distributed and won’t be on one processor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The bitonic sort is a parallel version of which divide and conquer sorting algorithm?

A

Merge Sort

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How is the merge step implemented in the bitonic sort?
Is there merge also parallelized?

A

Bitonic sort recursively split the input into halves and then repeatedly performs bitonic merging operations to combine them until all is sorted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are sorting networks?
How can they be used to define sorting algorithms?

A

Networks of comparators designed for sorting.

Used to order which comparisons and exchanges are performed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an increasing comparator? How is it implemented?

A

compares two elements and orders them in increasing order.

Used for increasing tones for bitonic sequences.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In the bitonic sorting algorithm, why do we need both increasing and decreasing comparator elements in the sorting network?

A

To perform compare and exchange operations using the sorting process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the definition of a bitonic sequence?

A

A sequence of increasing and then decreasing elements (or vice versa) with no repetitions in pattern.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What happens to a bitonic sequence when we perform a bitonic split?

A

The sequence is divided into two smaller bitonic sequences to be sorted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does a bitonic merging network do to a bitonic sequence?

A

Merge two bitonic sequences into a single bitonic sequence.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the depth of a bitonic sorting network that can sort a sequence of size 2^n.

A

log2(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the cost of a serial bitonic sorting algorithm when applied to a sequence of size n?

A

O(n log2 n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If we want to sort n numbers on p processors with n-p elements per processor, what is the depth of the bitonic sorting network that would be used to sort this sequence?

What operations do the elements of this bitonic sorting network represent?

A

Depth: O(log2 n)

n/2 comparators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In a bitonic sorting algorithm for n numbers on p processors, we will use a serial sort to sort n/p elements.

Is this sort performed at the beginning or the end of the parallel sorting algorithm? Why does it need to be performed at this time?

A

In the beginning

Used to locally sort each on each processor before they combine into parallel phases.

17
Q

Be able to state the parallel running time of the bitonic sort of n numbers on p processors

A

Tp = O(n/plogn/p) + O(n/plog2p) + O(n/plog2p)
Tp = Local sort + comparisons + communication

18
Q

Is bubble sort as it is typically implemented in serial easily parallelized? Why or why not?

A

Is difficult to parallelize since the algorithm has no concurrency.

19
Q

What is the odd-even transposition sort? Is this sort parallelizable?

A

Repeatedly compares odd and even indices until sorted
Yes, it’s parallelizable

20
Q

What is the serial complexity of the odd-even transposition sort?

A

O(n^2)

21
Q

When using the odd-even transposition sort with n/p elements per processor, what base operation is used to define the algorithm?

A

The first step is a local sort with O(n/p log n/p)

22
Q

What are the comparison and communication costs of the parallel odd-even transposition sort?

A

Comparisons and Communications are both O(n).

23
Q

Where are most of the computational time spent in the serial quicksort algorithm?

A

Partitioning each subproblem

24
Q

A scalable parallel quicksort algorithm requires both functional decomposition and data decomposition.
Be able to explain how both of these parallel decomposition techniques are used in the parallel quicksort.

A

Functional Decomposition: Divides problem into smaller, independent subproblems that can be solved in parallel.

Data Decomposition: Divides input data into small chunks that can be processed in parallel.

25
Q

Given a pivot in an array of numbers, how does one partition the array using multiple processors executing in parallel?

A

Once an array has been divided by its pivot, we can work on the subarrays independently.

26
Q

In the global rearrangement phase of the array splitting step, what parallel algorithm needs to be performed to determine where to store the split sub-arrays into the global array?

A
27
Q

Why is the performance of the parallel quick sort algorithm more sensitive to pivot selection than the serial algorithm?

A

Because picking a bad pivot will lead to load imbalance which lowers parallel efficiency.

28
Q

What is the bucket sort algorithm and under what conditions can it produce a O(n) serial sorting algorithm?

A

Numbers are divided into m equal sized intervals with then each bucket sorted independently.

When data is even distributed among the buckets.

29
Q

How can we parallelize the bucket sort algorithm?

A

Have p processors each do a bucket from m buckets.

30
Q

How is the sample sort a generalization of the bucket sort algorithm?

A

The sample uses a set of splitters instead of using an algebraic method, making the cost increase to n log n.

31
Q

How are splitters selected in the parallel sample sort?

A

Picking the medians of the medians.

32
Q

What are the possible methods of sorting the sample in the parallel sample sort algorithm?

A
33
Q

How are the sample sort and the quick sort related?

A