oneapi-src / distributed-ranges

Distributed ranges is a generalization of C++ ranges for distributed data structures.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Distributed Ranges

image

Productivity library for distributed and partitioned memory based on C++ Ranges.

Overview slides

The documentation is built from main branch on every commit and published at latest spec and latest doxygen.

Benchmark results

Environment Setup

On Ubuntu 22.04:

sudo apt install g++-12

If you want to build the document or run the pre-commit checks, you must install some python packages. Create a python virtual environment and install dependencies:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Activate virtual environment:

source venv/bin/activate

For benchmarking:

pip install src-python/drbench

Examples

Build and test with gcc for CPU:

CXX=g++-12 cmake -B build
make -C build -j all test

Build and test with ipcx for SYCL && CPU:

CXX=icpx cmake -B build -DENABLE_SYCL=ON

Build and test with ipcx for SYCL && CPU on devcloud:

CXX=icpx cmake -B build -DENABLE_SYCL=ON -DENABLE_MPIFORK=on

See how example is run and the output:

cd build
ctest -VV

Logging

Add this to your main to enable logging:

std::ofstream logfile(fmt::format("dr.{}.log", comm_rank));
dr::drlog.set_file(logfile);

Adding DR to a project

If your project uses CMAKE, add the following to your CMakeLists.txt to download the library:

find_package(MPI REQUIRED)
include(FetchContent)
FetchContent_Declare(
  dr
  GIT_REPOSITORY https://github.com/oneapi-src/distributed-ranges.git
  GIT_TAG main
  )
FetchContent_MakeAvailable(dr)

The above will define targets that can be included in your project:

target_link_libraries(<application> MPI::MPI_CXX DR::mpi)

If your project does not use CMAKE, then you need to download the library, and install it into a prefix:

git clone https://github.com/oneapi-src/distributed-ranges.git dr
cd dr
cmake -B build -DCMAKE_INSTALL_PREFIX=<prefix>
make -C build install
cmake -B build-fmt -DCMAKE_INSTALL_PREFIX=<prefix> build/_deps/cpp-format-src
make -C build-fmt install

Use -I and -L to find headers and libs during compilation:

g++ -std=c=++20 -I <prefix>/include -L <prefix>/lib -L /opt/intel/oneapi/mpi/latest/lib/release -lfmt -lmpicxx -lmpi

Developer Information

Submitting a PR

Follow the standard github workflow. Fork this repo, clone your fork, make changes, commit to a new branch, push branch to your fork. Submit a PR from your fork.

The CI runs static checks and runs the test system. See pre-commit for information on failing static checks.

See also

Fuzz Testing

Fuzz testing of distributed ranges APIs

Spec Editing

Editing the API document

Print Type

Print types at compile time:

Testing

Test system maintenance

Security

Security policy

About

Distributed ranges is a generalization of C++ ranges for distributed data structures.


Languages

Language:C++ 95.5%Language:CMake 3.4%Language:Python 0.7%Language:Shell 0.4%