Skip to content

A vanilla header-only object oriented, interface around MPI in C++

License

Notifications You must be signed in to change notification settings

kennethassogba/human.mpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Human.MPI

A vanilla header-only object oriented interface around MPI in C++.

Usage

#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

Build an example

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

Features

  • Send vector and string with automatic resize
  • Time events and display time table
  • Not exhaustive but simple to extend

Macro

  • -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

Roadmap

  • 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

Write

  • Developping an interface around MPI

Inspired by Boost.MPI

About

A vanilla header-only object oriented, interface around MPI in C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published