Skip to main content

parallel-sort

Test build PyPI version

This module provides a simple Cython interface to parallel sorting algorithms available in C++. It provides functions for in-place and out-of-place sorts, as well as indirect sorting (aka. "argsort").

By default it requires a C++17-capable compiler, and will use the standard std::sortroutine with the parallel execution policy introduced in that standard. For older compilers without C++17 support, the GNU Parallel Mode sorting routines may be used instead.

Usage

import parallel_sort
import numpy as np

x = np.random.random(size=10000)

x_sorted = parallel_sort.sort(x)

assert np.all(np.diff(x) >= 0) # x is now sorted

Note that these routines are "unstable" sorts, meaning that the ordering of equal elements in the original array is not guaranteed to be preserved.

Installing

Requirements: numpy, C++17-capable g++, Cython (only for installation from source).

Linux

Installing from wheel via pip should "just work":

pip install parallel_sort

To install from source, Intel TBB must first be installed via your distribution's package manager.

Mac

Wheels are not available. To install from source, Homebrew is required, with the following packages installed:

  • gcc
  • tbb
  • pkg-config

The module must be compiled using Homebrew's gcc, which can be done by prefixing the install command with CXX=$(brew --prefix gcc)/bin/g++-14 (substituting your gcc version as appropriate).

GNU Parallel Mode option

For older compilers that do not support C++17, the module can use the GNU Parallel Mode library instead. To build without C++17, clone the repository and set use_cxx17 = False in setup.py. Then run:

pip install -e .

to compile and install the module.

Note for Apple Silicon Macs

If the module builds OK, but importing it fails with an error "undefined reference to aarch64_ldadd4_acq_rel", try rebuilding with the following command

CFLAGS=-mno-outline-atomics CXX=$(brew --prefix gcc)/bin/g++-14 pip install --no-cache-dir -e .

Metadata

Release files for parallel-sort 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parallel-sort 0.2.1
File Size Uploaded
parallel_sort-0.2.1.tar.gz 206.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for parallel-sort 0.2.1
File
parallel_sort-0.2.1-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
parallel_sort-0.2.1-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
parallel_sort-0.2.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
parallel_sort-0.2.1-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
parallel_sort-0.2.1-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details
parallel_sort-0.2.1-cp38-cp38-manylinux_2_28_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.28+ x86-64 Details
parallel_sort-0.2.1-cp37-cp37m-manylinux_2_28_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.28+ x86-64 Details

Total release size: 18.8 MB

Release files / parallel_sort-0.2.1.tar.gz

Download URL parallel_sort-0.2.1.tar.gz
Size 206.1 kB
Tags Source
SHA-256 checksum
How to use checksums
08718bf98c1fd2e5903170016b452c8881918520428a79aa833905c900ce243b
BLAKE2b-256 checksum
How to use checksums
6603968da23a672edbef9abca5c0a7ffe9c5a84213077bcd0d828d968ece1b76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / parallel_sort-0.2.1-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL parallel_sort-0.2.1-cp313-cp313-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1d05f8e8b5dd78ce6280bf36932b45f602c8f9f0e1cb2b4f64a4ebf8414cab29
BLAKE2b-256 checksum
How to use checksums
2d81a6e1b8ac450bb5d9f5a212911e0e38a88d8f66997cb83de150c5b9026183
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / parallel_sort-0.2.1-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL parallel_sort-0.2.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6be8bb0050853dcc5c78cb3b675656d9073b9feb767f1ecc866607f7a447e0a9
BLAKE2b-256 checksum
How to use checksums
ae81f06e49042ed64ef5b23eec82f2b453c8eab3622ab2e5452fcd37e7140f41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / parallel_sort-0.2.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL parallel_sort-0.2.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
04002ceead64cc7254c23bbec76520243f178821173d57906f1787868b27b3f4
BLAKE2b-256 checksum
How to use checksums
44535d131bb70e57d7d557f899754b2232944973bfbb10e83d175d52c40a36e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / parallel_sort-0.2.1-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL parallel_sort-0.2.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
781b73dd0bcd195856deada1016f413ae0c8557052fb40700f33521e542d5dcb
BLAKE2b-256 checksum
How to use checksums
c4c7dc9e8a5dadcd334cf9f0683aee30390218fb5b9f3f934e29f7debf8bcc86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / parallel_sort-0.2.1-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL parallel_sort-0.2.1-cp39-cp39-manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d3618cff9d87fc893b4f50529a7a244b3b0d6f56bbee38cbdf8d09ef225c0668
BLAKE2b-256 checksum
How to use checksums
111aa5918ebcc6c2f102be5f66e8c08b09874632566a9f797505681aa35bf178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / parallel_sort-0.2.1-cp38-cp38-manylinux_2_28_x86_64.whl

Download URL parallel_sort-0.2.1-cp38-cp38-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
483371de6b53be8ab6e73698110fd2176d0bd8d9f31507f109d7ba4b51567dda
BLAKE2b-256 checksum
How to use checksums
456d33631e5d821397d3e9c67592285cbff09ce5ca00092ff681eff2224e8c6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / parallel_sort-0.2.1-cp37-cp37m-manylinux_2_28_x86_64.whl

Download URL parallel_sort-0.2.1-cp37-cp37m-manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bf258f7b1c454e5a0ce5e1d7ffa42f5cf30a25d81bfa71379c7cafc80cc89c46
BLAKE2b-256 checksum
How to use checksums
6d6235eae390bf55bae43f771ee65c2b79065d03820823a37559ffe95648b2d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

0.2.1 This release

8 release files

0.2.0

6 release files

0.1.1

7 release files

0.1.0

6 release files

0.0.3

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page