Skip to main content
QUICK REVIEW

[Paper Review] In-Place Parallel Super Scalar Samplesort (IPSSSSo)

Bertram, Nico, Ellert, Jonas|arXiv (Cornell University)|Jan 1, 2017
Parallel Computing and Optimization TechniquesComputer Science5 references7 citations
TL;DR

This paper introduces IPS4o, a highly efficient in-place parallel sorting algorithm that combines the cache efficiency and instruction-level parallelism of Super Scalar Samplesort with in-place execution and robustness to repeated keys. By using block-based permutations and eliminating recursion via stack-free distribution, IPS4o achieves O(n log n) work with high probability, outperforming its closest in-place competitor by up to 3x on multi-core systems and being up to 1.5x faster than BlockQuicksort sequentially.

ABSTRACT

Suffix sorting is arguably the most fundamental building block in string algorithmics, like regular sorting in the broader field of algorithms. It is thus not surprising that the literature is full of algorithms for suffix sorting, in particular focusing on their practicality. However, the advances on practical suffix sorting stalled with the emergence of the DivSufSort algorithm more than 10 years ago, which, up to date, has remained the fastest suffix sorter. This article shows how properties of Lyndon words can be exploited algorithmically to accelerate suffix sorting again. Our new algorithm is 6-19% faster than DivSufSort on real-world texts, and up to three times as fast on artificial repetitive texts. It can also be parallelized, where similar speedups can be observed. Thus, we make the first advances in practical suffix sorting after more than a decade of standstill.

Motivation & Objective

  • To develop a comparison-based sorting algorithm that is both in-place and highly parallelizable, addressing the limitations of traditional quicksort variants in modern hardware environments.
  • To eliminate the need for additional memory allocation while maintaining high performance on multi-core architectures and cache-friendly memory access patterns.
  • To improve upon existing in-place sorting algorithms by reducing memory overhead, avoiding branch mispredictions, and ensuring robust performance across diverse input distributions including duplicates and nearly sorted data.
  • To provide a practical, portable, and efficient alternative to standard library quicksort implementations that works well across different data types and hardware platforms.

Proposed method

  • Adapts Super Scalar Samplesort (s3-sort) by introducing block-based distribution to enable in-place execution without dynamic memory allocation.
  • Uses coarse-grained block permutations to move data directly between input blocks, reducing cache misses and improving data locality.
  • Employs atomic fetch-and-add operations to parallelize block permutation across threads, minimizing contention and enabling scalable multi-core execution.
  • Introduces a cleanup phase to handle partially filled buffer blocks and empty memory regions, ensuring correctness after distribution.
  • Eliminates the recursion stack through iterative distribution and block reordering, enabling strict in-place execution with O(1) extra space.
  • Applies optimizations for repeated keys by detecting and handling duplicate elements efficiently during distribution, improving performance on non-uniform inputs.

Experimental results

Research questions

  • RQ1Can a comparison-based sorting algorithm achieve both in-place execution and high parallel scalability without sacrificing cache efficiency or branch prediction safety?
  • RQ2How can distribution-based sorting algorithms like samplesort be made in-place without relying on dynamic memory allocation or complex memory management?
  • RQ3What techniques enable efficient parallelization of block permutation in an in-place setting while minimizing thread contention and ensuring load balance?
  • RQ4How does the performance of an in-place parallel sorting algorithm compare to non-in-place and sequential counterparts across diverse input distributions and hardware platforms?
  • RQ5To what extent can in-place sorting algorithms reduce memory access overhead (e.g., cache misses, write allocate misses) compared to non-in-place alternatives?

Key findings

  • IPS4o outperforms its closest in-place competitor by a factor of up to 3x on multi-core systems, demonstrating strong parallel scalability.
  • On 32 cores, IPS4o achieves a speedup of 28.71 over its sequential variant (IS4o), outperforming the fastest non-in-place competitor (PBBS) by a factor of 1.97.
  • For 2^29 elements of 100-byte objects, IPS4o is 2.67x faster than its in-place competitor and 1.33x faster than its non-in-place counterpart on Intel2S.
  • IPS4o scales well on multi-socket systems, though performance gains diminish beyond 16 cores due to NUMA effects and slower memory bandwidth.
  • The algorithm is up to 1.5x faster than BlockQuicksort in sequential mode, particularly on large data types like 100-byte objects, despite moving elements twice per distribution step.
  • IPS4o reduces memory overhead from allocation, associativity misses, and write-allocate misses, providing a performance advantage even over non-in-place algorithms in some cases.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.