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

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Human.MPI

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.

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;

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
  • MPI error checking
  • Not exhaustive but simple to extend

Macro

  • -DCMAKE_BUILD_TYPE=Debug
  • -DUSE_HUMAN_MPI use the lib

Testsuite

The testsuite is run on push and pull request using GitHub Actions

Roadmap

  • 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

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