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, int taskNumber, FusableTasksQueue &taskQueue)
 Construct log read task.
 
virtual void run () override
 Run 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

Task_task
 
const int _taskNumber
 
FusableTasksQueue_taskQueue
 

Static Private Attributes

static const std::string SubmitFusedTasksStatisticsIdentifier
 
static tarch::logging::Log _log
 

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
 

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 45 of file LogReadyTask.h.

Constructor & Destructor Documentation

◆ LogReadyTask()

tarch::multicore::taskfusion::LogReadyTask::LogReadyTask ( Task * task,
int 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

◆ 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

◆ _log

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

Definition at line 53 of file LogReadyTask.h.

◆ _task

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

Definition at line 47 of file LogReadyTask.h.

◆ _taskNumber

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

Definition at line 48 of file LogReadyTask.h.

◆ _taskQueue

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

Definition at line 49 of file LogReadyTask.h.

◆ SubmitFusedTasksStatisticsIdentifier

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

Definition at line 51 of file LogReadyTask.h.


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