HTGS  v2.0
The Hybrid Task Graph Scheduler
htgs::TaskGraphSignalHandler Class Reference

Implements a signal handler to catch events such as termination and killing of the process. More...

#include <htgs/log/TaskGraphSignalHandler.hpp>

Collaboration diagram for htgs::TaskGraphSignalHandler:
Collaboration graph

Static Public Member Functions

static void handleSignal (int signum=SIGTERM)
 Function that handles signals. More...
 
static void registerTaskGraph (AnyTaskGraphConf *taskGraph)
 Registers a task graph to be displayed when a signal is fired. More...
 
static void registerSignal (int signum=SIGTERM)
 Registers a signal for handling. More...
 

Static Private Attributes

static std::vector< AnyTaskGraphConf * > instances
 < The task graph instances
 
static bool signalHandled = false
 

Detailed Description

Implements a signal handler to catch events such as termination and killing of the process.

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.

Example usage:

int main() {
...
auto taskGraph = new htgs::TaskGraphConf...
htgs::TaskGraphSignalHandler::registerSignal(); // Default signal is SIGTERM
auto runtime = new htgs::TaskGraphRuntime(taskGraph);
runtime->executeRuntime();
// If the program is killed/terminated then the signal handler will automatically output the task graph that was registered
}
Note
This class should only be included from main due to the instantiation of a static variable. If this class is included in multiple object files, then there will be linking errors.

Member Function Documentation

◆ handleSignal()

static void htgs::TaskGraphSignalHandler::handleSignal ( int  signum = SIGTERM)
inlinestatic

Function that handles signals.

Use TaskGraphSignalHandler::registerSignal to signal to this function.

Parameters
signumthe signal number that was triggered

◆ registerSignal()

static void htgs::TaskGraphSignalHandler::registerSignal ( int  signum = SIGTERM)
inlinestatic

Registers a signal for handling.

(default SIGTERM)

Parameters
signum

◆ registerTaskGraph()

static void htgs::TaskGraphSignalHandler::registerTaskGraph ( AnyTaskGraphConf taskGraph)
inlinestatic

Registers a task graph to be displayed when a signal is fired.

Parameters
taskGraphthe task graph to be displayed. Calling this function on multiple graphs will output multiple dot files.

The documentation for this class was generated from the following file: