bitonic sort in shared simd array processor

23
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)

Upload: asanka-dilruk

Post on 27-Jul-2015

64 views

Category:

Software


2 download

TRANSCRIPT

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)

2

Index …

Background of Sorting

SIMD Array Processor

Bitonic Sort Algorithm

Conclusion

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

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)

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.

6

Bitonic Sorting Algorithm

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

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)

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)

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

20

Bitonic Sorting Example …

21

Bitonic Sorting Example …

Saturday, April 15, 2023 22

Bitonic Sorting Example

23