parallel sorting by regular sampling

12
Parallel Sorting by Regular Sampling [email protected] Wednesday, June 27, 12

Upload: wei-mu

Post on 15-Jul-2015

84 views

Category:

Technology


0 download

TRANSCRIPT

Parallel Sorting by Regular Sampling

[email protected]

Wednesday, June 27, 12

Speedup of Parallel Sort

• Average memory latency 

• Overhead of scheduling and synchronization

Wednesday, June 27, 12

Traditional Parallel SortMost parallel sorts suitable for multiprocessor computers can be placed into one of two rough categories: 

• Merge-based sorts

• Partition-based sorts

Wednesday, June 27, 12

Merge-based sorts

• Consist of multiple merge stages across processors, and perform well only with a small number of processors

• More larger the number of processors utilized gets , more larger the overhead of scheduling and synchronization hit

Wednesday, June 27, 12

Partition-based sorts

• Partitioning the data set into smaller subsets such that all elements in one subset are no greater than any element in another

• Sorting each subset in parallel

• The performance of partition-based sorts primarily depends on how well the data can be evenly partitioned into smaller ordered subsets

Wednesday, June 27, 12

PSRS

• Data distribution is unkown

• Find pivots for partitioning data

Wednesday, June 27, 12

PSRS:Phase 1• Each of p processors sorts a contiguous list

of size w=n/p using sequential Quicksort

• Define the regular sample of the locally ordered X be a set of the following p(p - 1 ) elements

Wednesday, June 27, 12

PSRS:Phase 2• Regular sample set, Y, is sorted using

sequential Quicksort

• Choose (p-1) pivots for partitioning X

• Each processor finds where each of the (p - 1) pivots divides its list, using a binary search.

Wednesday, June 27, 12

PSRS:Phase 3

• Each processor i performs a p-way Mergesort to merge  all the i-th sorted sublists of p lists.

Wednesday, June 27, 12

PSRS Example16 2 17 24 33 28 30 1 0 27 9 25 34 23 19 18 11 7 21 13 8 35 12 29 6 3 4 14 22 15 32 10 26 31 20 5

0 1 2 9 16 17 24 25 27 28 30 33

7 8 11 12 13 18 19 21 23 29 34 35

3 4 5 6 10 14 15 20 22 26 31 32

0 1 2 9 16 17 24 25 27 28 30 33

7 8 11 12 13 18 19 21 23 29 34 35

3 4 5 6 10 14 15 20 22 26 31 32

1610 13 22 23 27

1610 13 22 23 27

0 1 2 9 7 8 3 4 5 6 10 16 17 11 12 13 18 19 21 14 15 20 22 24 25 27 28 30 33 23 29 34 35 26 31 32

Wednesday, June 27, 12

Complexity Analysis• Phase 1

• Phase 2

• Phase 3

Complexity for PSRS is :

Wednesday, June 27, 12

Q & A

Wednesday, June 27, 12