Communication-Efficient Parallel Sorting (Preliminary Version)

Total Page:16

File Type:pdf, Size:1020Kb

Communication-Efficient Parallel Sorting (Preliminary Version) Communication-Efficient Parallel Sorting (Preliminary Version) MICHAEL T. GOODRICH* Johns Hopkins Univ. goodrich@cs. jhu. edu Abstract ing [2, 6, 12, 26, 30, 31, 34, 41, 40]. The real potential of parallel computation, therefore, will most likely We study the problem of sorting n numbers on a only be realized for coarse-to-medium-grain paral- p-processor bulk-synchronous parallel (BSP) com- lel systems, where the ratio of memory to proces- puter, which is a parallel multicomputer that al- sors is non-constant, for such systems allc,w an al- lows for general processor-to-processor communica- gorithm designer to balance communication latency tion rounds provided each processor sends and re- wit h internal comput at ion time. Indeed, this realiza- ceives at most h items in any round. We provide tion has given rise to several new computation mod- parallel sorting methods that use internal computa- els for parallel algorithm design, which all use what tion time that is O(*) and a number of commu- Valiant [40] calls “bulk synchronous” processing. In nication rounds that is 0( ~$$~1) ) for h = @(n/p). such a model an input of size n is distributed evenly The internal computation bound is optimal for any across a p-processor parallel computer. In a single comparison-based sorting algorithm. Moreover, the computation round (which Valiant calls a superstep) number of communication rounds is bounded by a each processor may send and receive h messages and constant for the (practical) situations when p < then perform an internal computation on its inter- nal memory cells using the messages it has just re- nl–l/c for a constant c >— 1. In fact, we show that our bound on the number of communication rounds ceived. To avoid any conflicts that might be caused is asymptotically optimal for the full range of values by asynchronies in the network (whose topology is for p, for we show that just computing the “or” of left undefined) the messages sent out in a round tby n bits distributed evenly to the first O(n/h) of an some processor cannot depend upon any messages arbitrary number of processors in a BSP computer that processor receives in round t (but, clf course, requires fl(log n/ log(h + 1)) communication rounds. they may depend upon messages received in round t – 1). We refer to this model of computation as the Bulk-Synchronous Parallel (BSP) model. 1 Introduction 1.1 The BSP Model Most of the research on parallel algorithm design in the 1970’s and 1980’s was focused on fine-grain As with the PRAM family of computer modelsl, the massively-parallel models of computation (e. g., see BSP model is distinguished by the broadcast and [4, 7, 22, 24, 28, 37]), where the ratio of mem- combining abilities of the network connecting the ory to processors is fairly small (typically O(l)), various processors. In the weakest versicm, which and this focus was independent of whether the is the only version Valiant [40] considers, the net- model of computation was a parallel random-access work may not duplicate nor combine messages, but machine (PRAM) or a network model, such as a instead may only realize h-relations between the pro- mesh-of-processors. But, as more and more par- cessors. We call this the ERE W BSP model, noting allel computer systems are being built, researchers that it is essentially the same as a model Valiant are realizing that processor-to-processor communi- elsewhere [41] calls the XPRAM and one that Gib- cation is a prime bottleneck in parallel comput- bons [19] calls the EREW phase-PRAM. It is also the communication structure assumed by the LogP *This research supported by the NSF under Grants IRI-9116843 and CCR-9300079, and by ARO under grant model [12, 25], which is the same as the BSP model DAAH04-96-1-0013. except that the LogP model does not explicitly re- Permission to make digitel/bard copies of all or psrt of thk material for quire bulk-synchronous processing. personal or classroom use is granted without fee provided that the copies But it is also natural to allow for a slightly more are not made or distributed for pmtit or commercial advanhge, the copy- right notice, the title of the publication and its date appear, and notice is powerful bulk-synchronous model, which we call the given that copyright is by permission of the ACM, Inc. To copy otherwise, 1 Indeed ~ pRAM with as many processors aOd memOry to republi~, to post on servers or to rediatribuw to lists, requires specitio permission andlor fee. cells is a BSP model with h = 1, as is a rnodute parallel corrL- STOC’96, Philadelphia PA, USA puter (MPC) [31], which is also known as is a distributed- @ 1996 ACM 0-89791-785-5/96/05. .$3.50 memory mczchtne (DMM) [23], for any memory size. 247 weak- CREW BSP model. In this model we assume allel sorting algorithms (e.g., see Akl [4], Bitton et processors are numbered 1, 2, . .. p, and that mes- al. [7], J6J& [22], Karp and Ramachandran [24], and sages can be duplicated by the network so long as Reif [37]). Nevertheless, it was not until 1983 that the destinations for any message are a contiguous it was shown, by Ajtai, Kom16s, and Szemer6di [3], set of processors {2, z + 1,. ... j }. This is essentially that n elements can be sorted in O(log n) time with the same as a model Dehne et al. [15, 16] refer to an O(n log n)-sized network (see also Paterson [35]). as the coarse-grain multi-computer. In designing an In 1985 Leighton [27] extended this result to show algorithm for this model one must take care to en- that one can produce an O (n)-node bounded-degree sure that, even with message duplication, the num- network capable of sorting in O (log n) steps, based ber of messages received by a processor in a single upon an algorithm he called “columnsort .“ In 1988 round is at most h. Nevertheless, as we demonstrate Cole [10] gave simple methods for optimal sorting in in this paper, this limited broadcast capability can the CREW and EREW PRAM models in O(log n) sometimes be employed to yield weak-CREW BSP time using O(n) processors, based upon an elegant algorithms that are conceptually simpler than their ‘(cascade mergesort” paradigm using arrays, and this EREW BSP counterparts. result was recently extended to the Parallel Pointer Finally, one can imagine more powerful instances Machine by Goodrich and Kosaraju [20]. Thus, one of the BSP model, such as a CREW BSP model, can sort optimally in these fine-grained models. which would allow for arbitrary broadcasts, or even These previous methods are not optimal, how- a CRC W BSP model, which would also allow for ever, when implemented in bulk-synchronous mod- messages to the same location to be combined (using els. Nevertheless, Leighton’s columnsort method [27] some arbitration rule). (See also [19, 32].) can be used to design a bulk-synchronous parallel The running time of a BSP algorithm is charac- sorting algorithm that uses a constant number of terized by two parameters: TI, the internal compu- communication rounds, provided P3 S n. Indeed, t ation time, and Tc, the number of communication there are a host of published algorithms for achieving rounds. A prime goal in designing a BSP algorithm such a result when the ratio of input size to number is to minimize both of these parameters. Alterna- of processors is as large as this. For example, a ran- tively, by introducing additional characterizing pa- domized strategy, called sample sort, achieves this rameters of the BSP model, we can combine TI and result with high probability [8, 17, 18, 21, 29, 38], TC into a single running time parameter, which we as do deterministic strategies based upon regular call the combined running time. Specifically, if we sampling [33, 39]. These methods based upon sam- let L denote the latency of the network—that is, pling do not seem to scale nicely for smaller n/p the worst-case time needed to send one processor- ratios, however. If columnsort is implemented in a to-processor message—and we let g denote the time recursive fashion, then it yields an EREW BSP al- “gap” between consecutive messages received by a gorithm that uses TC = O([log n/ log(n/p)]~) com- processor in a communication round, then we can munication rounds and internal computation time characterize the total running time of a BSP com- that is O(TC (n/p) log(n/p)), where 6 = 2/ (log 3 – putation as O(T1 + (L + g c). Incidentally, this is h)ll), which is approximately 3.419. Using an algo- also the running time of implementing a BSP com- rithm they call “cubesort,” Cypher and Sanz [13] putation in the analogous LogP model [12, 25]. show how to improve the Tc term in these bounds * ~–10g* (n/P)) [log ~/ log(n/P)]2), ad The goal of this paper is to further the study of to be 0((25)t10g bulk-synchronous parallel algorithms by addressing Plaxton [36] shows how cubesort can be modi- the fundamental problem of sorting n elements dis- fied to achieve Tc = O([log n/ log(n/p)]2). In- tributed evenly across a p-processor BSP computer. deed, Plaxton3 can modify the “sharesort” method of Cypher and Plaxton [14] to achieve TC = O((logn/ log(n/p)) log2(logn/ log(n/p))).
Recommended publications
  • 2.3 Quicksort
    2.3 Quicksort ‣ quicksort ‣ selection ‣ duplicate keys ‣ system sorts Algorithms, 4th Edition · Robert Sedgewick and Kevin Wayne · Copyright © 2002–2010 · January 30, 2011 12:46:16 PM Two classic sorting algorithms Critical components in the world’s computational infrastructure. • Full scientific understanding of their properties has enabled us to develop them into practical system sorts. • Quicksort honored as one of top 10 algorithms of 20th century in science and engineering. Mergesort. last lecture • Java sort for objects. • Perl, C++ stable sort, Python stable sort, Firefox JavaScript, ... Quicksort. this lecture • Java sort for primitive types. • C qsort, Unix, Visual C++, Python, Matlab, Chrome JavaScript, ... 2 ‣ quicksort ‣ selection ‣ duplicate keys ‣ system sorts 3 Quicksort Basic plan. • Shuffle the array. • Partition so that, for some j - element a[j] is in place - no larger element to the left of j j - no smaller element to the right of Sir Charles Antony Richard Hoare • Sort each piece recursively. 1980 Turing Award input Q U I C K S O R T E X A M P L E shu!e K R A T E L E P U I M Q C X O S partitioning element partition E C A I E K L P U T M Q R X O S not greater not less sort left A C E E I K L P U T M Q R X O S sort right A C E E I K L M O P Q R S T U X result A C E E I K L M O P Q R S T U X Quicksort overview 4 Quicksort partitioning Basic plan.
    [Show full text]
  • Advanced Topics in Sorting
    Advanced Topics in Sorting complexity system sorts duplicate keys comparators 1 complexity system sorts duplicate keys comparators 2 Complexity of sorting Computational complexity. Framework to study efficiency of algorithms for solving a particular problem X. Machine model. Focus on fundamental operations. Upper bound. Cost guarantee provided by some algorithm for X. Lower bound. Proven limit on cost guarantee of any algorithm for X. Optimal algorithm. Algorithm with best cost guarantee for X. lower bound ~ upper bound Example: sorting. • Machine model = # comparisons access information only through compares • Upper bound = N lg N from mergesort. • Lower bound ? 3 Decision Tree a < b yes no code between comparisons (e.g., sequence of exchanges) b < c a < c yes no yes no a b c b a c a < c b < c yes no yes no a c b c a b b c a c b a 4 Comparison-based lower bound for sorting Theorem. Any comparison based sorting algorithm must use more than N lg N - 1.44 N comparisons in the worst-case. Pf. Assume input consists of N distinct values a through a . • 1 N • Worst case dictated by tree height h. N ! different orderings. • • (At least) one leaf corresponds to each ordering. Binary tree with N ! leaves cannot have height less than lg (N!) • h lg N! lg (N / e) N Stirling's formula = N lg N - N lg e N lg N - 1.44 N 5 Complexity of sorting Upper bound. Cost guarantee provided by some algorithm for X. Lower bound. Proven limit on cost guarantee of any algorithm for X.
    [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]
  • Super Scalar Sample Sort
    Super Scalar Sample Sort Peter Sanders1 and Sebastian Winkel2 1 Max Planck Institut f¨ur Informatik Saarbr¨ucken, Germany, [email protected] 2 Chair for Prog. Lang. and Compiler Construction Saarland University, Saarbr¨ucken, Germany, [email protected] Abstract. Sample sort, a generalization of quicksort that partitions the input into many pieces, is known as the best practical comparison based sorting algorithm for distributed memory parallel computers. We show that sample sort is also useful on a single processor. The main algorith- mic insight is that element comparisons can be decoupled from expensive conditional branching using predicated instructions. This transformation facilitates optimizations like loop unrolling and software pipelining. The final implementation, albeit cache efficient, is limited by a linear num- ber of memory accesses rather than the O(n log n) comparisons. On an Itanium 2 machine, we obtain a speedup of up to 2 over std::sort from the GCC STL library, which is known as one of the fastest available quicksort implementations. 1 Introduction Counting comparisons is the most common way to compare the complexity of comparison based sorting algorithms. Indeed, algorithms like quicksort with good sampling strategies [9,14] or merge sort perform close to the lower bound of log n! n log n comparisons3 for sorting n elements and are among the best algorithms≈ in practice (e.g., [24, 20, 5]). At least for numerical keys it is a bit astonishing that comparison operations alone should be good predictors for ex- ecution time because comparing numbers is equivalent to subtraction — an operation of negligible cost compared to memory accesses.
    [Show full text]
  • How to Sort out Your Life in O(N) Time
    How to sort out your life in O(n) time arel Číže @kaja47K funkcionaklne.cz I said, "Kiss me, you're beautiful - These are truly the last days" Godspeed You! Black Emperor, The Dead Flag Blues Everyone, deep in their hearts, is waiting for the end of the world to come. Haruki Murakami, 1Q84 ... Free lunch 1965 – 2022 Cramming More Components onto Integrated Circuits http://www.cs.utexas.edu/~fussell/courses/cs352h/papers/moore.pdf He pays his staff in junk. William S. Burroughs, Naked Lunch Sorting? quicksort and chill HS 1964 QS 1959 MS 1945 RS 1887 quicksort, mergesort, heapsort, radix sort, multi- way merge sort, samplesort, insertion sort, selection sort, library sort, counting sort, bucketsort, bitonic merge sort, Batcher odd-even sort, odd–even transposition sort, radix quick sort, radix merge sort*, burst sort binary search tree, B-tree, R-tree, VP tree, trie, log-structured merge tree, skip list, YOLO tree* vs. hashing Robin Hood hashing https://cs.uwaterloo.ca/research/tr/1986/CS-86-14.pdf xs.sorted.take(k) (take (sort xs) k) qsort(lotOfIntegers) It may be the wrong decision, but fuck it, it's mine. (Mark Z. Danielewski, House of Leaves) I tell you, my man, this is the American Dream in action! We’d be fools not to ride this strange torpedo all the way out to the end. (HST, FALILV) Linear time sorting? I owe the discovery of Uqbar to the conjunction of a mirror and an Encyclopedia. (Jorge Luis Borges, Tlön, Uqbar, Orbis Tertius) Sorting out graph processing https://github.com/frankmcsherry/blog/blob/master/posts/2015-08-15.md Radix Sort Revisited http://www.codercorner.com/RadixSortRevisited.htm Sketchy radix sort https://github.com/kaja47/sketches (thinking|drinking|WTF)* I know they accuse me of arrogance, and perhaps misanthropy, and perhaps of madness.
    [Show full text]
  • Advanced Topics in Sorting  List RSS News Items in Reverse Chronological Order
    Sorting applications Sorting algorithms are essential in a broad variety of applications Organize an MP3 library. Display Google PageRank results. Advanced Topics in Sorting List RSS news items in reverse chronological order. Find the median. Find the closest pair. Binary search in a database. [email protected] Identify statistical outliers. Find duplicates in a mailing list. [email protected] Data compression. Computer graphics. Computational biology. Supply chain management. Load balancing on a parallel computer. http://www.4shared.com/file/79096214/fb2ed224/lect01.html . Sorting algorithms Which algorithm to use? Many sorting algorithms to choose from Applications have diverse attributes Stable? Internal sorts Multiple keys? Insertion sort, selection sort, bubblesort, shaker sort. Quicksort, mergesort, heapsort, samplesort, shellsort. Deterministic? Solitaire sort, red-black sort, splaysort, Dobosiewicz sort, psort, ... Keys all distinct? External sorts Multiple key types? Poly-phase mergesort, cascade-merge, oscillating sort. Linked list or arrays? Radix sorts Large or small records? Distribution, MSD, LSD. 3-way radix quicksort. Is your file randomly ordered? Parallel sorts Need guaranteed performance? Bitonic sort, Batcher even-odd sort. Smooth sort, cube sort, column sort. Cannot cover all combinations of attributes. GPUsort. 1 Case study 1 Case study 2 Problem Problem Sort a huge randomly-ordered file of small Sort a huge file that is already almost in records. order. Example Example Process transaction records for a phone Re-sort a huge database after a few company. changes. Which sorting method to use? Which sorting method to use? 1. Quicksort: YES, it's designed for this problem 1. Quicksort: probably no, insertion simpler and faster 2.
    [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]
  • Mergesort and Quicksort
    Algorithms ROBERT SEDGEWICK | KEVIN WAYNE 2.2 MERGESORT ‣ mergesort ‣ bottom-up mergesort Algorithms ‣ sorting complexity FOURTH EDITION ‣ comparators ‣ stability ROBERT SEDGEWICK | KEVIN WAYNE http://algs4.cs.princeton.edu Two classic sorting algorithms: mergesort and quicksort Critical components in the world’s computational infrastructure. ・Full scientific understanding of their properties has enabled us to develop them into practical system sorts. ・Quicksort honored as one of top 10 algorithms of 20th century in science and engineering. Mergesort. [this lecture] ... Quicksort. [next lecture] ... 2 2.2 MERGESORT ‣ mergesort ‣ bottom-up mergesort Algorithms ‣ sorting complexity ‣ comparators ‣ stability ROBERT SEDGEWICK | KEVIN WAYNE http://algs4.cs.princeton.edu Mergesort Basic plan. ・Divide array into two halves. ・Recursively sort each half. ・Merge two halves. input M E R G E S O R T E X A M P L E sort left half E E G M O R R S T E X A M P L E sort right half E E G M O R R S A E E L M P T X merge results A E E E E G L M M O P R R S T X Mergesort overview 4 Abstract in-place merge demo Goal. Given two sorted subarrays a[lo] to a[mid] and a[mid+1] to a[hi], replace with sorted subarray a[lo] to a[hi]. lo mid mid+1 hi a[] E E G M R A C E R T sorted sorted 5 Abstract in-place merge demo Goal. Given two sorted subarrays a[lo] to a[mid] and a[mid+1] to a[hi], replace with sorted subarray a[lo] to a[hi].
    [Show full text]
  • Algorithms ROBERT SEDGEWICK | KEVIN WAYNE
    Algorithms ROBERT SEDGEWICK | KEVIN WAYNE 2.2 MERGESORT ‣ mergesort ‣ bottom-up mergesort Algorithms ‣ sorting complexity FOURTH EDITION ‣ divide-and-conquer ROBERT SEDGEWICK | KEVIN WAYNE https://algs4.cs.princeton.edu Last updated on 9/26/19 4:36 AM Two classic sorting algorithms: mergesort and quicksort Critical components in the world’s computational infrastructure. Full scientific understanding of their properties has enabled us to develop them into practical system sorts. Quicksort honored as one of top 10 algorithms of 20th century in science and engineering. Mergesort. [this lecture] ... Quicksort. [next lecture] ... 2 2.2 MERGESORT ‣ mergesort ‣ bottom-up mergesort Algorithms ‣ sorting complexity ‣ divide-and-conquer ROBERT SEDGEWICK | KEVIN WAYNE https://algs4.cs.princeton.edu Mergesort Basic plan. Divide array into two halves. Recursively sort each half. Merge two halves. input M E R G E S O R T E X A M P L E sort left half E E G M O R R S T E X A M P L E sort right half E E G M O R R S A E E L M P T X merge results A E E E E G L M M O P R R S T X Mergesort overview 4 Abstract in-place merge demo Goal. Given two sorted subarrays a[lo] to a[mid] and a[mid+1] to a[hi], replace with sorted subarray a[lo] to a[hi]. lo mid mid+1 hi a[] E E G M R A C E R T sorted sorted 5 Mergesort: Transylvanian–Saxon folk dance http://www.youtube.com/watch?v=XaqR3G_NVoo 6 Merging: Java implementation private static void merge(Comparable[] a, Comparable[] aux, int lo, int mid, int hi) { for (int k = lo; k <= hi; k++) copy aux[k] = a[k]; int i = lo, j = mid+1; merge for (int k = lo; k <= hi; k++) { if (i > mid) a[k] = aux[j++]; else if (j > hi) a[k] = aux[i++]; else if (less(aux[j], aux[i])) a[k] = aux[j++]; else a[k] = aux[i++]; } } lo i mid j hi aux[] A G L O R H I M S T k a[] A G H I L M 7 Mergesort quiz 1 How many calls does merge() make to less() in order to merge two sorted subarrays, each of length n / 2, into a sorted array of length n? A.
    [Show full text]
  • Msc THESIS FPGA-Based High Throughput Merge Sorter
    Computer Engineering 2018 Mekelweg 4, 2628 CD Delft The Netherlands http://ce.et.tudelft.nl/ MSc THESIS FPGA-Based High Throughput Merge Sorter Xianwei Zeng Abstract As database systems have shifted from disk-based to in-memory, and the scale of the database in big data analysis increases significantly, the workloads analyzing huge datasets are growing. Adopting FP- GAs as hardware accelerators improves the flexibility, parallelism and power consumption versus CPU-only systems. The accelerators CE-MS-2018-02 are also required to keep up with high memory bandwidth provided by advanced memory technologies and new interconnect interfaces. Sorting is the most fundamental database operation. In multiple- pass merge sorting, the final pass of the merge operation requires significant throughput performance to keep up with the high mem- ory bandwidth. We study the state-of-the-art hardware-based sorters and present an analysis of our own design. In this thesis, we present an FPGA-based odd-even merge sorter which features throughput of 27.18 GB/s when merging 4 streams. Our design also presents stable throughput performance when the number of input streams is increased due to its high degree of parallelism. Thanks to such a generic design, the odd-even merge sorter does not suffer through- put drop for skewed data distributions and presents constant perfor- mance over various kinds of input distributions. Faculty of Electrical Engineering, Mathematics and Computer Science FPGA-Based High Throughput Merge Sorter THESIS submitted in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE in ELECTRICAL ENGINEERING by Xianwei Zeng born in GUANGDONG, CHINA Computer Engineering Department of Electrical Engineering Faculty of Electrical Engineering, Mathematics and Computer Science Delft University of Technology FPGA-Based High Throughput Merge Sorter by Xianwei Zeng Abstract As database systems have shifted from disk-based to in-memory, and the scale of the database in big data analysis increases significantly, the workloads analyzing huge datasets are growing.
    [Show full text]
  • FPGA-Accelerated Samplesort for Large Data Sets
    FPGA-Accelerated Samplesort for Large Data Sets Han Chen, Sergey Madaminov, Michael Ferdman, Peter Milder Stony Brook University {han.chen.2,peter.milder}@stonybrook.edu,{smadaminov,mferdman}@cs.stonybrook.edu ABSTRACT 1 INTRODUCTION Sorting is a fundamental operation in many applications such as Sorting data has always been one of the fundamental computing databases, search, and social networks. Although FPGAs have been operations. In the early days of computing, studies showed that shown very effective at sorting data sizes that fit on chip, systems 25% of all CPU time was spent on sort [13]. Today, application com- that sort larger data sets by shuffling data on and off chipare plexity has increased and data sets have grown to unprecedented bottlenecked by costly merge operations or data transfer time. sizes, with sort remaining a critical component of the dominant dat- We propose a new technique for sorting large data sets, which acenter workloads such as large-scale data warehouses, databases, uses a variant of the samplesort algorithm on a server with a PCIe- and web search. At datacenter scale, there is a constant need for connected FPGA. Samplesort avoids merging by randomly sampling large-scale sorting operations [9, 10], with performance and cost values to determine how to partition data into non-overlapping of running sort being a major consideration of application design. buckets that can be independently sorted. The key to our design is a The popularity of the sort operation has led to the development novel parallel multi-stage hardware partitioner, which is a scalable of many sorting algorithms with different properties, including the high-throughput solution that greatly accelerates the samplesort ubiquitous quicksort [11, 12] and mergesort [5].
    [Show full text]
  • Implementations of Randomized Sorting on Large Parallel Machines
    Implementations of Randomized Sorting on Large Parallel Machines (Preliminary Version) William L. Hightower Jan F. Prins† John H. Reif‡ Elon College University of North Carolina Duke University Elon College NC 27244 Chapel Hill NC 27599-3175 Durham NC 27706 Abstract 1. Introduction Flashsort [RV83,86] and Samplesort [HC83] are Considerable effort has been made by the theoretical related parallel sorting algorithms proposed in the literature. community in the design of parallel algorithms with Both utilize a sophisticated randomized sampling technique excellent and sometimes optimal asymptotic efficiency. to form a splitter set, but Samplesort distributes the splitter However, the field has had less success in demonstrating the set to each processor while Flashsort uses splitter-directed utility of these algorithms by actual implementations. routing. Ideally, the analysis of parallel algorithms should proceed In this paper we present B-Flashsort, a new beyond asymptotic efficiency and be extended to the level of batched-routing variant of Flashsort designed to sort N>P implementations. In practice, this is difficult to do. values using P processors connected in a d-dimensional mesh and using constant space in addition to the input and For one thing, the relation between the asymptotic output. The key advantage of the Flashsort approach over complexity of an algorithm and the performance of an Samplesort is a decrease in memory requirements, by implementation can be considerably more complex for avoiding the broadcast of the splitter set to all processors. implementations of parallel algorithms than for sequential The practical advantage of B-Flashsort over Flashsort is that algorithms. For example, the number of processors or the it replaces pipelined splitter-directed routing with a set of amount of memory available to a processor in existing synchronous local communications and bounds recursion, machines can easily be reached well before the while still being demonstrably efficient.
    [Show full text]