ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ErrorHandling Namespace Reference

Classes

struct  RuntimeError
 A runtime error. More...
 
class  RuntimeErrorCollector
 
class  RuntimeErrorStream
 Create a runtime error message via the streaming operator. More...
 

Functions

void init_error_handling (std::weak_ptr< Communication::MpiCallbacks > callbacks)
 Initialize the error collection system.
 
RuntimeErrorStream _runtimeMessageStream (RuntimeError::ErrorLevel level, const std::string &file, const int line, const std::string &function)
 
static void mpi_gather_runtime_errors_local ()
 
std::vector< RuntimeErrormpi_gather_runtime_errors ()
 Gather messages on main rank.
 
std::vector< RuntimeErrormpi_gather_runtime_errors_all (bool is_head_node)
 Gather messages on main rank.
 

Variables

static std::unique_ptr< RuntimeErrorCollectorruntimeErrorCollector
 RuntimeErrorCollector instance.
 
static std::weak_ptr< Communication::MpiCallbacksm_callbacks
 The callback loop we are on.
 

Function Documentation

◆ _runtimeMessageStream()

RuntimeErrorStream ErrorHandling::_runtimeMessageStream ( RuntimeError::ErrorLevel  level,
const std::string &  file,
const int  line,
const std::string &  function 
)

Definition at line 57 of file errorhandling.cpp.

References runtimeErrorCollector.

◆ init_error_handling()

void ErrorHandling::init_error_handling ( std::weak_ptr< Communication::MpiCallbacks callbacks)

Initialize the error collection system.

Parameters
callbacksCallbacks system the error handler should be on.

Definition at line 50 of file errorhandling.cpp.

References m_callbacks, and runtimeErrorCollector.

Referenced by Communication::init().

◆ mpi_gather_runtime_errors()

std::vector< RuntimeError > ErrorHandling::mpi_gather_runtime_errors ( )

Gather messages on main rank.

Only call from main rank.

Definition at line 70 of file errorhandling.cpp.

References m_callbacks, mpi_gather_runtime_errors_local(), and runtimeErrorCollector.

◆ mpi_gather_runtime_errors_all()

std::vector< RuntimeError > ErrorHandling::mpi_gather_runtime_errors_all ( bool  is_head_node)

Gather messages on main rank.

Call on all ranks.

Definition at line 75 of file errorhandling.cpp.

References runtimeErrorCollector.

◆ mpi_gather_runtime_errors_local()

static void ErrorHandling::mpi_gather_runtime_errors_local ( )
static

Definition at line 64 of file errorhandling.cpp.

References runtimeErrorCollector.

Referenced by mpi_gather_runtime_errors().

Variable Documentation

◆ m_callbacks

std::weak_ptr<Communication::MpiCallbacks> ErrorHandling::m_callbacks
static

The callback loop we are on.

Definition at line 48 of file errorhandling.cpp.

Referenced by errexit(), init_error_handling(), and mpi_gather_runtime_errors().

◆ runtimeErrorCollector

std::unique_ptr<RuntimeErrorCollector> ErrorHandling::runtimeErrorCollector
static

RuntimeErrorCollector instance.

This is a unique pointer so we don't leak on repeated calls of init_error_handling.

Definition at line 45 of file errorhandling.cpp.

Referenced by _runtimeMessageStream(), flush_runtime_errors_local(), init_error_handling(), mpi_gather_runtime_errors(), mpi_gather_runtime_errors_all(), and mpi_gather_runtime_errors_local().