HTGS
v2.0
The Hybrid Task Graph Scheduler
|
The parent class for a Task that removes the template arguments. More...
#include <htgs/core/task/AnyTaskManager.hpp>
Public Member Functions | |
AnyTaskManager (size_t numThreads, bool isStartTask, size_t pipelineId, size_t numPipelines, std::string address) | |
Constructs an AnyTaskManager with an ITask as the task function and specific runtime parameters. More... | |
AnyTaskManager (size_t numThreads, bool isStartTask, bool poll, size_t microTimeoutTime, size_t pipelineId, size_t numPipelines, std::string address) | |
Constructs an AnyTaskManager with an ITask as the task function and specific runtime parameters. More... | |
virtual | ~AnyTaskManager () |
Destructor. | |
virtual AnyITask * | getTaskFunction ()=0 |
Gets the ITask function associated with the TaskManager. More... | |
virtual std::shared_ptr< AnyConnector > | getInputConnector ()=0 |
Gets the input Connector. More... | |
virtual std::shared_ptr< AnyConnector > | getOutputConnector ()=0 |
Gets the output Connector. More... | |
virtual AnyTaskManager * | copy (bool deep)=0 |
Copies the TaskManager. More... | |
virtual void | initialize ()=0 |
Initializes the TaskManager. | |
virtual void | executeTask ()=0 |
Executes the TaskManager. More... | |
virtual void | setRuntimeThread (TaskManagerThread *runtimeThread)=0 |
Sets the thread that is executing this TaskManager. More... | |
virtual void | setInputConnector (std::shared_ptr< AnyConnector > connector)=0 |
Sets the input BaseConnector. More... | |
virtual void | setOutputConnector (std::shared_ptr< AnyConnector > connector)=0 |
Sets the output BaseConnector. More... | |
virtual void | terminateConnections ()=0 |
Terminates all Connector edges. More... | |
virtual void | gatherProfileData (std::map< AnyTaskManager *, TaskManagerProfile *> *taskManagerProfiles)=0 |
Gathers profiling data for the TaskProfiler. More... | |
virtual size_t | getThreadsRemaining ()=0 |
Gets the number of threads that are still running for the task. More... | |
void | printProfile () |
Prints the profiling data to std::cout. | |
void | updateAddressAndPipelines (std::string address, size_t pipelineId, size_t numPipelines) |
Sets the task graph communicator. More... | |
std::string | getAddress () |
Gets the address of the task manager. More... | |
void | setNumPipelines (size_t numPipelines) |
Sets the number of pipelines associated with the TaskManager. More... | |
size_t | getNumPipelines () |
Gets the number of pipelines that this task manager belongs too. More... | |
void | setPipelineId (size_t id) |
Sets the pipeline Id associated with the TaskManager. More... | |
size_t | getPipelineId () |
Gets the pipeline identifer for this task from 0 to number of pipelines - 1. More... | |
size_t | getNumThreads () const |
Gets the number of threads associated with this TaskManager. More... | |
void | setAlive (bool val) |
Sets the alive state for this task manager. More... | |
bool | isAlive () |
Gets whether the TaskManager is alive or not. More... | |
void | setInitialized (bool val) |
Sets the initialized state for the task manager. More... | |
bool | isInitialized () |
Gets whether the TaskManager has initialized or not. More... | |
void | setStartTask (bool val) |
Sets whether this task manager is a start task or not, which will immediately begin executing by sending nullptr data to the underlying task as soon as this task executes. More... | |
bool | isStartTask () |
Gets whether this task manager will begin executing immediately with nullptr data or not. More... | |
bool | isPoll () |
Gets whether the task manager is polling for data or not. More... | |
size_t | getTimeout () |
Gets the timeout period in microseconds for the task when the task is polling for data. More... | |
void | incTaskComputeTime (int64_t val) |
Increments the compute time profile value. More... | |
void | incWaitTime (int64_t val) |
Increments the wait time profile value. More... | |
void | shutdown () |
Shuts down the TaskManager. | |
std::string | getName () |
Gets the name of the ITask. More... | |
void | debug () |
Provides debug output. More... | |
std::string | getNameWithPipelineId () |
Gets the name of the ITask with it's pipeline ID. More... | |
std::string | getDot (int flags) |
Gets the dot notation for this TaskManager. | |
void | setThreadId (size_t id) |
Sets the thread id associated with the TaskManager. More... | |
size_t | getThreadId () |
Gets the thread id associated with the TaskManager. More... | |
unsigned long long int | getComputeTime () |
Gets the compute time for the task manager, removing the memory wait time. More... | |
unsigned long long int | getExecuteTime () |
Gets the total execution time for the task manager, including any waiting for memory within the execute function. More... | |
unsigned long long int | getWaitTime () |
Gets the wait time for the task manager. More... | |
size_t | getMaxQueueSize () |
Gets the maximum size the input queue became during execution. More... | |
void | resetProfile () |
Resets the profile data for this task. | |
unsigned long long int | getTaskComputeTime () |
Gets the task's compute time. More... | |
Private Attributes | |
unsigned long long int | taskComputeTime |
The total compute time for the task. | |
unsigned long long int | taskWaitTime |
The total wait time for the task. | |
size_t | timeout |
The timeout time for polling in microseconds. | |
bool | poll |
Whether the manager should poll for data. | |
bool | startTask |
Whether the task should start immediately. | |
bool | alive |
Whether the task is still alive. | |
bool | initialized |
Whether the task has been intitialized or not (called initialize function) | |
size_t | threadId |
The thread id for the task (set after initialization) | |
size_t | numThreads |
The number of threads spawned for the manager. | |
size_t | pipelineId |
The execution pipeline id. | |
size_t | numPipelines |
The number of execution pipelines. | |
std::string | address |
The address of the task graph this manager belongs too. | |
The parent class for a Task that removes the template arguments.
The AnyTaskManager provides access to functionality that does not require template arguments and allows storage of a Task.
|
inline |
Constructs an AnyTaskManager with an ITask as the task function and specific runtime parameters.
numThreads | the number of threads to operate with the TaskManager |
isStartTask | whether the TaskManager is a start task or not (immediately launches the ITask::execute when bound to a thread) |
pipelineId | the pipeline Id associated with the TaskManager |
numPipelines | the number of pipelines |
address | the address of the task graph that owns this task |
|
inline |
Constructs an AnyTaskManager with an ITask as the task function and specific runtime parameters.
numThreads | the number of threads to operate with the TaskManager |
isStartTask | whether the TaskManager is a start task or not (immediately launches the ITask::execute when bound to a thread) |
poll | whether the TaskManager should poll for data |
microTimeoutTime | the timeout time in microseconds |
pipelineId | the pipeline Id associated with the TaskManager |
numPipelines | the number of pipelines |
address | the address of the task graph that owns this task |
|
pure virtual |
Copies the TaskManager.
deep | whether a deep copy is required |
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Provides debug output.
|
pure virtual |
Executes the TaskManager.
Using the following procedure: 0. If the ITask is a start task, then send ITask::executeTask with nullptr and set that it is no longer a startTask
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
pure virtual |
Gathers profiling data for the TaskProfiler.
taskManagerProfiles | the mapping of the task manager to its TaskManagerProfile |
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Gets the address of the task manager.
Can also be thought of as the address for the task graph that this task belongs too.
|
inline |
Gets the compute time for the task manager, removing the memory wait time.
Use getExecuteTime() to get the entire runtime of the task, including wait time.
|
inline |
Gets the total execution time for the task manager, including any waiting for memory within the execute function.
|
pure virtual |
Gets the input Connector.
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Gets the maximum size the input queue became during execution.
|
inline |
|
inline |
Gets the name of the ITask with it's pipeline ID.
|
inline |
Gets the number of pipelines that this task manager belongs too.
|
inline |
Gets the number of threads associated with this TaskManager.
|
pure virtual |
Gets the output Connector.
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Gets the pipeline identifer for this task from 0 to number of pipelines - 1.
|
inline |
Gets the task's compute time.
|
pure virtual |
Gets the ITask function associated with the TaskManager.
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Gets the thread id associated with the TaskManager.
|
pure virtual |
Gets the number of threads that are still running for the task.
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Gets the timeout period in microseconds for the task when the task is polling for data.
|
inline |
Gets the wait time for the task manager.
|
inline |
Increments the compute time profile value.
val | the value to increment by |
|
inline |
Increments the wait time profile value.
val | the value to increment by |
|
inline |
Gets whether the TaskManager is alive or not.
TRUE | if the TaskManager is alive |
FALSE | if the TaskManager is not alive |
|
inline |
Gets whether the TaskManager has initialized or not.
TRUE | if the TaskManager has finished initializing |
FALSE | if the TaskManager has not been initialized |
|
inline |
Gets whether the task manager is polling for data or not.
TRUE | if the task manager is polling for data from its input |
FALSE | if the task manager is not polling (waiting) for data from its input |
|
inline |
Gets whether this task manager will begin executing immediately with nullptr data or not.
TRUE | if the task manager will begin executing immediately |
FALSE | if the task manager will not begin and wait for its first input data |
|
inline |
Sets the alive state for this task manager.
val | the value to set, true = alive, false = dead/terminating |
|
inline |
Sets the initialized state for the task manager.
val | the value to set, true = initialize has been called an thread is bound to the task waiting for data, false = thread is not ready |
|
pure virtual |
Sets the input BaseConnector.
connector | the input connector |
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Sets the number of pipelines associated with the TaskManager.
numPipelines | the number of pipelines |
|
pure virtual |
Sets the output BaseConnector.
connector | the output connector |
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Sets the pipeline Id associated with the TaskManager.
id | the pipeline Id |
|
pure virtual |
Sets the thread that is executing this TaskManager.
runtimeThread | the thread that is executing the TaskManager |
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Sets whether this task manager is a start task or not, which will immediately begin executing by sending nullptr data to the underlying task as soon as this task executes.
val | the value to set, true = is a start task, false = not a start task |
|
inline |
Sets the thread id associated with the TaskManager.
id | the thread id |
|
pure virtual |
Terminates all Connector edges.
This is called after all threads have shutdown.
Implemented in htgs::TaskManager< T, U >, htgs::TaskManager< U, W >, htgs::TaskManager< T, VoidData >, and htgs::TaskManager< MemoryData< T >, MemoryData< T > >.
|
inline |
Sets the task graph communicator.
communicator | the task graph communicator Sends data packet along task graph communicator |
packet | the data packet to communicate Updates the address, pipelineID, and number of pipelines for the task manager. |
address | the address (or task graph address) of this task manager |
pipelineId | the ID for which execution pipeline this task belongs |
numPipelines | the number of pipelines that exist for the execution pipeline |