A vanilla header-only object oriented interface around MPI in C++.
#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;
world.display(); // display time table
mkdir build && cd build
cmake ..
make -j
or
cmake -B build
cmake --build build
Then try
mpiexec -n 2 build/usage
- Send
vector
andstring
with automatic resize - Time events and display time table
- Not exhaustive but simple to extend
- -DCMAKE_BUILD_TYPE=Debug
- -DUSE_HUMAN_MPI use the lib
- -DHUMAN_MPI_TIMER_USE_MPI=false use chrono
- -DHUMAN_MPI_TIMER_FOR_REAL=false disable timing
- Add mpi request in human::mpi
- Write tests using ctest or catch2
- Add async experiments
- Add multiple executable target in Cmake
- Configure Github action
- Simple Doc
- Developping an interface around MPI
Inspired by Boost.MPI