Loading...
Searching...
No Matches
VdfParallelExecutorEngineBase< Derived, DataManager > Class Template Reference

The base class for all parallel executor engines. More...

#include <parallelExecutorEngineBase.h>

Public Member Functions

 VdfParallelExecutorEngineBase (const VdfParallelExecutorEngineBase &)=delete
 Noncopyable.
 
VdfParallelExecutorEngineBaseoperator= (const VdfParallelExecutorEngineBase &)=delete
 
 VdfParallelExecutorEngineBase (const VdfExecutorInterface &executor, DataManager *dataManager)
 Constructor.
 
virtual ~VdfParallelExecutorEngineBase ()
 Destructor.
 
void RunSchedule (const VdfSchedule &schedule, const VdfRequest &computeRequest, VdfExecutorErrorLogger *errorLogger)
 Executes the given schedule with a computeRequest and an optional errorLogger.
 
template<typename Callback >
void RunSchedule (const VdfSchedule &schedule, const VdfRequest &computeRequest, VdfExecutorErrorLogger *errorLogger, Callback &&callback)
 Executes the given schedule with a computeRequest and an optional errorLogger.
 

Protected Types

typedef DataManager::DataHandle _DataHandle
 
typedef uint32_t _EvaluationStage
 

Protected Member Functions

void _ResetState (const VdfSchedule &schedule)
 
template<typename Callback >
void _RunOutput (const VdfEvaluationState &state, const VdfMaskedOutput &maskedOutput, const size_t requestedIndex, Callback &callback, WorkTaskGraph::TaskList *taskList)
 
void _SpawnRequestedTasks (const VdfEvaluationState &state, const VdfNode &node, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
void _SpawnOrBypass (WorkTaskGraph::BaseTask *task, WorkTaskGraph::BaseTask **bypass)
 
template<typename Callback >
bool _ProcessLeafTask (WorkTaskGraph::BaseTask *task, const VdfEvaluationState &state, const VdfMaskedOutput &maskedOutput, const size_t requestedIndex, Callback &callback, _EvaluationStage *evaluationStage, WorkTaskGraph::BaseTask **bypass)
 
bool _ProcessComputeTask (WorkTaskGraph::BaseTask *task, const VdfEvaluationState &state, const VdfNode &node, const VdfScheduleComputeTask &scheduleTask, _EvaluationStage *evaluationStage, WorkTaskGraph::BaseTask **bypass)
 
bool _ProcessInputsTask (WorkTaskGraph::BaseTask *task, const VdfEvaluationState &state, const VdfNode &node, const VdfScheduleInputsTask &scheduleTask, _EvaluationStage *evaluationStage, WorkTaskGraph::BaseTask **bypass)
 
bool _ProcessKeepTask (WorkTaskGraph::BaseTask *task, const VdfEvaluationState &state, const VdfNode &node, _EvaluationStage *evaluationStage, WorkTaskGraph::BaseTask **bypass)
 
bool _InvokeKeepTask (const VdfScheduleTaskIndex idx, const VdfNode &node, const VdfEvaluationState &state, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
void _InvokeTouchTask (const VdfOutput &dest, const VdfOutput &source)
 
bool _InvokeComputeTask (const VdfScheduleTaskId taskIndex, const VdfEvaluationState &state, const VdfNode &node, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
template<typename Iterable >
bool _InvokeComputeTasks (const Iterable &tasks, const VdfEvaluationState &state, const VdfNode &node, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
bool _IsInputDependencyCached (VdfScheduleInputDependencyUniqueIndex uniqueIndex, const VdfOutput &output, const VdfMask &mask)
 
bool _InvokeComputeOrKeepTasks (const VdfScheduleInputDependency &input, const VdfEvaluationState &state, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
bool _InvokeComputeOrKeepTasks (const VdfOutput &output, const VdfEvaluationState &state, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
bool _InvokePrereqInputs (const VdfScheduleInputsTask &scheduleTask, const VdfEvaluationState &state, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
bool _InvokeOptionalInputs (const VdfScheduleInputsTask &scheduleTask, const VdfEvaluationState &state, const VdfNode &node, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
bool _InvokeRequiredInputs (const VdfScheduleComputeTask &scheduleTask, const VdfEvaluationState &state, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
bool _InvokeInputsTask (const VdfScheduleComputeTask &scheduleTask, const VdfEvaluationState &state, const VdfNode &node, WorkTaskGraph::BaseTask *successor, WorkTaskGraph::BaseTask **bypass)
 
bool _InvokePrepTask (const VdfScheduleComputeTask &scheduleTask, const VdfEvaluationState &state, const VdfNode &node, WorkTaskGraph::BaseTask *successor)
 
void _PrepareNode (const VdfEvaluationState &state, const VdfNode &node)
 
void _PrepareOutput (const VdfSchedule &schedule, const VdfSchedule::OutputId outputId)
 
void _CreateScratchCache (const VdfOutput &output, const _DataHandle dataHandle, const VdfMask &mask, VdfExecutorBufferData *scratchBuffer)
 
void _EvaluateNode (const VdfScheduleComputeTask &scheduleTask, const VdfEvaluationState &state, const VdfNode &node, WorkTaskGraph::BaseTask *successor)
 
void _ComputeNode (const VdfScheduleComputeTask &scheduleTask, const VdfEvaluationState &state, const VdfNode &node)
 
void _PassThroughNode (const VdfScheduleComputeTask &scheduleTask, const VdfEvaluationState &state, const VdfNode &node)
 
void _ProcessOutput (const VdfScheduleComputeTask &scheduleTask, const VdfEvaluationState &state, const VdfOutput &output, const VdfSchedule::OutputId outputId, const _DataHandle dataHandle, const bool hasAssociatedInput, VdfExecutorBufferData *privateBuffer)
 
void _PrepareReadWriteBuffer (const VdfOutput &output, const VdfSchedule::OutputId outputId, const VdfMask &mask, const VdfSchedule &schedule, VdfExecutorBufferData *privateBuffer)
 
void _PassOrCopyBuffer (const VdfOutput &output, const VdfOutput &source, const VdfMask &inputMask, const VdfSchedule &schedule, VdfExecutorBufferData *privateBuffer)
 
void _PassBuffer (VdfExecutorBufferData *fromBuffer, VdfExecutorBufferData *toBuffer) const
 
void _CopyBuffer (const VdfOutput &output, const VdfOutput &source, const VdfMask &fromMask, VdfExecutorBufferData *toData) const
 
void _PublishScratchBuffers (const VdfSchedule &schedule, const VdfNode &node)
 
VdfVector_AbsorbPublicBuffer (const VdfOutput &output, const _DataHandle dataHandle, const VdfMask &haveMask)
 
bool _DetectInterruption (const VdfEvaluationState &state, const VdfNode &node)
 
bool _HasDetectedInterruption () const
 
void _TransportErrors (const TfErrorMark &errorMark)
 
void _PostTransportedErrors ()
 
Derived & _Self ()
 

Protected Attributes

const VdfExecutorInterface_executor
 
DataManager * _dataManager
 
WorkTaskGraph _taskGraph
 
WorkIsolatingDispatcher _isolatingDispatcher
 
std::unique_ptr< std::atomic< uint8_t >[]> _dependencyState
 
std::atomic< bool > _resetState
 
VdfParallelTaskSync _computeTasks
 
VdfParallelTaskSync _inputsTasks
 
VdfParallelTaskSync _prepTasks
 
VdfParallelTaskSync _keepTasks
 
tbb::concurrent_vector< TfErrorTransport_errors
 
std::atomic< bool > _isInterrupted
 

Detailed Description

template<typename Derived, typename DataManager>
class VdfParallelExecutorEngineBase< Derived, DataManager >

The base class for all parallel executor engines.

This executor engine evaluates a parallel task graph generated at scheduling time. It evaluates each node and all their invocations in different tasks, which can then run on separate threads. This executor engine does branch multi- threading, as well as strip-mining. It also produces multiple invocations for nodes that mutate a lot of data, potentially spreading the work of a single node across multiple threads.

Definition at line 58 of file parallelExecutorEngineBase.h.

Member Typedef Documentation

◆ _DataHandle

typedef DataManager::DataHandle _DataHandle
protected

Definition at line 107 of file parallelExecutorEngineBase.h.

◆ _EvaluationStage

typedef uint32_t _EvaluationStage
protected

Definition at line 110 of file parallelExecutorEngineBase.h.

Constructor & Destructor Documentation

◆ VdfParallelExecutorEngineBase() [1/2]

VdfParallelExecutorEngineBase ( const VdfParallelExecutorEngineBase< Derived, DataManager > &  )
delete

Noncopyable.

◆ VdfParallelExecutorEngineBase() [2/2]

VdfParallelExecutorEngineBase ( const VdfExecutorInterface executor,
DataManager *  dataManager 
)

Constructor.

Definition at line 624 of file parallelExecutorEngineBase.h.

◆ ~VdfParallelExecutorEngineBase()

Destructor.

Definition at line 640 of file parallelExecutorEngineBase.h.

Member Function Documentation

◆ _AbsorbPublicBuffer()

VdfVector * _AbsorbPublicBuffer ( const VdfOutput output,
const _DataHandle  dataHandle,
const VdfMask haveMask 
)
protected

Definition at line 2203 of file parallelExecutorEngineBase.h.

◆ _ComputeNode()

void _ComputeNode ( const VdfScheduleComputeTask scheduleTask,
const VdfEvaluationState state,
const VdfNode node 
)
protected

Definition at line 1848 of file parallelExecutorEngineBase.h.

◆ _CopyBuffer()

void _CopyBuffer ( const VdfOutput output,
const VdfOutput source,
const VdfMask fromMask,
VdfExecutorBufferData toData 
) const
protected

Definition at line 2148 of file parallelExecutorEngineBase.h.

◆ _CreateScratchCache()

void _CreateScratchCache ( const VdfOutput output,
const _DataHandle  dataHandle,
const VdfMask mask,
VdfExecutorBufferData scratchBuffer 
)
protected

Definition at line 1791 of file parallelExecutorEngineBase.h.

◆ _DetectInterruption()

bool _DetectInterruption ( const VdfEvaluationState state,
const VdfNode node 
)
protected

Definition at line 2250 of file parallelExecutorEngineBase.h.

◆ _EvaluateNode()

void _EvaluateNode ( const VdfScheduleComputeTask scheduleTask,
const VdfEvaluationState state,
const VdfNode node,
WorkTaskGraph::BaseTask successor 
)
protected

Definition at line 1821 of file parallelExecutorEngineBase.h.

◆ _HasDetectedInterruption()

bool _HasDetectedInterruption
protected

Definition at line 2275 of file parallelExecutorEngineBase.h.

◆ _InvokeComputeOrKeepTasks() [1/2]

bool _InvokeComputeOrKeepTasks ( const VdfOutput output,
const VdfEvaluationState state,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1475 of file parallelExecutorEngineBase.h.

◆ _InvokeComputeOrKeepTasks() [2/2]

bool _InvokeComputeOrKeepTasks ( const VdfScheduleInputDependency input,
const VdfEvaluationState state,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1430 of file parallelExecutorEngineBase.h.

◆ _InvokeComputeTask()

bool _InvokeComputeTask ( const VdfScheduleTaskId  taskIndex,
const VdfEvaluationState state,
const VdfNode node,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1347 of file parallelExecutorEngineBase.h.

◆ _InvokeComputeTasks()

bool _InvokeComputeTasks ( const Iterable &  tasks,
const VdfEvaluationState state,
const VdfNode node,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1375 of file parallelExecutorEngineBase.h.

◆ _InvokeInputsTask()

bool _InvokeInputsTask ( const VdfScheduleComputeTask scheduleTask,
const VdfEvaluationState state,
const VdfNode node,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1642 of file parallelExecutorEngineBase.h.

◆ _InvokeKeepTask()

bool _InvokeKeepTask ( const VdfScheduleTaskIndex  idx,
const VdfNode node,
const VdfEvaluationState state,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1307 of file parallelExecutorEngineBase.h.

◆ _InvokeOptionalInputs()

bool _InvokeOptionalInputs ( const VdfScheduleInputsTask scheduleTask,
const VdfEvaluationState state,
const VdfNode node,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1549 of file parallelExecutorEngineBase.h.

◆ _InvokePrepTask()

bool _InvokePrepTask ( const VdfScheduleComputeTask scheduleTask,
const VdfEvaluationState state,
const VdfNode node,
WorkTaskGraph::BaseTask successor 
)
protected

Definition at line 1678 of file parallelExecutorEngineBase.h.

◆ _InvokePrereqInputs()

bool _InvokePrereqInputs ( const VdfScheduleInputsTask scheduleTask,
const VdfEvaluationState state,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1519 of file parallelExecutorEngineBase.h.

◆ _InvokeRequiredInputs()

bool _InvokeRequiredInputs ( const VdfScheduleComputeTask scheduleTask,
const VdfEvaluationState state,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1615 of file parallelExecutorEngineBase.h.

◆ _InvokeTouchTask()

void _InvokeTouchTask ( const VdfOutput dest,
const VdfOutput source 
)
protected

Definition at line 1332 of file parallelExecutorEngineBase.h.

◆ _IsInputDependencyCached()

bool _IsInputDependencyCached ( VdfScheduleInputDependencyUniqueIndex  uniqueIndex,
const VdfOutput output,
const VdfMask mask 
)
protected

Definition at line 1394 of file parallelExecutorEngineBase.h.

◆ _PassBuffer()

void _PassBuffer ( VdfExecutorBufferData fromBuffer,
VdfExecutorBufferData toBuffer 
) const
protected

Definition at line 2133 of file parallelExecutorEngineBase.h.

◆ _PassOrCopyBuffer()

void _PassOrCopyBuffer ( const VdfOutput output,
const VdfOutput source,
const VdfMask inputMask,
const VdfSchedule schedule,
VdfExecutorBufferData privateBuffer 
)
protected

Definition at line 2088 of file parallelExecutorEngineBase.h.

◆ _PassThroughNode()

void _PassThroughNode ( const VdfScheduleComputeTask scheduleTask,
const VdfEvaluationState state,
const VdfNode node 
)
protected

Definition at line 1920 of file parallelExecutorEngineBase.h.

◆ _PostTransportedErrors()

void _PostTransportedErrors
protected

Definition at line 2292 of file parallelExecutorEngineBase.h.

◆ _PrepareNode()

void _PrepareNode ( const VdfEvaluationState state,
const VdfNode node 
)
protected

Definition at line 1723 of file parallelExecutorEngineBase.h.

◆ _PrepareOutput()

void _PrepareOutput ( const VdfSchedule schedule,
const VdfSchedule::OutputId  outputId 
)
protected

Definition at line 1743 of file parallelExecutorEngineBase.h.

◆ _PrepareReadWriteBuffer()

void _PrepareReadWriteBuffer ( const VdfOutput output,
const VdfSchedule::OutputId  outputId,
const VdfMask mask,
const VdfSchedule schedule,
VdfExecutorBufferData privateBuffer 
)
protected

Definition at line 2052 of file parallelExecutorEngineBase.h.

◆ _ProcessComputeTask()

bool _ProcessComputeTask ( WorkTaskGraph::BaseTask task,
const VdfEvaluationState state,
const VdfNode node,
const VdfScheduleComputeTask scheduleTask,
_EvaluationStage *  evaluationStage,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1093 of file parallelExecutorEngineBase.h.

◆ _ProcessInputsTask()

bool _ProcessInputsTask ( WorkTaskGraph::BaseTask task,
const VdfEvaluationState state,
const VdfNode node,
const VdfScheduleInputsTask scheduleTask,
_EvaluationStage *  evaluationStage,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1178 of file parallelExecutorEngineBase.h.

◆ _ProcessKeepTask()

bool _ProcessKeepTask ( WorkTaskGraph::BaseTask task,
const VdfEvaluationState state,
const VdfNode node,
_EvaluationStage *  evaluationStage,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1241 of file parallelExecutorEngineBase.h.

◆ _ProcessLeafTask()

bool _ProcessLeafTask ( WorkTaskGraph::BaseTask task,
const VdfEvaluationState state,
const VdfMaskedOutput maskedOutput,
const size_t  requestedIndex,
Callback &  callback,
_EvaluationStage *  evaluationStage,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1053 of file parallelExecutorEngineBase.h.

◆ _ProcessOutput()

void _ProcessOutput ( const VdfScheduleComputeTask scheduleTask,
const VdfEvaluationState state,
const VdfOutput output,
const VdfSchedule::OutputId  outputId,
const _DataHandle  dataHandle,
const bool  hasAssociatedInput,
VdfExecutorBufferData privateBuffer 
)
protected

Definition at line 1953 of file parallelExecutorEngineBase.h.

◆ _PublishScratchBuffers()

void _PublishScratchBuffers ( const VdfSchedule schedule,
const VdfNode node 
)
protected

Definition at line 2174 of file parallelExecutorEngineBase.h.

◆ _ResetState()

void _ResetState ( const VdfSchedule schedule)
protected

Definition at line 726 of file parallelExecutorEngineBase.h.

◆ _RunOutput()

void _RunOutput ( const VdfEvaluationState state,
const VdfMaskedOutput maskedOutput,
const size_t  requestedIndex,
Callback &  callback,
WorkTaskGraph::TaskList taskList 
)
protected

Definition at line 753 of file parallelExecutorEngineBase.h.

◆ _Self()

Derived & _Self ( )
inlineprotected

Definition at line 584 of file parallelExecutorEngineBase.h.

◆ _SpawnOrBypass()

void _SpawnOrBypass ( WorkTaskGraph::BaseTask task,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 1035 of file parallelExecutorEngineBase.h.

◆ _SpawnRequestedTasks()

void _SpawnRequestedTasks ( const VdfEvaluationState state,
const VdfNode node,
WorkTaskGraph::BaseTask successor,
WorkTaskGraph::BaseTask **  bypass 
)
protected

Definition at line 986 of file parallelExecutorEngineBase.h.

◆ _TransportErrors()

void _TransportErrors ( const TfErrorMark errorMark)
protected

Definition at line 2283 of file parallelExecutorEngineBase.h.

◆ RunSchedule() [1/2]

void RunSchedule ( const VdfSchedule schedule,
const VdfRequest &  computeRequest,
VdfExecutorErrorLogger errorLogger 
)
inline

Executes the given schedule with a computeRequest and an optional errorLogger.

Definition at line 84 of file parallelExecutorEngineBase.h.

◆ RunSchedule() [2/2]

void RunSchedule ( const VdfSchedule schedule,
const VdfRequest &  computeRequest,
VdfExecutorErrorLogger errorLogger,
Callback &&  callback 
)

Executes the given schedule with a computeRequest and an optional errorLogger.

Concurrently invokes callback after evaluation of each uncached output in the request, and immediatelly after hitting the cache for cached outputs in the request.

Definition at line 648 of file parallelExecutorEngineBase.h.

Member Data Documentation

◆ _computeTasks

VdfParallelTaskSync _computeTasks
protected

Definition at line 609 of file parallelExecutorEngineBase.h.

◆ _dataManager

DataManager* _dataManager
protected

Definition at line 592 of file parallelExecutorEngineBase.h.

◆ _dependencyState

std::unique_ptr<std::atomic<uint8_t>[]> _dependencyState
protected

Definition at line 602 of file parallelExecutorEngineBase.h.

◆ _errors

tbb::concurrent_vector<TfErrorTransport> _errors
protected

Definition at line 615 of file parallelExecutorEngineBase.h.

◆ _executor

const VdfExecutorInterface& _executor
protected

Definition at line 589 of file parallelExecutorEngineBase.h.

◆ _inputsTasks

VdfParallelTaskSync _inputsTasks
protected

Definition at line 610 of file parallelExecutorEngineBase.h.

◆ _isInterrupted

std::atomic<bool> _isInterrupted
protected

Definition at line 618 of file parallelExecutorEngineBase.h.

◆ _isolatingDispatcher

WorkIsolatingDispatcher _isolatingDispatcher
protected

Definition at line 598 of file parallelExecutorEngineBase.h.

◆ _keepTasks

VdfParallelTaskSync _keepTasks
protected

Definition at line 612 of file parallelExecutorEngineBase.h.

◆ _prepTasks

VdfParallelTaskSync _prepTasks
protected

Definition at line 611 of file parallelExecutorEngineBase.h.

◆ _resetState

std::atomic<bool> _resetState
protected

Definition at line 608 of file parallelExecutorEngineBase.h.

◆ _taskGraph

WorkTaskGraph _taskGraph
protected

Definition at line 595 of file parallelExecutorEngineBase.h.


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