WarpX
|
Signal handling. More...
#include <SignalHandling.H>
Public Types | |
enum | signal_action_requested_labels { SIGNAL_REQUESTS_BREAK = 0 , SIGNAL_REQUESTS_CHECKPOINT = 1 , SIGNAL_REQUESTS_SIZE = 2 } |
Labels for indexed positions in signal_actions_requests. More... | |
Public Member Functions | |
SignalHandling ()=delete | |
Static Public Member Functions | |
static int | parseSignalNameToNumber (const std::string &str) |
Take a string and convert it to a corresponding signal number if possible. More... | |
static void | InitSignalHandling () |
Set up signal handlers based on input configuration provided in signal_conf_requests_* More... | |
static void | CheckSignals () |
Check and clear signal flags and asynchronously broadcast them from process 0. More... | |
static void | WaitSignals () |
Complete the asynchronous broadcast of signal flags. More... | |
static bool | TestAndResetActionRequestFlag (int action_to_test) |
Check whether a given action has been requested, and reset the associated flag. More... | |
Static Public Attributes | |
static constexpr int | NUM_SIGNALS = 32 |
The range of signal values to accept. More... | |
static bool | signal_conf_requests [SIGNAL_REQUESTS_SIZE][NUM_SIGNALS] |
Whether configuration requests the code take a particular action on a particular signal. More... | |
Static Private Member Functions | |
static void | SignalSetFlag (int signal_number) |
Signal handler to set flags on process 0 (other processes ignore configured signals) More... | |
Static Private Attributes | |
static bool | m_any_signal_action_active = false |
Is any signal handling action configured in signal_conf_requests ? More... | |
static std::atomic< bool > | signal_received_flags [NUM_SIGNALS] |
On process 0, whether a given signal has been received since the last check. More... | |
static MPI_Request | signal_mpi_ibcast_request |
MPI requests for the asynchronous broadcasts of the signal-requested actions. More... | |
static bool | signal_actions_requested [SIGNAL_REQUESTS_SIZE] |
Signal handling.
Rank 0 will accept signals and asynchronously broadcast the configured response; other processes will ignore them and follow the lead of rank 0 to avoid potential for deadlocks or timestep-skewed response.
Variables and functions are static rather than per-instance because signal handlers are configured at the process level.
|
delete |
|
static |
Check and clear signal flags and asynchronously broadcast them from process 0.
|
static |
Set up signal handlers based on input configuration provided in signal_conf_requests_*
|
static |
Take a string and convert it to a corresponding signal number if possible.
|
staticprivate |
Signal handler to set flags on process 0 (other processes ignore configured signals)
|
static |
Check whether a given action has been requested, and reset the associated flag.
|
static |
Complete the asynchronous broadcast of signal flags.
|
staticprivate |
Is any signal handling action configured in signal_conf_requests ?
|
staticconstexpr |
The range of signal values to accept.
|
staticprivate |
Boolean flags transmitted between CheckSignals() and HandleSignals() to indicate actions requested by signals
|
static |
Whether configuration requests the code take a particular action on a particular signal.
|
staticprivate |
MPI requests for the asynchronous broadcasts of the signal-requested actions.
|
staticprivate |
On process 0, whether a given signal has been received since the last check.