Gromacs  2026.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
coordinate_exception_handling.h File Reference
#include <exception>
#include <type_traits>
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxmpi.h"
+ Include dependency graph for coordinate_exception_handling.h:
+ This graph shows which files directly or indirectly include this file:

Description

This declares a helper routine for coordinating behavior when only a subset of MPI ranks might throw.

Author
Mark Abraham mark..nosp@m.j.ab.nosp@m.raham.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Functions

static void gmx::detail::coordinateMpiRanks (MPI_Comm communicator, const bool thisRankThrew, const std::exception_ptr &exceptionPtr)
 If any rank threw, make sure all throw. More...
 
template<typename Callable >
auto gmx::coordinateExceptionHandling (MPI_Comm communicator, Callable callable) -> typename std::invoke_result_t< Callable >
 Call the callable and then make sure all MPI ranks of communicator have consistent exception-throwing behaviour. More...