source: src/comm/mpi/error_handler.hpp@ 9fc7e1

Last change on this file since 9fc7e1 was 76e019, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Check that mpi.h will be included as the first header.

Needed by certain mpi implementations.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1248 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 801 bytes
Line 
1/**
2 * @file error_handler.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Nov 21 13:27:22 2011
5 *
6 * @brief Convert MPI errors to C++ exceptions. Used to be
7 * able to call a debugger when MPI crashes
8 * internally.
9 *
10 */
11
12#ifndef ERROR_HANDLER_HPP_
13#define ERROR_HANDLER_HPP_
14
15#ifdef HAVE_MPI
16
17#include <stdexcept>
18
19namespace VMG
20{
21
22namespace MPI
23{
24
25class Exception : public std::exception
26{
27public:
28 Exception(const std::string& what) :
29 std::exception(),
30 m_what(what)
31 {}
32
33 virtual ~Exception() throw()
34 {}
35
36 const char* what() const throw()
37 {
38 return m_what.c_str();
39 }
40
41protected:
42 std::string m_what;
43
44};
45
46 void ConvertToException(MPI_Comm* comm, int* err, ...);
47
48}
49
50}
51
52#endif /* HAVE_MPI */
53
54#endif /* ERROR_HANDLER_HPP_ */
Note: See TracBrowser for help on using the repository browser.