HTGS
v2.0
The Hybrid Task Graph Scheduler
|
Implements the parent ITask, which removes the template arguments of an ITask. More...
#include <htgs/core/task/AnyITask.hpp>
Public Member Functions | |
AnyITask () | |
Creates an ITask with number of threads equal to 1. | |
AnyITask (size_t numThreads) | |
Constructs an ITask with a specified number of threads. More... | |
AnyITask (size_t numThreads, bool isStartTask, bool poll, size_t microTimeoutTime) | |
Constructs an ITask with a specified number of threads as well as additional scheduling options. More... | |
virtual | ~AnyITask () |
Destructor. | |
virtual AnyITask * | copy ()=0 |
Pure virtual function to copy an ITask. More... | |
virtual std::string | getName ()=0 |
Virtual function to get the name of an ITask. More... | |
virtual std::string | getDotLabelName ()=0 |
Virtual function to get the label name used for dot graph viz. More... | |
virtual std::string | getDotShapeColor ()=0 |
Gets the color of the shape for graphviz dot. More... | |
virtual std::string | getDotFillColor ()=0 |
Gets the color for filling the shape for graphviz dot. More... | |
virtual std::string | getDotShape ()=0 |
Gets the shape for graphviz dot. More... | |
virtual std::string | getDotCustomProfile ()=0 |
Virtual function that can be used to add custom output for dot visualizations. More... | |
virtual void | shutdown ()=0 |
Virtual function that is called when an ITask is being shutdown by it's owner thread. More... | |
virtual void | initialize ()=0 |
Virtual function that is called when an ITask is being initialized by it's owner thread. | |
virtual void | executeTaskFinal ()=0 |
Virtual function that is called just before the task has shutdown. More... | |
virtual bool | canTerminate (std::shared_ptr< AnyConnector > inputConnector)=0 |
Virtual function that is called when an ITask is checking if it can be terminated. More... | |
virtual std::string | genDot (int flags, std::string dotId, std::shared_ptr< htgs::AnyConnector > input, std::shared_ptr< htgs::AnyConnector > output) |
Virtual function that generates the input/output and per-task dot notation. More... | |
virtual std::string | getConsumerDotIds () |
virtual std::string | getProducerDotIds () |
virtual std::string | genDotProducerEdgeToTask (std::map< std::shared_ptr< AnyConnector >, AnyITask *> &inputConnectorDotMap, int dotFlags)=0 |
virtual std::string | genDotConsumerEdgeFromConnector (std::shared_ptr< AnyConnector > connector, int flags)=0 |
virtual std::string | genDotProducerEdgeFromConnector (std::shared_ptr< AnyConnector > connector, int flags)=0 |
virtual std::string | genDot (int flags, std::string dotId) |
Virtual function that adds additional dot attributes to this node. More... | |
virtual std::string | genCustomDot (ProfileUtils *profileUtils, int colorFlag) |
Virtual function to generate customized dot file. More... | |
virtual void | debug () |
Virtual function that is called to debug the ITask. | |
virtual std::string | debugDotNode () |
Provides debug output for a node in the dot graph. More... | |
virtual void | profile () |
Virtual function that is called to provide profile output for the ITask. More... | |
virtual std::string | profileStr () |
Virtual function that is called after executionTask is called. More... | |
virtual std::string | inTypeName ()=0 |
Gets the demangled input type name of the connector. More... | |
virtual std::string | outTypeName ()=0 |
Gets the demangled output type name of the connector. More... | |
virtual std::string | getAddress ()=0 |
Gets the address from the owner task, which is the address of the task graph. More... | |
virtual AnyITask * | copyITask (bool deep)=0 |
Copies the ITask including its list of memGetters and memReleasers. More... | |
virtual void | printProfile ()=0 |
Prints the profile data to std::out. | |
void | initialize (size_t pipelineId, size_t numPipeline) |
Virtual function that is called when an ITask is being initialized by it's owner thread. More... | |
void | setPipelineId (size_t pipelineId) |
Sets the pipeline Id for this ITask. More... | |
size_t | getPipelineId () |
Gets the pipeline ID. More... | |
void | setNumPipelines (size_t numPipelines) |
Sets the number of pipelines that this ITask belongs too. More... | |
size_t | getNumPipelines () const |
Sets the task graph communicator. More... | |
size_t | getNumThreads () const |
Gets the number of threads associated with this ITask. More... | |
bool | isStartTask () const |
Gets whether this ITask is a starting task. More... | |
bool | isPoll () const |
Gets whether this ITask is polling for data or not. More... | |
size_t | getMicroTimeoutTime () const |
Gets the timeout time for polling. More... | |
void | copyMemoryEdges (AnyITask *iTaskCopy) |
Copies the memory edges from this AnyITask to another AnyITask. More... | |
std::string | genDot (int flags, std::shared_ptr< AnyConnector > input, std::shared_ptr< AnyConnector > output) |
Creates a dot notation representation for this task. More... | |
void | profileITask () |
Provides profile output for the ITask,. More... | |
std::string | getDotId () |
Gets the id used for dot nodes. More... | |
std::string | getNameWithPipelineId () |
Gets the name of the ITask with it's pipeline ID. More... | |
const std::shared_ptr< ConnectorMap > & | getMemoryEdges () const |
Gets the memory edges for the task. More... | |
const std::shared_ptr< ConnectorMap > & | getReleaseMemoryEdges () const |
Gets the memory edges for releasing memory for the memory manager, used to shutdown the memory manager. More... | |
bool | hasMemoryEdge (std::string name) |
Checks whether this ITask contains a memory edge for a specified name. More... | |
void | attachMemoryEdge (std::string name, std::shared_ptr< AnyConnector > getMemoryConnector, std::shared_ptr< AnyConnector > releaseMemoryConnector, MMType type) |
Attaches a memory edge to this ITask to get memory. More... | |
unsigned long long int | getMemoryWaitTime () const |
Gets the amount of time the task was waiting for memory. More... | |
void | incMemoryWaitTime (unsigned long long int val) |
Increments memory wait time. More... | |
Private Attributes | |
size_t | numThreads |
The number of threads to be used with this ITask (forms a thread pool) used when creating a TaskManager. | |
bool | startTask |
Whether the ITask will be a start task used when creating a TaskManager. | |
bool | poll |
Whether the ITask should poll for data used when creating a TaskManager. | |
size_t | microTimeoutTime |
The timeout time for polling in microseconds used when creating a TaskManager. | |
size_t | pipelineId |
The execution pipeline id for the ITask. | |
size_t | numPipelines |
The number of pipelines that exist for this task. | |
std::shared_ptr< ConnectorMap > | memoryEdges |
A mapping from memory edge name to memory manager connector for getting memory. | |
std::shared_ptr< ConnectorMap > | releaseMemoryEdges |
A mapping from the memory edge name to the memory manager's input connector to shutdown the memory manager. | |
unsigned long long int | memoryWaitTime |
The amount of time this task waited for memory. | |
Implements the parent ITask, which removes the template arguments of an ITask.
Used anywhere the template arguments for an ITask are not needed.
|
inline |
|
inline |
Constructs an ITask with a specified number of threads as well as additional scheduling options.
numThreads | the number of threads associated with this ITask |
isStartTask | whether this ITask starts executing immediately and passes nullptr to executeTask() |
poll | whether this task will poll for data, if the timeout period expires, nullptr is passed to executeTask() |
microTimeoutTime | the timeout period for checking for data |
|
inline |
Attaches a memory edge to this ITask to get memory.
name | the name of the memory edge |
getMemoryConnector | the connector for getting memory for the MemoryManager |
releaseMemoryConnector | the connector for releasing memory for the MemoryManager |
type | the memory manager type |
|
pure virtual |
Virtual function that is called when an ITask is checking if it can be terminated.
inputConnector | the connector responsible for giving data to this Task |
TRUE | if the ITask is ready to be terminated |
FALSE | if the ITask is not ready to be terminated |
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, htgs::ITask< MemoryData< T >, MemoryData< T > >, htgs::TGTask< T, U >, and htgs::Bookkeeper< T >.
|
pure virtual |
Pure virtual function to copy an ITask.
Implemented in htgs::ExecutionPipeline< T, U >, htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, htgs::ITask< MemoryData< T >, MemoryData< T > >, htgs::Bookkeeper< T >, htgs::ICudaTask< T, U >, htgs::MemoryManager< T >, htgs::TGTask< T, U >, and htgs::CudaMemoryManager< T >.
|
pure virtual |
Copies the ITask including its list of memGetters and memReleasers.
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, and htgs::ITask< MemoryData< T >, MemoryData< T > >.
|
inline |
|
inlinevirtual |
Provides debug output for a node in the dot graph.
|
pure virtual |
Virtual function that is called just before the task has shutdown.
This is the last call for executeTask. This is only called by the very last thread that is bound for this task.
Example: If you have multiple threads bound to a task, then this function is only called once for the last thread
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, and htgs::ITask< MemoryData< T >, MemoryData< T > >.
|
inlinevirtual |
Virtual function to generate customized dot file.
profiler | the profiler that contains color maps |
Reimplemented in htgs::ExecutionPipeline< T, U >, and htgs::TGTask< T, U >.
|
inlinevirtual |
Virtual function that generates the input/output and per-task dot notation.
flags | the DOTGEN flags |
dotId | the id for this task |
input | the input connector for this task |
output | the output connector for this task |
|
inlinevirtual |
Virtual function that adds additional dot attributes to this node.
flags | the dot gen flags |
dotId | the for the node in dot |
Reimplemented in htgs::Bookkeeper< T >.
|
inline |
Creates a dot notation representation for this task.
flags | the DOTGEN flags |
input | the input connector for this task |
output | the output connector for this task |
|
pure virtual |
Gets the address from the owner task, which is the address of the task graph.
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, and htgs::ITask< MemoryData< T >, MemoryData< T > >.
|
pure virtual |
Virtual function that can be used to add custom output for dot visualizations.
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, and htgs::ITask< MemoryData< T >, MemoryData< T > >.
|
pure virtual |
Gets the color for filling the shape for graphviz dot.
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, htgs::ITask< MemoryData< T >, MemoryData< T > >, htgs::MemoryManager< T >, and htgs::ICudaTask< T, U >.
|
inline |
Gets the id used for dot nodes.
|
pure virtual |
Virtual function to get the label name used for dot graph viz.
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, htgs::ITask< MemoryData< T >, MemoryData< T > >, and htgs::Bookkeeper< T >.
|
pure virtual |
Gets the shape for graphviz dot.
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, and htgs::ITask< MemoryData< T >, MemoryData< T > >.
|
pure virtual |
Gets the color of the shape for graphviz dot.
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, and htgs::ITask< MemoryData< T >, MemoryData< T > >.
|
inline |
Gets the memory edges for the task.
|
inline |
Gets the amount of time the task was waiting for memory.
|
inline |
Gets the timeout time for polling.
|
pure virtual |
Virtual function to get the name of an ITask.
Implemented in htgs::ExecutionPipeline< T, U >, htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, htgs::ITask< MemoryData< T >, MemoryData< T > >, htgs::ICudaTask< T, U >, htgs::MemoryManager< T >, htgs::TGTask< T, U >, htgs::Bookkeeper< T >, and htgs::CudaMemoryManager< T >.
|
inline |
Gets the name of the ITask with it's pipeline ID.
|
inline |
Sets the task graph communicator.
communicator | Gets the task graph communicator |
|
inline |
Gets the number of threads associated with this ITask.
|
inline |
Gets the pipeline ID.
|
inline |
Gets the memory edges for releasing memory for the memory manager, used to shutdown the memory manager.
|
inline |
Checks whether this ITask contains a memory edge for a specified name.
name | the name of the memGetter edge |
TRUE | if the ITask has a memGetter with the specified name |
FALSE | if the ITask does not have a memGetter with the specified name |
|
inline |
Increments memory wait time.
val | the amount of time passed waiting for memory |
|
inline |
Virtual function that is called when an ITask is being initialized by it's owner thread.
pipelineId | the pipelineId, only used if the ITask is inside of an ExecutionPipeline |
numPipeline | the number of pipelines, only used if the ITask is inside of an ExecutionPipeline |
|
pure virtual |
Gets the demangled input type name of the connector.
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, and htgs::ITask< MemoryData< T >, MemoryData< T > >.
|
inline |
|
inline |
|
pure virtual |
Gets the demangled output type name of the connector.
Implemented in htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, and htgs::ITask< MemoryData< T >, MemoryData< T > >.
|
inlinevirtual |
Virtual function that is called to provide profile output for the ITask.
|
inline |
Provides profile output for the ITask,.
|
inlinevirtual |
Virtual function that is called after executionTask is called.
This can be used to provide detailed profile (or debug) data to be sent for visualization using the HTGS_Visualizer. The format uses <key>:<value> pairs, separated by semi-colons.
i.e.: gflops:<#>;bandwidth:<#>;...
|
inline |
Sets the number of pipelines that this ITask belongs too.
numPipelines | the number of pipelines |
|
inline |
Sets the pipeline Id for this ITask.
pipelineId | the pipelineId |
|
pure virtual |
Virtual function that is called when an ITask is being shutdown by it's owner thread.
This is done once per thread for the task. The output connectors/edges are still active, so it is okay to call ITask::addResult from within this function safely. This is useful for flushing any final remaining data from the thread to the next task.
Implemented in htgs::ICudaTask< T, U >, htgs::ExecutionPipeline< T, U >, htgs::ITask< T, U >, htgs::ITask< U, W >, htgs::ITask< T, VoidData >, htgs::ITask< MemoryData< T >, MemoryData< T > >, htgs::Bookkeeper< T >, htgs::TGTask< T, U >, and htgs::MemoryManager< T >.