source: src/comm/mpi/error_handler.hpp@ ab63b6

Last change on this file since ab63b6 was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

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

  • Property mode set to 100644
File size: 819 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
19#include <mpi.h>
20
21namespace VMG
22{
23
24namespace MPI
25{
26
27class Exception : public std::exception
28{
29public:
30 Exception(const std::string& what) :
31 std::exception(),
32 m_what(what)
33 {}
34
35 virtual ~Exception() throw()
36 {}
37
38 const char* what() const throw()
39 {
40 return m_what.c_str();
41 }
42
43protected:
44 std::string m_what;
45
46};
47
48 void ConvertToException(MPI_Comm* comm, int* err, ...);
49
50}
51
52}
53
54#endif /* HAVE_MPI */
55
56#endif /* ERROR_HANDLER_HPP_ */
Note: See TracBrowser for help on using the repository browser.