Hedgehog
3.1.0
A library to generate hybrid pipeline workflow systems
|
Implements a signal handler to catch events such as termination and killing. More...
#include "graph_signal_handler.h"
Static Public Member Functions | |
static void | handleSignal (int signum=SIGTERM) |
Function that handles signals. | |
static void | atExit () |
Create a dot file at exit if the instance still exist. | |
static void | setColorScheme (ColorScheme scheme) |
Sets the color scheme for dot file generation. | |
static void | setStructureOptions (StructureOptions options) |
Sets the structure options for dot file generation. | |
static void | setDebugOptions (DebugOptions options) |
Sets the debug options for dot file generation. | |
static void | registerGraph (Graph< Separator, AllTypes... > *graph) |
Registers a task graph to be displayed when a signal is fired. | |
static void | registerSignal (int signum=SIGTERM, bool atExit=false) |
Registers a signal for handling. (default SIGTERM) | |
Static Private Attributes | |
static Graph< Separator, AllTypes... > * | graphInstance_ = nullptr |
< The outer graph instance | |
static bool | signalHandled_ = false |
Flag to indicate if a signal has been fired or not. | |
static ColorScheme | colorScheme = ColorScheme::EXECUTION |
< The color scheme to use for graph dot file | |
static StructureOptions | structureOptions = StructureOptions::ALL |
< The structure options to use for graph dot file | |
static DebugOptions | debugOptions = DebugOptions::ALL |
< The debug options to use for graph dot file | |
Implements a signal handler to catch events such as termination and killing.
Once a signal is caught, all task graphs that are registered with the signal handler will be written as a dot file. The dot file is output in the working directory with the name of the signal as a prefix and '<#>-graph-output.dot' as the suffix. This can be used to help debug the graph and understand the state of the graph. For example, if the graph is deadlocked and the kill signal is handled, then the graph will be saved when terminating the program. Visualizing the graph can pinpoint the location of the deadlock.
Separator | Separator position between input types and output types |
AllTypes | List of input and output types |
Definition at line 39 of file graph_signal_handler.h.
|
inlinestatic |
Create a dot file at exit if the instance still exist.
Definition at line 69 of file graph_signal_handler.h.
|
inlinestatic |
Function that handles signals.
Use TaskGraphSignalHandler::registerSignal to signal to this function
signum | the signal number that was triggered |
Definition at line 53 of file graph_signal_handler.h.
|
inlinestatic |
Registers a task graph to be displayed when a signal is fired.
graph | the task graph to be displayed. |
Definition at line 94 of file graph_signal_handler.h.
|
inlinestatic |
Registers a signal for handling. (default SIGTERM)
signum | Signal number id |
atExit | Boolean to test if GraphSignalHandler::atExit is called |
Definition at line 101 of file graph_signal_handler.h.
|
inlinestatic |
Sets the color scheme for dot file generation.
scheme | the color scheme |
Definition at line 76 of file graph_signal_handler.h.
|
inlinestatic |
Sets the debug options for dot file generation.
options | the debug options |
Definition at line 88 of file graph_signal_handler.h.
|
inlinestatic |
Sets the structure options for dot file generation.
options | the structure options |
Definition at line 82 of file graph_signal_handler.h.
|
staticprivate |
< The color scheme to use for graph dot file
Sets the default color scheme.
Separator | Separator position between input types and output types |
AllTypes | List of input and output types |
Definition at line 43 of file graph_signal_handler.h.
|
staticprivate |
< The debug options to use for graph dot file
Sets the default debug options.
Separator | Separator position between input types and output types |
AllTypes | List of input and output types |
Definition at line 45 of file graph_signal_handler.h.
|
staticprivate |
< The outer graph instance
Set default value at nullptr.
Separator | Separator position between input types and output types |
AllTypes | List of input and output types |
Definition at line 41 of file graph_signal_handler.h.
|
staticprivate |
Flag to indicate if a signal has been fired or not.
Set default value at false.
Separator | Separator position between input types and output types |
AllTypes | List of input and output types |
Definition at line 42 of file graph_signal_handler.h.
|
staticprivate |
< The structure options to use for graph dot file
Sets the default structure options.
Separator | Separator position between input types and output types |
AllTypes | List of input and output types |
Definition at line 44 of file graph_signal_handler.h.