KaMPIng 0.1.0
(Near) zero-overhead C++ MPI bindings.
Loading...
Searching...
No Matches
error_handling.hpp File Reference

Code for error handling. More...

#include <array>
#include <exception>
#include <string>
#include <kassert/kassert.hpp>
#include <mpi.h>

Go to the source code of this file.

Classes

class  kamping::MpiErrorException
 The exception type used when an MPI call did not return MPI_SUCCESS. More...
 

Macros

#define THROW_IF_MPI_ERROR(error_code, function)
 Wrapper around THROWING_KASSERT for MPI errors.
 

Detailed Description

Code for error handling.

Macro Definition Documentation

◆ THROW_IF_MPI_ERROR

#define THROW_IF_MPI_ERROR ( error_code,
function )
Value:
THROWING_KASSERT_SPECIFIED( \
error_code == MPI_SUCCESS, \
#function << " failed!", \
error_code \
);
The exception type used when an MPI call did not return MPI_SUCCESS.
Definition error_handling.hpp:47

Wrapper around THROWING_KASSERT for MPI errors.

Throws an MpiErrorException if the supplied error code is not MPI_SUCCESS.

The macro accepts 2 parameters:

  1. The error code returned by the MPI call.
  2. The MPI function that returned the error code.