TRIQS/mpi 1.3.0
C++ interface to MPI
Loading...
Searching...
No Matches
Overview

Table of Contents

build

‍This is the homepage of TRIQS/mpi 1.3.0. The source code can be found on GitHub.

#include <mpi/mpi.hpp>
#include <iostream>
int main(int argc, char *argv[]) {
// initialize MPI environment and communicator
mpi::environment env(argc, argv);
// get rank of process
int rank = world.rank();
// perform a reduce operation
int sum = mpi::reduce(rank, world);
// output the result on root
if (rank == 0) {
std::cout << "The sum of all ranks is " << sum << "\n";
}
}
C++ wrapper around MPI_Comm providing various convenience functions.
int rank() const
Get the rank of the calling process in the communicator.
decltype(auto) reduce(T &&x, communicator c={}, int root=0, bool all=false, MPI_Op op=MPI_SUM)
Generic MPI reduce.
Includes all relevant mpi headers.
RAII class to initialize and finalize MPI.

mpi is a minimal C++ wrapper around the MPI C library and provides only a small subset of the functionality defined in the MPI standard.

The main purpose of the library is to simplify the most common tasks like initializing/finalizing the MPI execution environment or performing non-blocking collective communications.

For more advanced tasks, the user can always resort to the underlying MPI C-implementation.

Where to start?

The Installation section tells you how to get the library and make it available on your system.

Integration in C++ projects explains how to integrate mpi in your own C++ code.

Then, you can start with the Examples section to get an overview of the library's features and how it can simplify basic MPI tasks.

Furthermore, we provide a detailed reference API Documentation to answer your questions.

If you experience any problem with the library, you can post an Issue on GitHub.