Cython interface to GNU Parallel sorting routines
Project description
parallel-sort
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 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
Installing
Requirements: numpy, OpenMP, C++17-capable g++, Cython (only for installation from source).
Installing from wheel via pip
should "just work":
pip install parallel_sort
Alternatively, the module can be built for older compilers that do not support C++17, but do supply the GNU Parallel Mode library. 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.
Installation has been tested on linux (Ubuntu, CentOS) and Mac (via Homebrew).
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 (substituting your gcc version as appropriate):
CFLAGS=-mno-outline-atomics CC=$(brew --prefix gcc)/bin/gcc-13 pip install --no-cache-dir -e .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for parallel_sort-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c86c8fb376146eaf0957c3dd66c49df4d33ae99f99c23e81534a9275a908c97b |
|
MD5 | 33aa93bdbad4227723255c00460d45b6 |
|
BLAKE2b-256 | 763edb3cadfa5a639fc8bb4da8de489b5530b5458f9a6160b44038e2db9f5b8f |
Hashes for parallel_sort-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 316189d583cce9d2b0cfb163326cf59bab2f15c276cbc314c0d8393d1494f384 |
|
MD5 | eaf5f9e43202579b02aa8b87cf03e47d |
|
BLAKE2b-256 | c4f419c795b4d02e5223dcc6b0f071eef3b654850eb2d6b7f97d23fa1c2c4a5e |
Hashes for parallel_sort-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3f1d26e3edd0db4906ab68a0b586e4aebb572ee2987e60abe9af60a490a253a |
|
MD5 | 661f9417f96d5ff7e3c8f2ceaa7b5031 |
|
BLAKE2b-256 | 75000a529c7d6c8c535247dadb1790e4d7081b07af2d7e260c515093a13a5090 |
Hashes for parallel_sort-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d77e9d3271d8c39a40f41fa1c7049b63ad9ee431a70bc43d2a4c6fb8be1c179a |
|
MD5 | bd07f5caf9a13cdaa3c784dc1bdd0cf7 |
|
BLAKE2b-256 | de82a1170436c6d21d3c0b0da11dfab531b35bf03e0973ebb5156e7c5b129e24 |
Hashes for parallel_sort-0.1.1-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b53dfbd419a4ba8d4fe7bd80bfe5aed639da9064631236b488a06926b1eb59d |
|
MD5 | f7a10f12c72e73fe33285e6eb535fa00 |
|
BLAKE2b-256 | b14876eb36031dfbdfabe9eb82030dcd3958e364dff4f42f060bb42cbeb6254a |
Hashes for parallel_sort-0.1.1-cp36-cp36m-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02604c061171e8fecad5bdc85d4ebd86e7a79762b826c21f8c5f529e09813efc |
|
MD5 | 94594e3d4d5e7bcf5e23c0c3fabb8920 |
|
BLAKE2b-256 | 852fe53878869d49b12ff280e5fd9febbd7422a7eae44822e73add4d360703dd |