![]() |
HTGS
v2.0
The Hybrid Task Graph Scheduler
|
Implements the base class for the TaskGraphConf class, removing the template arguments and providing functionality that is applicable to any task graph configuration. More...
#include <htgs/core/graph/AnyTaskGraphConf.hpp>
Public Member Functions | |
AnyTaskGraphConf (size_t pipelineId, size_t numPipelines, std::string baseAddress) | |
Constructs the AnyTaskGraphConf. More... | |
virtual | ~AnyTaskGraphConf () |
Destructor. | |
virtual std::shared_ptr< AnyConnector > | getInputConnector ()=0 |
Pure virtual function that gets the task manager that is consuming data from the graph's input. More... | |
virtual std::shared_ptr< AnyConnector > | getOutputConnector ()=0 |
Virtual function that gets the connector used for graph output. More... | |
std::list< AnyTaskManager * > * | getTaskManagers () |
Virtual function that initiates updating the task graph communicator. More... | |
void | gatherProfilingData (std::map< AnyTaskManager *, TaskManagerProfile *> *taskManagerProfiles) |
Gathers profiling data for this task graph's task managers, which is added into the task manager profiles map. More... | |
template<class V , class W > | |
std::shared_ptr< IRule< V, W > > | getIRule (IRule< V, W > *iRule) |
Gets the shared_ptr reference for a particular IRule. More... | |
template<class V > | |
std::shared_ptr< IMemoryAllocator< V > > | getMemoryAllocator (IMemoryAllocator< V > *allocator) |
Gets the shared_ptr reference for a particular IMemoryAllocator. More... | |
void | initialize () |
Initializes the task graph just prior to spawning threads. | |
virtual void | finishedSetup () |
Called when the task graph has finished setting up its tasks and launched all threads for the graph. | |
void | shutdown () |
Called when all the threads in this graph have finished executing. | |
void | waitForInitialization () |
Waits for all task managers to finish initializing. More... | |
std::condition_variable * | getInitializationCondition () |
Notifies the task graph to check if all task managers have been initialized or not. More... | |
std::mutex * | getInitializationMutex () |
Gets the initialization mutex, used for signaling when initialization is done. More... | |
TaskNameConnectorMap * | getTaskConnectorNameMap () const |
Gets the task name connector map that maps the task name to its input connector. More... | |
template<class T , class U > | |
ITask< T, U > * | getCopy (ITask< T, U > *orig) |
Gets the copy for an ITask based on some original ITask reference. More... | |
AnyITask * | getCopy (AnyITask *orig) |
Gets the copy for an AnyITask based on some original AnyITask reference. More... | |
template<class T , class U > | |
TaskManager< T, U > * | getTaskManager (ITask< T, U > *task) |
Gets the task manager that is responsible for a particular ITask. More... | |
void | addTaskManager (AnyTaskManager *taskManager) |
Adds a task manager to the task graph. More... | |
void | printProfile () |
Prints profile data to console for all task managers. | |
size_t | getPipelineId () |
Gets the pipeline ID for the task graph configuration. More... | |
size_t | getNumPipelines () |
Gets the number of pipelines that exist for this task graph. More... | |
void | writeDotToFile (std::string file, int flags=0, std::string graphTitle="", std::string customTitleText="") |
Writes the dot representation of the task graph to disk with additional options such as profiling. More... | |
virtual void | updateTaskManagersAddressingAndPipelines ()=0 |
Updates the task managers addresses, pipelineIds and the number of pipelines for all tasks in the TaskGraph. More... | |
std::string | getAddress () |
Gets the address for the task graph. More... | |
size_t | getNumberOfSubGraphs () const |
Gets the number of sub graphs within this task graph. More... | |
unsigned long long int | getGraphComputeTime () const |
Gets the total time the graph was computing. More... | |
unsigned long long int | getGraphCreationTime () const |
Gets the total time the graph was getting created. More... | |
std::string | genDotGraphContent (int flags) |
Generate the content only of the graph (excludes all graph definitions and attributes) | |
virtual AnyTaskGraphConf * | copy ()=0 |
Creates an exact copy of this task graph. More... | |
virtual std::string | genDotGraph (int flags, int colorFlag, std::string graphTitle="", std::string customTitleText="")=0 |
Generates the dot graph as a string. | |
void | copyTasks (std::list< AnyTaskManager *> *tasks) |
Creates a copy of each task from the list of AnyTaskManagers passed as a parameter. More... | |
AnyTaskManager * | getTaskManagerCopy (AnyITask *iTask) |
Gets the task manager copy for a given ITask. More... | |
bool | hasTask (AnyITask *task) |
Checks whether an ITask is in the graph or not. More... | |
Private Member Functions | |
void | createCopy (AnyTaskManager *taskManager) |
Creates a copy of a task manager and adds the copy and a mapping between the task manager copy and the original ITask that the manager is responsible for. More... | |
Private Attributes | |
ITaskMap * | taskCopyMap |
The ITask copy map that maps an original ITask to a task manager copy. | |
std::list< AnyTaskManager * > * | taskManagers |
The list of task managers for the task graph. | |
size_t | pipelineId |
The pipelineId for the task graph. | |
size_t | numPipelines |
The number of pipelines from this graph. | |
std::string | address |
The address for this task graph and its tasks. | |
TaskNameConnectorMap * | taskConnectorNameMap |
Maps the tsak name to the task's connector. | |
size_t | numberOfSubGraphs |
The number of sub-graphs that will be spawned. | |
IRuleMap * | iRuleMap |
A mapping for each IRule pointer to the shared pointer for that IRule. | |
MemAllocMap * | memAllocMap |
A mapping for each IMemoryAllocator to its associated shared_ptr. | |
std::chrono::time_point< std::chrono::high_resolution_clock > | graphCreationTimestamp |
Timestamp when graph constructor was called. | |
std::chrono::time_point< std::chrono::high_resolution_clock > | graphExecutingTimestamp |
Timestamp for how long the graph executed. | |
unsigned long long int | graphComputeTime |
The total time to execute the graph. | |
unsigned long long int | graphCreationTime |
The total time to create the graph. | |
std::condition_variable | initializeCondition |
The condition variable to signal to check if initialization has finished. | |
std::mutex | initializeMutex |
Mutex used to signal initializational. | |
Implements the base class for the TaskGraphConf class, removing the template arguments and providing functionality that is applicable to any task graph configuration.
For example, storing the base address, pipeline ID, etc.
|
inline |
Constructs the AnyTaskGraphConf.
pipelineId | the pipeline ID associated with this task graph |
numPipelines | the number of pipelines that exist for the task graph |
baseAddress | the base address for the graph, if it is an empty string then this graph is the first/root graph. |
|
inline |
Adds a task manager to the task graph.
taskManager | the task manager |
|
pure virtual |
Creates an exact copy of this task graph.
Implemented in htgs::TaskGraphConf< T, U >.
|
inline |
Creates a copy of each task from the list of AnyTaskManagers passed as a parameter.
Each copy is added into this graph and a mapping between the original and the copy is made.
tasks | the tasks to make copies of. |
|
inlineprivate |
Creates a copy of a task manager and adds the copy and a mapping between the task manager copy and the original ITask that the manager is responsible for.
taskManager | the task manager to create a copy for. |
|
inline |
Gathers profiling data for this task graph's task managers, which is added into the task manager profiles map.
taskManagerProfiles | the map that stores all the profile data for each task manager. |
|
inline |
Gets the address for the task graph.
All tasks within this graph share the same address as the graph.
|
inline |
Gets the copy for an ITask based on some original ITask reference.
This function is used to find the associated ITask reference to ensure connections are maintained when copying the TaskGraphConf.
orig | the pointer to the original ITask that may have been copied before |
Gets the copy for an AnyITask based on some original AnyITask reference.
This function is used to find the associated ITask reference to ensure connections are maintained when copying the TaskGraphConf. This version does not use the template arguments.
orig | the pointer to the original AnyITask that may have been copied before |
|
inline |
Gets the total time the graph was computing.
|
inline |
Gets the total time the graph was getting created.
|
inline |
Notifies the task graph to check if all task managers have been initialized or not.
|
inline |
Gets the initialization mutex, used for signaling when initialization is done.
|
pure virtual |
Pure virtual function that gets the task manager that is consuming data from the graph's input.
Implemented in htgs::TaskGraphConf< T, U >.
|
inline |
Gets the shared_ptr reference for a particular IMemoryAllocator.
V | the data type that is allocated |
allocator | the IMemoryAllocator |
|
inline |
Gets the number of sub graphs within this task graph.
This number represents the number of subgraphs spawned by all execution pipelines in the graph.
|
inline |
Gets the number of pipelines that exist for this task graph.
|
pure virtual |
Virtual function that gets the connector used for graph output.
Implemented in htgs::TaskGraphConf< T, U >.
|
inline |
Gets the pipeline ID for the task graph configuration.
|
inline |
Gets the task name connector map that maps the task name to its input connector.
|
inline |
|
inline |
|
inline |
Virtual function that initiates updating the task graph communicator.
Virtual function that gets the task graph communicator.
|
inline |
|
pure virtual |
Updates the task managers addresses, pipelineIds and the number of pipelines for all tasks in the TaskGraph.
Implemented in htgs::TaskGraphConf< T, U >.
|
inline |
Waits for all task managers to finish initializing.
When this returns it is safe to assume that all tasks have been initialized from the graph.
|
inline |
Writes the dot representation of the task graph to disk with additional options such as profiling.
Example: taskGraph->writeDotToFile("example.dot", DOTGEN_FLAG_HIDE_MEM_EDGES | DOTGEN_FLAG_SHOW_IN_OUT_TYPES);
The bit flags are aggregated using bit-wise OR operator.
file | the filename (will not create directories) |
flags | the flags for DOTGEN |
graphTitle | the title of the graph that is inserted into a graph title section in the visualization |
customTitleText | custom text that can be inserted into the graph title section in the visualization |