1
Bitonic Sort
in
Shared SIMD Array Processor
Anukul Chandra Panda, Pankaj K Sa
{pandaa,pankajksa}@nitrkl.ac.in
Banshidhar Majhi
bmajhi@nitrkl.ac.in
Presented By :
Dilruk G.A. (148209B)
Jagoda S.D. (148214K)
Index …
 Background of Sorting
 SIMD Array Processor
 Bitonic Sort Algorithm
 Conclusion
2
Background of Sorting
 Sorting of data is needed everywhere
• Data Structures, Joins in databases, Searching Algorithms
 Simple algorithms required O(n2)
• Selection Sort, Insertion Sort, Bubble Sort
 Even advanced algorithm take O(nLogn)
• Merge Sort, Heap Sort, Cube Sort
 Parallel sorting solve the problem
• Bitonic Sort, Parallel Merge Sort
3
SIMD Array Processor
 Special purpose
processor
• Ex: multi core, GPU
 Single Instruction ,
Multiple Data
• One instruction work on multiple
data items simultaneously
4
 Single Program Counter
 Multiple Processing Elements (PEs)
Bitonic Sorting Algorithm
 List A: (3, 4, 7, 8) monotonically increasing.
 List B: (6, 5, 2, 1) monotonically decreasing.
 List AB: (3, 4, 7, 8, 6, 5, 2, 1) Bitonic list.
 Bitonic list is two monotonic lists concatenated
together, one increasing and one decreasing.
 For n elements n/2 comparators are using.
 Repeatedly build Bitonic lists and then sort them.
 Just logn stages are required to sort the Bitonic list.
5
Bitonic Sorting Algorithm
6
Time Complexity
 In line 2 a shared memory access is needed.
 Line 26 need one more operation to write
data back to the array.
 Within nested loop 2 memory references are
multiplied
7
Bitonic Sort
12
15
16
14
13
17
11
10
8x monotonic lists: 16,11,14,10,17,15,12,13
4x bitonic lists: (16,11),(14,10),(17,15),(12,13)
Bitonic Sort
12
15
16
14
13
17
11
10
8x monotonic lists: 16,11,14,10,17,15,12,13
4x bitonic lists: (16,11),(14,10),(17,15),(12,13)
Bitonic Sort
12
15
16
14
13
17
11
10
13
17
11
14
12
15
16
10
4x monotonic lists: (11,16),(14,10),(15,17),(13,12)
2x bitonic lists: (11,16,14,10),(15,17,13,12)
Bitonic Sort
12
15
16
14
13
17
11
10
13
17
11
14
12
15
16
10
4x monotonic lists: (11,16),(14,10),(15,17),(13,12)
2x bitonic lists: (11,16,14,10),(15,17,13,12)
Bitonic Sort
12
15
16
14
13
17
11
10
13
17
11
14
12
15
16
10
13
17
11
14
12
15
10
16
4x monotonic lists: (11,16),(14,10),(15,17),(13,12)
2x bitonic lists: (11,16,14,10),(15,17,13,12)
Bitonic Sort
12
15
16
14
13
17
11
10
13
17
11
14
12
15
16
10
13
17
11
14
12
15
10
16
13
15
10
14
12
17
11
16
2x monotonic lists: (10,11,14,16),(17,15,13,12)
1x bitonic lists: (10,11,14,16,17,15,13,12)
Bitonic Sort
12
15
16
14
13
17
11
10
13
17
11
14
12
15
16
10
13
17
11
14
12
15
10
16
13
15
10
14
12
17
11
16
sorting
Bitonic Sort
12
15
16
14
13
17
11
10
13
17
11
14
12
15
16
10
13
17
11
14
12
15
10
16
14
15
10
13
16
17
11
12
13
15
10
14
12
17
11
16
sorting
Bitonic Sort
12
15
16
14
13
17
11
10
13
17
11
14
12
15
16
10
13
17
11
14
12
15
10
16
14
15
10
13
16
17
11
12
13
15
10
14
12
17
11
16
sorting
Bitonic Sort
12
15
16
14
13
17
11
10
13
17
11
14
12
15
16
10
13
17
11
14
12
15
10
16
14
15
10
13
16
17
11
12
17
15
10
13
16
14
11
12
13
15
10
14
12
17
11
16
sorting
Bitonic Sort
12
15
16
14
13
17
11
10
13
17
11
14
12
15
16
10
13
17
11
14
12
15
10
16
14
15
10
13
16
17
11
12
17
15
10
13
16
14
11
12
13
15
10
14
12
17
11
16
sorting
Bitonic Sort
12
15
16
14
13
17
11
10
Done
13
17
11
14
12
15
16
10
13
17
11
14
12
15
10
16
14
15
10
13
16
17
11
12
17
15
10
13
16
14
11
12
16
15
10
12
17
14
11
13
13
15
10
14
12
17
11
16
Bitonic Sorting Example …
20
Bitonic Sorting Example …
21
Bitonic Sorting Example
Tuesday, June 16, 2015 22
23

BitonicSortSIMD