Top Banner
1 Bitonic Sort in Shared SIMD Array Processor Anukul Chandra Panda, Pankaj K Sa {pandaa,pankajksa}@nitrkl.ac.i n Banshidhar Majhi [email protected] Presented By : Dilruk G.A. (148209B) Jagoda S.D. (148214K)
23
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Bitonic Sort in Shared SIMD Array Processor

1

Bitonic Sort in

Shared SIMD Array Processor

Anukul Chandra Panda, Pankaj K Sa{pandaa,pankajksa}@nitrkl.ac.in

Banshidhar [email protected]

Presented By :

Dilruk G.A. (148209B)

Jagoda S.D. (148214K)

Page 2: Bitonic Sort in Shared SIMD Array Processor

2

Index …

Background of Sorting

SIMD Array Processor

Bitonic Sort Algorithm

Conclusion

Page 3: Bitonic Sort in Shared SIMD Array Processor

3

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

Page 4: Bitonic Sort in Shared SIMD Array Processor

4

SIMD Array Processor

Special purpose processor • Ex: multi core, GPU

Single Instruction , Multiple Data• One instruction work on multiple

data items simultaneously

Single Program Counter

Multiple Processing Elements (PEs)

Page 5: Bitonic Sort in Shared SIMD Array Processor

5

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.

Page 6: Bitonic Sort in Shared SIMD Array Processor

6

Bitonic Sorting Algorithm

Page 7: Bitonic Sort in Shared SIMD Array Processor

7

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

Page 8: Bitonic Sort in Shared SIMD Array Processor

Bitonic Sort

12

15

16

14

13

17

11

10

8x monotonic lists: 16,11,14,10,17,15,12,134x bitonic lists: (16,11),(14,10),(17,15),(12,13)

Page 9: Bitonic Sort in Shared SIMD Array Processor

Bitonic Sort

12

15

16

14

13

17

11

10

8x monotonic lists: 16,11,14,10,17,15,12,134x bitonic lists: (16,11),(14,10),(17,15),(12,13)

Page 10: Bitonic Sort in Shared SIMD Array Processor

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)

Page 11: Bitonic Sort in Shared SIMD Array Processor

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)

Page 12: Bitonic Sort in Shared SIMD Array Processor

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)

Page 13: Bitonic Sort in Shared SIMD Array Processor

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)

Page 14: Bitonic Sort in Shared SIMD Array Processor

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

Page 15: Bitonic Sort in Shared SIMD Array Processor

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

Page 16: Bitonic Sort in Shared SIMD Array Processor

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

Page 17: Bitonic Sort in Shared SIMD Array Processor

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

Page 18: Bitonic Sort in Shared SIMD Array Processor

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

Page 19: Bitonic Sort in Shared SIMD Array Processor

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

Page 20: Bitonic Sort in Shared SIMD Array Processor

20

Bitonic Sorting Example …

Page 21: Bitonic Sort in Shared SIMD Array Processor

21

Bitonic Sorting Example …

Page 22: Bitonic Sort in Shared SIMD Array Processor

Saturday, April 15, 2023 22

Bitonic Sorting Example

Page 23: Bitonic Sort in Shared SIMD Array Processor

23