PARALLEL SORTING and MOTIF SEARCH by Shibdas Bandyopadhyay August 2012

Total Page:16

File Type:pdf, Size:1020Kb

PARALLEL SORTING and MOTIF SEARCH by Shibdas Bandyopadhyay August 2012 PARALLEL SORTING AND MOTIF SEARCH By SHIBDAS BANDYOPADHYAY A DISSERTATION PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY UNIVERSITY OF FLORIDA 2012 c 2012 Shibdas Bandyopadhyay 2 I dedicate this to my family. 3 ACKNOWLEDGMENTS This work would not have been possible without continuous guidance of my advisor Dr. Sartaj Sahni. His ideas and pertinent questions inspired me to explore different ways to solve problems. I’m also grateful to my parents for encouraging and supporting me during all these years. 4 TABLE OF CONTENTS page ACKNOWLEDGMENTS .................................. 4 LIST OF TABLES ...................................... 8 LIST OF FIGURES ..................................... 9 ABSTRACT ......................................... 12 CHAPTER 1 MULTI-CORE ARCHITECTURES ......................... 13 1.1 The Cell Broadband Engine .......................... 13 1.2 Graphics Processing Units .......................... 16 2 SORTING ON THE CELL BROADBAND ENGINE ................ 20 2.1 High-level Strategies For Sorting ....................... 20 2.2 SPU Vector and Memory Operations ..................... 21 2.3 Sorting Numbers ................................ 23 2.3.1 Single SPU Sort ............................ 23 2.3.1.1 Shellsort variants ...................... 24 2.3.1.2 Merge sort .......................... 28 2.3.1.3 Comparison of single SPU sorting algorithms ....... 37 2.3.2 Hierarchical Sort ............................ 38 2.4 Sorting Records ................................ 41 2.4.1 Record Layouts ............................. 41 2.4.2 High-level Strategies for Sorting Records ............... 42 2.4.3 Single SPU Record Sorting ...................... 44 2.4.4 Hierarchical Sorting for Records - 4way Merge ........... 45 2.4.5 Comparison of Record Sorting Algorithms .............. 49 2.4.5.1 Run times for ByField layout ................ 50 2.4.5.2 Run times for ByRecord layout ............... 52 2.4.5.3 Cross layout comparison .................. 54 2.5 Summary .................................... 55 3 SORTING ON A GRAPHICS PROCESSING UNIT (GPU) ............ 59 3.1 Sorting Numbers on GPUs .......................... 59 3.1.1 GPU Sample Sort ........................... 61 3.1.1.1 Step 1–Splitter selection .................. 62 3.1.1.2 Step 2–Finding buckets ................... 63 3.1.1.3 Step 3–Prefix sum ...................... 63 3.1.1.4 Step 4–Placing elements into buckets ........... 63 3.1.2 Warpsort ................................ 64 5 3.1.2.1 Step 1–Bitonic sort by warps ................ 64 3.1.2.2 Step 2–Bitonic merge by warps ............... 65 3.1.2.3 Step 3–Splitting long sequences .............. 65 3.1.2.4 Step 4–Final merge by warps ................ 66 3.1.3 SRTS Radix Sort ............................ 66 3.1.3.1 Step 1–Bottom level reduce ................. 68 3.1.3.2 Step 2–Top level scan .................... 69 3.1.3.3 Step 3–Bottom level scan .................. 69 3.1.4 SDK Radix Sort Algorithm ....................... 70 3.1.4.1 Step 1–Sorting tiles ..................... 71 3.1.4.2 Step 2–Calculating histogram ................ 73 3.1.4.3 Step 3–Prefix sum of histogram .............. 73 3.1.4.4 Step 4–Rearrangement ................... 74 3.1.5 GPU Radix Sort(GRS) ......................... 75 3.1.5.1 Step 1–Histogram and Ranks ................ 76 3.1.5.2 Step 2–Prefix sum of tile histograms ............ 79 3.1.5.3 Step 3–Positioning numbers in a tile ............ 80 3.1.6 Comparison of Number Sorting Algorithms ............. 81 3.2 Sorting Records on GPUs ........................... 82 3.2.1 Record Layouts ............................. 82 3.2.2 High level Strategies for Sorting Records ............... 83 3.2.3 Sample Sort for Sorting Records ................... 84 3.2.4 SRTS for Sorting Records ....................... 87 3.2.5 GRS for Sorting Records ........................ 89 3.3 Experimental Results ............................. 91 3.3.1 Run Times for ByField Layout ..................... 92 3.3.2 Run Times for Hybrid Layout ...................... 93 3.4 Summary .................................... 95 4 MOTIF SEARCH ................................... 97 4.1 Introduction ................................... 97 4.2 PMS5 ...................................... 100 4.2.1 Notations and Definitions ....................... 100 4.2.2 PMS5 Overview ............................. 100 4.2.3 Computing Bd (x, y, z) ......................... 101 4.2.4 Intersection of Qs ............................ 104 4.3 PMS6 ...................................... 105 4.3.1 Overview ................................ 105 4.3.2 Computing Bd (C(n1, ··· , n5)) ..................... 105 4.3.3 The Data Structure Q ......................... 109 4.3.4 Complexity ............................... 110 4.4 Experimental Results ............................. 110 4.4.1 Preprocessing .............................. 111 4.4.2 Computing Bd .............................. 112 6 4.4.3 Total Time ................................ 112 4.4.4 Total Time Plus Preprocessing Time ................. 113 4.5 PMS6MC .................................... 113 4.5.1 Overview ................................ 113 4.5.2 Outer-Level Parallelism ......................... 114 4.5.3 Inner-Level Parallelization ....................... 114 4.5.3.1 Finding equivalence classes in parallel .......... 115 4.5.3.2 Computing Bd (C) in parallel ................ 116 4.5.3.3 Processing Q in parallel ................... 117 4.5.3.4 The outputMotifs routine .................. 119 4.6 Experimental Results ............................. 120 4.6.1 PMS6MC Implementation ....................... 121 4.6.2 PMS6 and PMS6MC .......................... 121 4.6.3 PMS6MC and Other Parallel Algorithms ............... 122 4.7 Summary .................................... 123 5 CONCLUSION AND FUTURE WORK ....................... 125 REFERENCES ....................................... 127 BIOGRAPHICAL SKETCH ................................ 132 7 LIST OF TABLES Table page 2-1 Comparison of various SPU sorting algorithms .................. 39 4-1 Preprocessing times for PMS5 and PMS6 ..................... 112 4-2 Total storage for PMS5 and PMS6 in MegaBytes(MB) .............. 112 4-3 Time taken to compute Bd (C(n1, ··· , n5)) and Bd (x, y, z) ............ 112 4-4 Total run rime of PMS5 and PMS6 ......................... 113 4-5 Total + preprocessing time by PMS5 and PMS6 ................. 113 4-6 Degree of inner and outer level parallelism for PMS6MC ............ 121 4-7 Run times for PMS6 and PMS6MC ........................ 122 4-8 Run times for PMS5 and PMSPrune ........................ 122 4-9 Total run time of different PMS Algorithms .................... 123 4-10 Comparing mSPELLER and gSPELLER with PMS6MC ............. 123 8 LIST OF FIGURES Figure page 1-1 Architecture of the Cell Broadband Engine ..................... 15 1-2 NVIDIA’s Tesla GPU ................................. 16 1-3 Cuda Programming Model .............................. 17 2-1 Comparisons for mySpu cmpswap skew ...................... 22 2-2 Comb sort ...................................... 26 2-3 Single SPU column-major AA-sort ......................... 26 2-4 Collecting numbers from a 4 × 4 Matrix ...................... 27 2-5 Column-major to row-major ............................. 28 2-6 Column-major brick sort ............................... 29 2-7 Column-major shaker sort ............................. 29 2-8 Merge sort example ................................. 31 2-9 Phase 2 of merge sort ............................... 32 2-10 Phase 3 counters .................................. 33 2-11 Phase 3 of merge sort ............................... 34 2-12 Phase 4 counters .................................. 37 2-13 Phase 4 of merge sort with counters in different columns ............ 38 2-14 Plot of average time to sort 4-byte integers .................... 40 2-15 SIMD odd-even merge of two vectors ....................... 41 2-16 SIMD 2-way merge of 2 vectors v1 and v2 .................... 42 2-17 Plot of average time to sort 1 to 67 million integers ................ 43 2-18 The findmin operation for records ......................... 44 2-19 The fields select operation in ByField layout .................... 44 2-20 The fields select operation in ByRecord layout ................... 45 2-21 Shuffling two records in ByField layout ....................... 45 2-22 Shuffling two records in ByRecord layout ..................... 45 9 2-23 4-way merge ..................................... 46 2-24 4-way merge ..................................... 48 2-25 SIMD 2-way merge of 2 vectors v1 and v2 .................... 49 2-26 2-way sorts (ByField) ................................. 51 2-27 4-way sorts (ByField) ................................. 52 2-28 2-way and 4-way sorts (ByField), 1M records ................... 53 2-29 4-way sorts (ByField), 1M records ......................... 54 2-30 2-way sorts (ByRecord) ............................... 55 2-31 4-way sorts (ByRecord) ............................... 56 2-32 2-way and 4-way sorts (ByRecord), 1M records .................. 57 2-33 4-way sorts (ByRecord), 1M records ........................ 58 2-34 4-way sorts using the best algorithm for different layouts ............ 58 3-1 Serial Sample Sort ................................. 62 3-2 An Iteration of GPU Sample Sort .......................... 63 3-3 Bitonic Merge Sort of 8 Elements ......................... 64 3-4 Warpsort Steps ................................... 66 3-5
Recommended publications
  • Coursenotes 4 Non-Adaptive Sorting Batcher's Algorithm
    4. Non Adaptive Sorting Batcher’s Algorithm 4.1 Introduction to Batcher’s Algorithm Sorting has many important applications in daily life and in particular, computer science. Within computer science several sorting algorithms exist such as the “bubble sort,” “shell sort,” “comb sort,” “heap sort,” “bucket sort,” “merge sort,” etc. We have actually encountered these before in section 2 of the course notes. Many different sorting algorithms exist and are implemented differently in each programming language. These sorting algorithms are relevant because they are used in every single computer program you run ranging from the unimportant computer solitaire you play to the online checking account you own. Indeed without sorting algorithms, many of the services we enjoy today would simply not be available. Batcher’s algorithm is a way to sort individual disorganized elements called “keys” into some desired order using a set number of comparisons. The keys that will be sorted for our purposes will be numbers and the order that we will want them to be in will be from greatest to least or vice a versa (whichever way you want it). The Batcher algorithm is non-adaptive in that it takes a fixed set of comparisons in order to sort the unsorted keys. In other words, there is no change made in the process during the sorting. Unlike other methods of sorting where you need to remember comparisons (tournament sort), Batcher’s algorithm is useful because it requires less thinking. Non-adaptive sorting is easy because outcomes of comparisons made at one point of the process do not affect which comparisons will be made in the future.
    [Show full text]
  • An Evolutionary Approach for Sorting Algorithms
    ORIENTAL JOURNAL OF ISSN: 0974-6471 COMPUTER SCIENCE & TECHNOLOGY December 2014, An International Open Free Access, Peer Reviewed Research Journal Vol. 7, No. (3): Published By: Oriental Scientific Publishing Co., India. Pgs. 369-376 www.computerscijournal.org Root to Fruit (2): An Evolutionary Approach for Sorting Algorithms PRAMOD KADAM AND Sachin KADAM BVDU, IMED, Pune, India. (Received: November 10, 2014; Accepted: December 20, 2014) ABstract This paper continues the earlier thought of evolutionary study of sorting problem and sorting algorithms (Root to Fruit (1): An Evolutionary Study of Sorting Problem) [1]and concluded with the chronological list of early pioneers of sorting problem or algorithms. Latter in the study graphical method has been used to present an evolution of sorting problem and sorting algorithm on the time line. Key words: Evolutionary study of sorting, History of sorting Early Sorting algorithms, list of inventors for sorting. IntroDUCTION name and their contribution may skipped from the study. Therefore readers have all the rights to In spite of plentiful literature and research extent this study with the valid proofs. Ultimately in sorting algorithmic domain there is mess our objective behind this research is very much found in documentation as far as credential clear, that to provide strength to the evolutionary concern2. Perhaps this problem found due to lack study of sorting algorithms and shift towards a good of coordination and unavailability of common knowledge base to preserve work of our forebear platform or knowledge base in the same domain. for upcoming generation. Otherwise coming Evolutionary study of sorting algorithm or sorting generation could receive hardly information about problem is foundation of futuristic knowledge sorting problems and syllabi may restrict with some base for sorting problem domain1.
    [Show full text]
  • Efficient Algorithms for a Mesh-Connected Computer With
    Efficient Algorithms for a Mesh-Connected Computer with Additional Global Bandwidth by Yujie An A dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy (Computer Science and Engineering) in the University of Michigan 2019 Doctoral Committee: Professor Quentin F. Stout, Chair Associate Professor Kevin J. Compton Professor Seth Pettie Professor Martin J. Strauss Yujie An [email protected] ORCID iD: 0000-0002-2038-8992 ©Yujie An 2019 Acknowledgments My researches are done with the help of many people. First I would like to thank my advisor, Quentin F. Stout, who introduced me to most of the topics discussed here, and helped me throughout my Ph.D. career at University of Michigan. I would also like to thank my thesis committee members, Kevin J. Compton, Seth Pettie and Martin J. Strauss, for their invaluable advice during the dissertation process. To my parents, thank you very much for your long-term support. All my achievements cannot be accomplished without your loves. To all my best friends, thank you very much for keeping me happy during my life. ii TABLE OF CONTENTS Acknowledgments ................................... ii List of Figures ..................................... v List of Abbreviations ................................. vii Abstract ......................................... viii Chapter 1 Introduction ..................................... 1 2 Preliminaries .................................... 3 2.1 Our Model..................................3 2.2 Related Work................................5 3 Basic Operations .................................. 8 3.1 Broadcast, Reduction and Scan.......................8 3.2 Rotation................................... 11 3.3 Sparse Random Access Read/Write..................... 12 3.4 Optimality.................................. 17 4 Sorting and Selecting ................................ 18 4.1 Sort..................................... 18 4.1.1 Sort in the Worst Case....................... 18 4.1.2 Sort when Only k Values are Out of Order............
    [Show full text]
  • Instructor's Manual
    Instructor’s Manual Vol. 2: Presentation Material CCC Mesh/Torus Butterfly !*#? Sea Sick Hypercube Pyramid Behrooz Parhami This instructor’s manual is for Introduction to Parallel Processing: Algorithms and Architectures, by Behrooz Parhami, Plenum Series in Computer Science (ISBN 0-306-45970-1, QA76.58.P3798) 1999 Plenum Press, New York (http://www.plenum.com) All rights reserved for the author. No part of this instructor’s manual may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, microfilming, recording, or otherwise, without written permission. Contact the author at: ECE Dept., Univ. of California, Santa Barbara, CA 93106-9560, USA ([email protected]) Introduction to Parallel Processing: Algorithms and Architectures Instructor’s Manual, Vol. 2 (4/00), Page iv Preface to the Instructor’s Manual This instructor’s manual consists of two volumes. Volume 1 presents solutions to selected problems and includes additional problems (many with solutions) that did not make the cut for inclusion in the text Introduction to Parallel Processing: Algorithms and Architectures (Plenum Press, 1999) or that were designed after the book went to print. It also contains corrections and additions to the text, as well as other teaching aids. The spring 2000 edition of Volume 1 consists of the following parts (the next edition is planned for spring 2001): Vol. 1: Problem Solutions Part I Selected Solutions and Additional Problems Part II Question Bank, Assignments, and Projects Part III Additions, Corrections, and Other Updates Part IV Sample Course Outline, Calendar, and Forms Volume 2 contains enlarged versions of the figures and tables in the text, in a format suitable for use as transparency masters.
    [Show full text]
  • Investigating the Effect of Implementation Languages and Large Problem Sizes on the Tractability and Efficiency of Sorting Algorithms
    International Journal of Engineering Research and Technology. ISSN 0974-3154, Volume 12, Number 2 (2019), pp. 196-203 © International Research Publication House. http://www.irphouse.com Investigating the Effect of Implementation Languages and Large Problem Sizes on the Tractability and Efficiency of Sorting Algorithms Temitayo Matthew Fagbola and Surendra Colin Thakur Department of Information Technology, Durban University of Technology, Durban 4000, South Africa. ORCID: 0000-0001-6631-1002 (Temitayo Fagbola) Abstract [1],[2]. Theoretically, effective sorting of data allows for an efficient and simple searching process to take place. This is Sorting is a data structure operation involving a re-arrangement particularly important as most merge and search algorithms of an unordered set of elements with witnessed real life strictly depend on the correctness and efficiency of sorting applications for load balancing and energy conservation in algorithms [4]. It is important to note that, the rearrangement distributed, grid and cloud computing environments. However, procedure of each sorting algorithm differs and directly impacts the rearrangement procedure often used by sorting algorithms on the execution time and complexity of such algorithm for differs and significantly impacts on their computational varying problem sizes and type emanating from real-world efficiencies and tractability for varying problem sizes. situations [5]. For instance, the operational sorting procedures Currently, which combination of sorting algorithm and of Merge Sort, Quick Sort and Heap Sort follow a divide-and- implementation language is highly tractable and efficient for conquer approach characterized by key comparison, recursion solving large sized-problems remains an open challenge. In this and binary heap’ key reordering requirements, respectively [9].
    [Show full text]
  • Sorting Partnership Unless You Sign Up! Brian Curless • Homework #5 Will Be Ready After Class, Spring 2008 Due in a Week
    Announcements (5/9/08) • Project 3 is now assigned. CSE 326: Data Structures • Partnerships due by 3pm – We will not assume you are in a Sorting partnership unless you sign up! Brian Curless • Homework #5 will be ready after class, Spring 2008 due in a week. • Reading for this lecture: Chapter 7. 2 Sorting Consistent Ordering • Input – an array A of data records • The comparison function must provide a – a key value in each data record consistent ordering on the set of possible keys – You can compare any two keys and get back an – a comparison function which imposes a indication of a < b, a > b, or a = b (trichotomy) consistent ordering on the keys – The comparison functions must be consistent • Output • If compare(a,b) says a<b, then compare(b,a) must say b>a • If says a=b, then must say b=a – reorganize the elements of A such that compare(a,b) compare(b,a) • If compare(a,b) says a=b, then equals(a,b) and equals(b,a) • For any i and j, if i < j then A[i] ≤ A[j] must say a=b 3 4 Why Sort? Space • How much space does the sorting • Allows binary search of an N-element algorithm require in order to sort the array in O(log N) time collection of items? • Allows O(1) time access to kth largest – Is copying needed? element in the array for any k • In-place sorting algorithms: no copying or • Sorting algorithms are among the most at most O(1) additional temp space.
    [Show full text]
  • Sorting Algorithm 1 Sorting Algorithm
    Sorting algorithm 1 Sorting algorithm In computer science, a sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the use of other algorithms (such as search and merge algorithms) that require sorted lists to work correctly; it is also often useful for canonicalizing data and for producing human-readable output. More formally, the output must satisfy two conditions: 1. The output is in nondecreasing order (each element is no smaller than the previous element according to the desired total order); 2. The output is a permutation, or reordering, of the input. Since the dawn of computing, the sorting problem has attracted a great deal of research, perhaps due to the complexity of solving it efficiently despite its simple, familiar statement. For example, bubble sort was analyzed as early as 1956.[1] Although many consider it a solved problem, useful new sorting algorithms are still being invented (for example, library sort was first published in 2004). Sorting algorithms are prevalent in introductory computer science classes, where the abundance of algorithms for the problem provides a gentle introduction to a variety of core algorithm concepts, such as big O notation, divide and conquer algorithms, data structures, randomized algorithms, best, worst and average case analysis, time-space tradeoffs, and lower bounds. Classification Sorting algorithms used in computer science are often classified by: • Computational complexity (worst, average and best behaviour) of element comparisons in terms of the size of the list . For typical sorting algorithms good behavior is and bad behavior is .
    [Show full text]
  • Visvesvaraya Technological University a Project Report
    ` VISVESVARAYA TECHNOLOGICAL UNIVERSITY “Jnana Sangama”, Belagavi – 590 018 A PROJECT REPORT ON “PREDICTIVE SCHEDULING OF SORTING ALGORITHMS” Submitted in partial fulfillment for the award of the degree of BACHELOR OF ENGINEERING IN COMPUTER SCIENCE AND ENGINEERING BY RANJIT KUMAR SHA (1NH13CS092) SANDIP SHAH (1NH13CS101) SAURABH RAI (1NH13CS104) GAURAV KUMAR (1NH13CS718) Under the guidance of Ms. Sridevi (Senior Assistant Professor, Dept. of CSE, NHCE) DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING NEW HORIZON COLLEGE OF ENGINEERING (ISO-9001:2000 certified, Accredited by NAAC ‘A’, Permanently affiliated to VTU) Outer Ring Road, Panathur Post, Near Marathalli, Bangalore – 560103 ` NEW HORIZON COLLEGE OF ENGINEERING (ISO-9001:2000 certified, Accredited by NAAC ‘A’ Permanently affiliated to VTU) Outer Ring Road, Panathur Post, Near Marathalli, Bangalore-560 103 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CERTIFICATE Certified that the project work entitled “PREDICTIVE SCHEDULING OF SORTING ALGORITHMS” carried out by RANJIT KUMAR SHA (1NH13CS092), SANDIP SHAH (1NH13CS101), SAURABH RAI (1NH13CS104) and GAURAV KUMAR (1NH13CS718) bonafide students of NEW HORIZON COLLEGE OF ENGINEERING in partial fulfillment for the award of Bachelor of Engineering in Computer Science and Engineering of the Visvesvaraya Technological University, Belagavi during the year 2016-2017. It is certified that all corrections/suggestions indicated for Internal Assessment have been incorporated in the report deposited in the department library. The project report has been approved as it satisfies the academic requirements in respect of Project work prescribed for the Degree. Name & Signature of Guide Name Signature of HOD Signature of Principal (Ms. Sridevi) (Dr. Prashanth C.S.R.) (Dr. Manjunatha) External Viva Name of Examiner Signature with date 1.
    [Show full text]
  • Quadratic Time Algorithms Appear to Be Optimal for Sorting Evolving Data
    Quadratic Time Algorithms Appear to be Optimal for Sorting Evolving Data Juan Jos´eBesa William E. Devanny David Eppstein Dept. of Computer Science Dept. of Computer Science Dept. of Computer Science Univ. of California, Irvine Univ. of California, Irvine Univ. of California, Irvine Irvine, CA 92697 USA Irvine, CA 92697 USA Irvine, CA 92697 USA [email protected] [email protected] [email protected] Michael T. Goodrich Timothy Johnson Dept. of Computer Science Dept. of Computer Science Univ. of California, Irvine Univ. of California, Irvine Irvine, CA 92697 USA Irvine, CA 92697 USA [email protected] [email protected] Abstract 1.1 The Evolving Data Model One scenario We empirically study sorting in the evolving data model. where the Knuthian model doesn't apply is for In this model, a sorting algorithm maintains an ap- applications where the input data is changing while an proximation to the sorted order of a list of data items algorithm is processing it, which has given rise to the while simultaneously, with each comparison made by the evolving data model [1]. In this model, input changes algorithm, an adversary randomly swaps the order of are coming so fast that it is hard for an algorithm to adjacent items in the true sorted order. Previous work keep up, much like Lucy in the classic conveyor belt 1 studies only two versions of quicksort, and has a gap scene in the TV show, I Love Lucy. Thus, rather than between the lower bound of Ω(n) and the best upper produce a single output, as in the Knuthian model, bound of O(n log log n).
    [Show full text]
  • Evaluation of Sorting Algorithms, Mathematical and Empirical Analysis of Sorting Algorithms
    International Journal of Scientific & Engineering Research Volume 8, Issue 5, May-2017 86 ISSN 2229-5518 Evaluation of Sorting Algorithms, Mathematical and Empirical Analysis of sorting Algorithms Sapram Choudaiah P Chandu Chowdary M Kavitha ABSTRACT:Sorting is an important data structure in many real life applications. A number of sorting algorithms are in existence till date. This paper continues the earlier thought of evolutionary study of sorting problem and sorting algorithms concluded with the chronological list of early pioneers of sorting problem or algorithms. Latter in the study graphical method has been used to present an evolution of sorting problem and sorting algorithm on the time line. An extensive analysis has been done compared with the traditional mathematical methods of ―Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort. Observations have been obtained on comparing with the existing approaches of All Sorts. An “Empirical Analysis” consists of rigorous complexity analysis by various sorting algorithms, in which comparison and real swapping of all the variables are calculatedAll algorithms were tested on random data of various ranges from small to large. It is an attempt to compare the performance of various sorting algorithm, with the aim of comparing their speed when sorting an integer inputs.The empirical data obtained by using the program reveals that Quick sort algorithm is fastest and Bubble sort is slowest. Keywords: Bubble Sort, Insertion sort, Quick Sort, Merge Sort, Selection Sort, Heap Sort,CPU Time. Introduction In spite of plentiful literature and research in more dimension to student for thinking4. Whereas, sorting algorithmic domain there is mess found in this thinking become a mark of respect to all our documentation as far as credential concern2.
    [Show full text]
  • Fast Sorting for Exact OIT of Complex Scenes
    CGI2014 manuscript No. 86 Fast Sorting for Exact OIT of Complex Scenes Pyarelal Knowles · Geoff Leach · Fabio Zambetta June 2014 Abstract Exact order independent transparency for example sorting per-object. This is because com- (OIT) techniques capture all fragments during ras- pletely sorting per-triangle is expensive and difficult, terization. The fragments are then sorted per-pixel requiring splitting triangles in cases of intersection or by depth and composited them in order using alpha cyclical overlapping. Order-independent transparency transparency. The sorting stage is a bottleneck for (OIT) allows geometry to be rasterized in arbitrary or- high depth complexity scenes, taking 70{95% of the der, sorting surfaces as fragments in image space. Our total time for those investigated. In this paper we show focus is exact OIT, for which sorting is central, although that typical shader based sorting speed is impacted we note there are approximate OIT techniques which by local memory latency and occupancy. We present use data reduction and trade accuracy for speed [17, and discuss the use of both registers and an external 13]. merge sort in register-based block sort to better use the memory hierarchy of the GPU for improved OIT rendering performance. This approach builds upon backwards memory allocation, achieving an OIT ren- dering speed up to 1:7× that of the best previous method and 6:3× that of the common straight forward OIT implementation. In some cases the sorting stage is reduced to no longer be the dominant OIT component. Keywords sorting · OIT · transparency · shaders · performance · registers · register-based block sort Figure 1: Power plant model, with false colouring to 1 Introduction show backwards memory allocation intervals.
    [Show full text]
  • Sorting Algorithm 1 Sorting Algorithm
    Sorting algorithm 1 Sorting algorithm A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the use of other algorithms (such as search and merge algorithms) which require input data to be in sorted lists; it is also often useful for canonicalizing data and for producing human-readable output. More formally, the output must satisfy two conditions: 1. The output is in nondecreasing order (each element is no smaller than the previous element according to the desired total order); 2. The output is a permutation (reordering) of the input. Since the dawn of computing, the sorting problem has attracted a great deal of research, perhaps due to the complexity of solving it efficiently despite its simple, familiar statement. For example, bubble sort was analyzed as early as 1956.[1] Although many consider it a solved problem, useful new sorting algorithms are still being invented (for example, library sort was first published in 2006). Sorting algorithms are prevalent in introductory computer science classes, where the abundance of algorithms for the problem provides a gentle introduction to a variety of core algorithm concepts, such as big O notation, divide and conquer algorithms, data structures, randomized algorithms, best, worst and average case analysis, time-space tradeoffs, and upper and lower bounds. Classification Sorting algorithms are often classified by: • Computational complexity (worst, average and best behavior) of element comparisons in terms of the size of the list (n). For typical serial sorting algorithms good behavior is O(n log n), with parallel sort in O(log2 n), and bad behavior is O(n2).
    [Show full text]