A simple header-only object oriented interface around MPI in C++. Inspired by Boost.MPI.
The companion note can be found at write MPI interface.
#include "human/mpi.hpp"
// ...
human::mpi::communicator world();
auto rank = world.rank();
auto size = world.size();
std::cout << "Process " << rank << "/" << size << std::endl;
std::string msg;
if (world.rank() == world.root()) msg = "Hello";
world.bcast(msg);
std::cout << "P" << rank << " " << msg << std::endl;
mkdir build && cd build
cmake ..
make -j
or
cmake -B build
cmake --build build
Then try
mpiexec -n 2 build/send
mpiexec -n 4 build/bcast
- Send
vector
andstring
with automatic resize MPI
error checking- Not exhaustive but simple to extend
- -DCMAKE_BUILD_TYPE=Debug
- -DUSE_HUMAN_MPI use the lib
The testsuite is run on push and pull request using GitHub Actions
- Add mpi request in human::mpi
- Write tests using ctest + gtest or catch2
- Add async experiments
- Add multiple executable target function in Cmake
- Simple Doc