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

The task graph profiler that gathers profile data and communicates via graphviz. More...

#include <htgs/core/graph/profile/TaskGraphProfiler.hpp>

Collaboration diagram for htgs::TaskGraphProfiler:
Collaboration graph

Public Member Functions

 TaskGraphProfiler (int flags)
 Constructs the task graph profiler. More...
 
 ~TaskGraphProfiler ()
 Destructor.
 
void buildProfile (AnyTaskGraphConf *graphConf)
 Builds a profile for the graph, (called after execution is done) More...
 
void printProfiles ()
 Prints the profile data to console.
 
std::string genDotProfile (std::string curDotGraph, int colorFlag)
 Generates the dot profile for the graph. More...
 
ProfileUtilsgetProfileUtils ()
 Gets the profile utility class to obtain color codes based on the total execution time. More...
 
std::map< AnyTaskManager *, TaskManagerProfile * > * getTaskManagerProfiles ()
 Gets the task manager profiles for all tasks in all graphs and sub-graphs. More...
 

Private Member Functions

void computeAverages ()
 Computes the averages for all profile data.
 
std::unordered_map< std::string, std::string > * genColorMap (int colorFlag)
 Generates the color map. More...
 

Private Attributes

std::map< AnyTaskManager *, TaskManagerProfile * > * taskManagerProfiles
 The profile data for all task managers.
 
int flags
 The DOTGEN bit flags.
 
ProfileUtilsprofileUtils = nullptr
 
double totalTime = 0.0
 Total execution time for all task managers.
 
double maxTime = 0.0
 The maximum time from all task managers.
 
double taskGraphComputeTime
 

Detailed Description

The task graph profiler that gathers profile data and communicates via graphviz.

A TaskGraphConf uses this class to gather all profile data for visually outputting the task graph as a dot file. DOTGEN flags are used to specify options to enable/disable features for the graph.

Note
To enable profiling you must add the directive PROFILE prior to compilation. If PROFILE is not defined, then a basic visualization is done showing just the graph structure.

Constructor & Destructor Documentation

◆ TaskGraphProfiler()

htgs::TaskGraphProfiler::TaskGraphProfiler ( int  flags)
inline

Constructs the task graph profiler.

Parameters
flagsthe DOTGEN flags to enable/disable features

Member Function Documentation

◆ buildProfile()

void htgs::TaskGraphProfiler::buildProfile ( AnyTaskGraphConf graphConf)
inline

Builds a profile for the graph, (called after execution is done)

Parameters
graphConfthe graph that is profiled

◆ genColorMap()

std::unordered_map<std::string, std::string>* htgs::TaskGraphProfiler::genColorMap ( int  colorFlag)
inlineprivate

Generates the color map.

The map is structured as TaskDotID string -> Color string.

Parameters
colorFlagselects which profile data to use when generating colors.
Returns
the color map

◆ genDotProfile()

std::string htgs::TaskGraphProfiler::genDotProfile ( std::string  curDotGraph,
int  colorFlag 
)
inline

Generates the dot profile for the graph.

Only the tasks that have been defined within the current dot graph will have their profiles included. The color flag is used to identify which profiling to use when coloring the nodes.

Parameters
curDotGraphthe current dot graph that includes all tasks and edges used for the graph.
colorFlagspecifies which profile data to use when generating the color map, 0 = no color map
Returns
the dot graph with labeling for profiling if profiling is enabled.
Note
The directive PROFILE must be defined to enable outputting profile data.

◆ getProfileUtils()

ProfileUtils* htgs::TaskGraphProfiler::getProfileUtils ( )
inline

Gets the profile utility class to obtain color codes based on the total execution time.

Returns
the profile utility class

◆ getTaskManagerProfiles()

std::map<AnyTaskManager *, TaskManagerProfile *>* htgs::TaskGraphProfiler::getTaskManagerProfiles ( )
inline

Gets the task manager profiles for all tasks in all graphs and sub-graphs.

Returns
all of the task managers within the graph and its sub-graphs

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