|
Peano
|
Process one ready tasks. More...
#include <ProcessOneReadyTask.h>


Public Member Functions | |
| ProcessOneReadyTask (TaskNumber taskNumber, FusableTasksQueue &taskQueue) | |
| Construct task. | |
| virtual void | run () override |
| Run the task. | |
Public Member Functions inherited from tarch::multicore::Task | |
| Task (int taskType, int priority) | |
| Construct task. | |
| virtual | ~Task () |
| int | getTaskType () const |
| int | getPriority () const |
| void | setPriority (int priority) |
| Set priority. | |
| virtual bool | canFuse () const |
| virtual void | fuse (const std::vector< Task * > &otherTasks, int targetDevice=Host) |
| Fuse multiple tasks. | |
| virtual std::string | toString () const |
Private Attributes | |
| FusableTasksQueue & | _taskQueue |
| const TaskNumber | _taskNumber |
Static Private Attributes | |
| static tarch::logging::Log | _log |
| static const std::string | ProcessOneReadyTaskFromFusableTasksStatisticsIdentifier |
| Track how often runtime extracted single task from fusable task queue. | |
| static const std::string | WaitedForOneReadyTaskFromFusableTasksStatisticsIdentifier |
| Along the same lines, tarch::multicore::taskfusion::ProcessOneReadyTask::WaitedForOneReadyTaskFromFusableTasksStatisticsIdentifier tracks how often the runtime tried to extract a task from the queue but it had, at that point, already been processed by someone else. | |
Additional Inherited Members | |
Static Public Attributes inherited from tarch::multicore::Task | |
| static constexpr int | DefaultPriority = 1024 |
| static constexpr int | Host = -1 |
| static constexpr int | DontFuse = -1 |
Protected Attributes inherited from tarch::multicore::Task | |
| const int | _taskType |
| int | _priority |
Process one ready tasks.
Definition at line 29 of file ProcessOneReadyTask.h.
| tarch::multicore::taskfusion::ProcessOneReadyTask::ProcessOneReadyTask | ( | TaskNumber | taskNumber, |
| FusableTasksQueue & | taskQueue | ||
| ) |
Construct task.
|
overridevirtual |
Run the task.
Will return if and only if the task with taskNumber is completed. We ensure this by calling processTasks() which in turn invokes tryToProcessOneTask().
If the task we are tied to is already completed - a property we can check through hasTaskBeenProcessed() - we return immediately and nothing is to be done. Another ProcessReadyTask instance has snapped "our" task and we can degenerate.
If the task is handled by an instance of ProcessSetOfReadyTasks, we wait for this one.
If neither of the two cases hold, we'll only process the one single tasks that we are responsible for (and therefore will afterwards terminate the while loop). But we might
Ensure one particular task is completed.
Search for the one task we are waiting for. If you find it, process it. It could be that we don't have this task anymore among the ready tasks but that it is currently merged into a bigger fusable task set and processed. In this case, we have to issue a native wait on the task that handles the actual fusion.
Implements tarch::multicore::Task.
|
staticprivate |
Definition at line 34 of file ProcessOneReadyTask.h.
|
private |
Definition at line 32 of file ProcessOneReadyTask.h.
|
private |
Definition at line 31 of file ProcessOneReadyTask.h.
|
staticprivate |
Track how often runtime extracted single task from fusable task queue.
The quantity tells us how many fusable tasks have been manually removed from the fusable queue, as the runtime requested the task outcome asap.
The impact/implication of this tracker is discussed on Task fusion strategies. To visualise it, you can follow the same scheme as used for tarch::multicore::SpawnedTasksStatisticsIdentifier.
If this counter is high compared to the total number of fusable tasks, it means that the runtime had been asked frequently that a task outcome is now urgently needed. Therefore, it decided to interrupt the fusion, search for this one task, complete it "manually" with high priority and return. A high counter hence means that the fusion is not really efficient.
Definition at line 57 of file ProcessOneReadyTask.h.
|
staticprivate |
Along the same lines, tarch::multicore::taskfusion::ProcessOneReadyTask::WaitedForOneReadyTaskFromFusableTasksStatisticsIdentifier tracks how often the runtime tried to extract a task from the queue but it had, at that point, already been processed by someone else.
We therefore had to wait.
Definition at line 66 of file ProcessOneReadyTask.h.