QMCPACK
MPIExceptionWrapper Class Reference
+ Collaboration diagram for MPIExceptionWrapper:

Public Member Functions

 MPIExceptionWrapper ()
 
template<typename F , typename... Args>
void operator() (F &&f, Args &&... args)
 Call an arbitrary function that can throw an exception catch it, extract message, and call APP_ABORT. More...
 

Detailed Description

Definition at line 20 of file MPIExceptionWrapper.hpp.

Constructor & Destructor Documentation

◆ MPIExceptionWrapper()

MPIExceptionWrapper ( )
inline

Definition at line 23 of file MPIExceptionWrapper.hpp.

23 {};

Member Function Documentation

◆ operator()()

void operator() ( F &&  f,
Args &&...  args 
)

Call an arbitrary function that can throw an exception catch it, extract message, and call APP_ABORT.

Definition at line 35 of file MPIExceptionWrapper.hpp.

References APP_ABORT.

36 {
37  try
38  {
39  f(std::forward<Args>(args)...);
40  }
41  catch (const std::exception& re)
42  {
43  APP_ABORT(re.what());
44  }
45  catch (...)
46  {
47  APP_ABORT("MPIExceptionWrapper caught an unknown exception!");
48  }
49 
50 }
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

The documentation for this class was generated from the following file: