Peano
Loading...
Searching...
No Matches
tarch::multicore::taskfusion::LogReadyTask Class Reference

Wrapper task around fusable tasks that is not ready yet. More...

#include <LogReadyTask.h>

Inheritance diagram for tarch::multicore::taskfusion::LogReadyTask:
Collaboration diagram for tarch::multicore::taskfusion::LogReadyTask:

Public Member Functions

 LogReadyTask (Task *task, TaskNumber taskNumber, FusableTasksQueue &taskQueue)
 Construct log read task.
 
virtual void run () override
 Run task.
 
TaskNumber getNumber () const
 
- 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
 

Static Public Attributes

static constexpr TaskNumber AdministerYourOwnTemporaryTaskLocalNumber = -3
 
- Static Public Attributes inherited from tarch::multicore::Task
static constexpr int DefaultPriority = 1024
 
static constexpr int Host = -1
 
static constexpr int DontFuse = -1
 

Private Attributes

Task * _task
 
const int _taskNumber
 
FusableTasksQueue & _taskQueue
 
const bool _administerYourOwnTemporaryTaskLocalNumber
 

Static Private Attributes

static const std::string SubmitFusedTasksStatisticsIdentifier
 Statistics identifier.
 
static tarch::logging::Log _log
 
static tarch::multicore::TaskEnumerator _enumerator
 

Additional Inherited Members

- Protected Attributes inherited from tarch::multicore::Task
const int _taskType
 
int _priority
 

Detailed Description

Wrapper task around fusable tasks that is not ready yet.

This task takes a fusable task and "inherits" its in-dependencies. Once it becomes ready ready, it takes its fusable task and inserts this one into the ready queue. The task therefore is a mere wrapper: It ensure that a fusable task is not inserted into the ready queue before it really becomes ready. Other than that, it does not do anything.

Lazy evaluation strategies

If the fusion is implemented lazily, the spawning of a new fusable task with in-dependencies should lead to the creation of this task. The fusable routine then has to wait before the lazy evaluation is due, so we know that the right tasks are inserted.

Orchestration

This task is always paired up with an instance of ProcessReadyTask. This task takes the task _task and puts it into the _taskQueue. After that, it quits, i.e. logically hands over the responsibility to ProcessReadyTask.

Definition at line 46 of file LogReadyTask.h.

Constructor & Destructor Documentation

◆ LogReadyTask()

tarch::multicore::taskfusion::LogReadyTask::LogReadyTask ( Task *  task,
TaskNumber  taskNumber,
FusableTasksQueue &  taskQueue 
)

Construct log read task.

Parameters
taskTask that is to be inserted into fusable queue as soon as this task starts to run
taskNumberout dependency (no) of outgoing task
taskQueueReference to task queue

Member Function Documentation

◆ getNumber()

TaskNumber tarch::multicore::taskfusion::LogReadyTask::getNumber ( ) const

◆ run()

virtual void tarch::multicore::taskfusion::LogReadyTask::run ( )
overridevirtual

Run task.

If this routine is invoked, we know that all the incoming dependencies of _task are now complete. We refrain from running the task now (even though it would be valid). Instead, we lock our queue and add the task. handleFusableTask() should already have issued a follow-up task of type ProcessReadyTask. Therefore, this is all to be done here. No more work.

Implements tarch::multicore::Task.

Field Documentation

◆ _administerYourOwnTemporaryTaskLocalNumber

const bool tarch::multicore::taskfusion::LogReadyTask::_administerYourOwnTemporaryTaskLocalNumber
private

Definition at line 52 of file LogReadyTask.h.

◆ _enumerator

tarch::multicore::TaskEnumerator tarch::multicore::taskfusion::LogReadyTask::_enumerator
staticprivate

Definition at line 68 of file LogReadyTask.h.

◆ _log

tarch::logging::Log tarch::multicore::taskfusion::LogReadyTask::_log
staticprivate

Definition at line 66 of file LogReadyTask.h.

◆ _task

Task* tarch::multicore::taskfusion::LogReadyTask::_task
private

Definition at line 48 of file LogReadyTask.h.

◆ _taskNumber

const int tarch::multicore::taskfusion::LogReadyTask::_taskNumber
private

Definition at line 49 of file LogReadyTask.h.

◆ _taskQueue

FusableTasksQueue& tarch::multicore::taskfusion::LogReadyTask::_taskQueue
private

Definition at line 50 of file LogReadyTask.h.

◆ AdministerYourOwnTemporaryTaskLocalNumber

constexpr TaskNumber tarch::multicore::taskfusion::LogReadyTask::AdministerYourOwnTemporaryTaskLocalNumber = -3
staticconstexpr

Definition at line 70 of file LogReadyTask.h.

◆ SubmitFusedTasksStatisticsIdentifier

const std::string tarch::multicore::taskfusion::LogReadyTask::SubmitFusedTasksStatisticsIdentifier
staticprivate

Statistics identifier.

This statistics identifier tells you how many tasks have actually been submitted through a LogReadyTask. If fusable tasks hit the runtime and are ready already, we insert them straight. If they are not ready yet, they are given in custody of a LogReadyTask which dumps them later. To analyse this flag, you can follow the recipe of tarch::multicore::SpawnedTasksStatisticsIdentifier.

Definition at line 64 of file LogReadyTask.h.


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