pika is a C++ library for concurrency and parallelism. It implements senders/receivers (as proposed in P2300) for CPU thread pools, MPI, and CUDA.
pika requires:
- a C++17-capable compiler:
- CMake 3.22.0 or greater
- header-only Boost 1.71.0 or greater
- hwloc 1.11.5 or greater
- fmt
pika optionally requires:
- gperftools/tcmalloc, jemalloc, or mimalloc
- CUDA 11.0 or greater
- HIP 5.2.0 or greater
- MPI
- Boost.Context, Thread, and Chrono on macOS
- stdexec when
PIKA_WITH_P2300_REFERENCE_IMPLEMENTATION
is enabled (currently tested with commit 6510f5bd69cc03b24668f26eda3dd3cca7e81bb2). The integration is experimental.
pika is built using CMake. Please see the documentation of
CMake for help on how to use it. Dependencies are usually available in
distribution repositories. Alternatively, pika can be built using spack (pika spack package). The pika
repository also includes a shell.nix
file for use with nix. The file includes dependencies
for regular development. It is provided for convenience only and is not
comprehensive or guaranteed to be up to date. It may require the nixos unstable
channel.
pika is configured using CMake variables. The most important variables are:
PIKA_WITH_MALLOC
: This defaults totcmalloc
which requires gperftools. Can be set totcmalloc
,jemalloc
,mimalloc
, orsystem
. Setting it tosystem
can be useful in debug builds.PIKA_WITH_CUDA
: Enable CUDA support.PIKA_WITH_HIP
: Enable HIP support.PIKA_WITH_MPI
: Enable MPI support.PIKA_WITH_GENERIC_CONTEXT_COROUTINES
: Enable the use of Boost.Context for fiber context switching. This has to be enabled on non-Linux and non-x86 platforms.
Tests and examples are disabled by default and can be enabled with
PIKA_WITH_TESTS
, PIKA_WITH_TESTS_*
, and PIKA_WITH_EXAMPLES
. Note
that reconfiguring pika with PIKA_WITH_TESTS=ON
after the option has been
off the individual subcategories of PIKA_WITH_TESTS_*
must be also enabled
explicitly. Use e.g. ccmake
or CMakeCache.txt
for a list of
subcategories. The tests must be explicitly built before running them, e.g.
with `cmake --build . --target tests && ctest --output-on-failure
.
Documentation is a work in progress. The following headers are part of the public API. Any other headers are internal implementation details.
pika/barrier.hpp
pika/channel.hpp
pika/condition_variable.hpp
pika/cuda.hpp
pika/execution.hpp
pika/latch.hpp
pika/mpi.hpp
pika/mutex.hpp
pika/runtime.hpp
pika/semaphore.hpp
pika/shared_mutex.hpp
pika/thread.hpp
pika is a fork of HPX focusing on the single-node use case complemented by minimal MPI support.
Pick your favourite meaning from the following: