ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
errorhandling.hpp File Reference

This file contains the errorhandling code for severe errors, like a broken bond or illegal parameter combinations. More...

#include "config/config.hpp"
#include "error_handling/RuntimeError.hpp"
#include "error_handling/RuntimeErrorStream.hpp"
#include <memory>
#include <string>
#include <vector>
+ Include dependency graph for errorhandling.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Communication
 
namespace  boost
 
namespace  boost::mpi
 
namespace  ErrorHandling
 

Macros

#define runtimeErrorMsg()
 
#define runtimeWarningMsg()
 

Functions

void errexit ()
 exit ungracefully, core dump if switched on.
 
int check_runtime_errors (boost::mpi::communicator const &comm)
 Count runtime errors on all nodes.
 
int check_runtime_errors_local ()
 Count runtime errors on the local node.
 
void flush_runtime_errors_local ()
 Flush runtime errors to standard error on the local node.
 
void ErrorHandling::init_error_handling (std::weak_ptr< Communication::MpiCallbacks > callbacks)
 Initialize the error collection system.
 
RuntimeErrorStream ErrorHandling::_runtimeMessageStream (RuntimeError::ErrorLevel level, const std::string &file, const int line, const std::string &function)
 
std::vector< RuntimeErrorErrorHandling::mpi_gather_runtime_errors ()
 Gather messages on main rank.
 
std::vector< RuntimeErrorErrorHandling::mpi_gather_runtime_errors_all (bool is_head_node)
 Gather messages on main rank.
 

Detailed Description

This file contains the errorhandling code for severe errors, like a broken bond or illegal parameter combinations.

Definition in file errorhandling.hpp.

Macro Definition Documentation

◆ runtimeErrorMsg

#define runtimeErrorMsg ( )
Value:
ESPRESSO_PRETTY_FUNCTION_EXTENSION)
RuntimeErrorStream _runtimeMessageStream(RuntimeError::ErrorLevel level, const std::string &file, const int line, const std::string &function)

Definition at line 95 of file errorhandling.hpp.

◆ runtimeWarningMsg

#define runtimeWarningMsg ( )
Value:

Definition at line 100 of file errorhandling.hpp.

Function Documentation

◆ check_runtime_errors()

int check_runtime_errors ( boost::mpi::communicator const &  comm)

Count runtime errors on all nodes.

This has to be called on all nodes synchronously.

Returns
the number of error messages of all nodes together.

Definition at line 95 of file errorhandling.cpp.

References check_runtime_errors_local().

Referenced by System::System::integrate().

◆ check_runtime_errors_local()

int check_runtime_errors_local ( )

Count runtime errors on the local node.

This has to be called on all nodes synchronously.

Returns
the number of error messages on this node.

Definition at line 90 of file errorhandling.cpp.

Referenced by check_runtime_errors().

◆ errexit()

void errexit ( )

exit ungracefully, core dump if switched on.

Definition at line 84 of file errorhandling.cpp.

References ErrorHandling::m_callbacks.

Referenced by cuda_check_errors_exit(), cuda_safe_mem_exit(), and Mpiio::fatal_error().

◆ flush_runtime_errors_local()

void flush_runtime_errors_local ( )

Flush runtime errors to standard error on the local node.

This is used to clear pending runtime error messages when the call site is handling an exception that needs to be re-thrown instead of being queued as an additional runtime error message.

Definition at line 100 of file errorhandling.cpp.

References ErrorHandling::runtimeErrorCollector.