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

Task plugging into state transition once task becomes ready. 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, ReadyFusableTasks *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::list< Task * > &otherTasks, int targetDevice=Host)
 Fuse multiple tasks.
 
virtual std::string toString () const
 

Static Public Member Functions

static void insertReadyTask (Task *task, int taskNumber, ReadyFusableTasks *taskQueue)
 Insert a new ready task into the local queues.
 

Private Attributes

Task_task
 
const int _taskNumber
 
ReadyFusableTasks_taskQueue
 

Static Private Attributes

static const std::string SubmitFusedTasksStatisticsIdentifier = "tarch::multicore::taskfusion::submit-fused-tasks"
 
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

Task plugging into state transition once task becomes ready.

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

Constructor & Destructor Documentation

◆ LogReadyTask()

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

Definition at line 12 of file LogReadyTask.cpp.

Member Function Documentation

◆ insertReadyTask()

void tarch::multicore::taskfusion::LogReadyTask::insertReadyTask ( Task * task,
int taskNumber,
ReadyFusableTasks * taskQueue )
static

Insert a new ready task into the local queues.

Is used by run() but we might also want to use it externally. Before we insert the actual task, we also remove the task's completedTaskNumbers, so noone thinks ahead of time that we are done already.

Definition at line 29 of file LogReadyTask.cpp.

References tarch::multicore::taskfusion::ReadyFusableTasks::completedTaskNumbers, tarch::multicore::taskfusion::ReadyFusableTasks::completedTasksSemaphore, tarch::multicore::taskfusion::ReadyFusableTasks::readyTasksSemaphore, and tarch::multicore::taskfusion::ReadyFusableTasks::tasks.

Referenced by tarch::multicore::taskfusion::translateFusableTaskIntoTaskSequence().

Here is the caller graph for this function:

◆ run()

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. translateFusableTaskIntoTaskSequence() 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.

Definition at line 20 of file LogReadyTask.cpp.

References tarch::logging::Statistics::getInstance(), tarch::logging::Statistics::inc(), and logDebug.

Here is the call graph for this function:

Field Documentation

◆ _log

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

Definition at line 37 of file LogReadyTask.h.

◆ _task

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

Definition at line 31 of file LogReadyTask.h.

◆ _taskNumber

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

Definition at line 32 of file LogReadyTask.h.

◆ _taskQueue

ReadyFusableTasks* tarch::multicore::taskfusion::LogReadyTask::_taskQueue
private

Definition at line 33 of file LogReadyTask.h.

◆ SubmitFusedTasksStatisticsIdentifier

const std::string tarch::multicore::taskfusion::LogReadyTask::SubmitFusedTasksStatisticsIdentifier = "tarch::multicore::taskfusion::submit-fused-tasks"
staticprivate

Definition at line 35 of file LogReadyTask.h.


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