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

Implementation of errorhandling.hpp. More...

#include "errorhandling.hpp"
#include "MpiCallbacks.hpp"
#include "error_handling/RuntimeErrorCollector.hpp"
#include <boost/mpi/collectives.hpp>
#include <boost/mpi/communicator.hpp>
#include <cstdlib>
#include <functional>
#include <memory>
#include <string>
#include <utility>
#include <vector>
+ Include dependency graph for errorhandling.cpp:

Go to the source code of this file.

Namespaces

namespace  ErrorHandling
 

Functions

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)
 
static void ErrorHandling::mpi_gather_runtime_errors_local ()
 
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.
 
void errexit ()
 exit ungracefully, core dump if switched on.
 
int check_runtime_errors_local ()
 Count runtime errors on the local node.
 
int check_runtime_errors (boost::mpi::communicator const &comm)
 Count runtime errors on all nodes.
 
void flush_runtime_errors_local ()
 Flush runtime errors to standard error on the local node.
 

Variables

static std::unique_ptr< RuntimeErrorCollectorErrorHandling::runtimeErrorCollector
 RuntimeErrorCollector instance.
 
static std::weak_ptr< Communication::MpiCallbacksErrorHandling::m_callbacks
 The callback loop we are on.
 

Detailed Description

Implementation of errorhandling.hpp.

Definition in file errorhandling.cpp.

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.