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

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

vmg: Use MPI error handler only when compiled with --enable-debug.

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

  • Property mode set to 100644
File size: 835 bytes
RevLine 
[dfed1c]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
[379700]15#ifdef DEBUG
16
[dfed1c]17#ifdef HAVE_MPI
18
19#include <stdexcept>
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
[379700]56#endif /* DEBUG */
57
[dfed1c]58#endif /* ERROR_HANDLER_HPP_ */
Note: See TracBrowser for help on using the repository browser.