ExaTN
Public Member Functions | Protected Attributes | List of all members
exatn::runtime::TensorGraph Class Referenceabstract
Inheritance diagram for exatn::runtime::TensorGraph:
exatn::Identifiable exatn::Cloneable< TensorGraph > exatn::runtime::DirectedBoostGraph

Public Member Functions

 TensorGraph (const TensorGraph &)=delete
 
TensorGraphoperator= (const TensorGraph &)=delete
 
 TensorGraph (TensorGraph &&) noexcept=default
 
TensorGraphoperator= (TensorGraph &&) noexcept=default
 
virtual VertexIdType addOperation (std::shared_ptr< TensorOperation > op)=0
 
virtual void addDependency (VertexIdType dependent, VertexIdType dependee)=0
 
virtual bool dependencyExists (VertexIdType vertex_id1, VertexIdType vertex_id2)=0
 
virtual TensorOpNodegetNodeProperties (VertexIdType vertex_id)=0
 
virtual std::size_t getNodeDegree (VertexIdType vertex_id)=0
 
virtual std::size_t getNumNodes ()=0
 
virtual std::size_t getNumDependencies ()=0
 
virtual std::vector< VertexIdType > getNeighborList (VertexIdType vertex_id)=0
 
virtual void computeShortestPath (VertexIdType startIndex, std::vector< double > &distances, std::vector< VertexIdType > &paths)=0
 
virtual void printIt ()=0
 
virtual std::shared_ptr< TensorGraphclone ()=0
 
void setNodeExecuting (VertexIdType vertex_id)
 
void setNodeExecuted (VertexIdType vertex_id, int error_code=0)
 
void setNodeIdle (VertexIdType vertex_id)
 
bool nodeExecuting (VertexIdType vertex_id)
 
bool nodeExecuted (VertexIdType vertex_id, int *error_code=nullptr)
 
std::size_t getTensorUpdateCount (const Tensor &tensor)
 
void registerDependencyFreeNode (VertexIdType node_id)
 
bool extractDependencyFreeNode (VertexIdType *node_id)
 
void registerExecutingNode (VertexIdType node_id)
 
bool extractExecutingNode (VertexIdType *node_id)
 
bool progressFrontNode (VertexIdType node_executed)
 
VertexIdType getFrontNode () const
 
bool hasUnexecutedNodes ()
 
void lock ()
 
void unlock ()
 
- Public Member Functions inherited from exatn::Identifiable
virtual const std::string name () const =0
 
virtual const std::string description () const =0
 
- Public Member Functions inherited from exatn::Cloneable< TensorGraph >
virtual ~Cloneable ()
 

Protected Attributes

TensorExecState exec_state_
 

Member Function Documentation

◆ addDependency()

virtual void exatn::runtime::TensorGraph::addDependency ( VertexIdType  dependent,
VertexIdType  dependee 
)
pure virtual

Adds a directed edge between dependent and dependee DAG nodes: <dependent> depends on <dependee> (dependent –> dependee).

Implemented in exatn::runtime::DirectedBoostGraph.

◆ addOperation()

virtual VertexIdType exatn::runtime::TensorGraph::addOperation ( std::shared_ptr< TensorOperation op)
pure virtual

Adds a new node (tensor operation) into the DAG and returns its id.

Implemented in exatn::runtime::DirectedBoostGraph.

◆ clone()

virtual std::shared_ptr<TensorGraph> exatn::runtime::TensorGraph::clone ( )
pure virtual

Clones an empty subclass instance (needed for plugin registry).

Implements exatn::Cloneable< TensorGraph >.

Implemented in exatn::runtime::DirectedBoostGraph.

◆ computeShortestPath()

virtual void exatn::runtime::TensorGraph::computeShortestPath ( VertexIdType  startIndex,
std::vector< double > &  distances,
std::vector< VertexIdType > &  paths 
)
pure virtual

Computes the shortest path from the start index.

Implemented in exatn::runtime::DirectedBoostGraph.

◆ dependencyExists()

virtual bool exatn::runtime::TensorGraph::dependencyExists ( VertexIdType  vertex_id1,
VertexIdType  vertex_id2 
)
pure virtual

Returns TRUE if there is a dependency between two DAG nodes: If vertex_id1 node depends on vertex_id2 node.

Implemented in exatn::runtime::DirectedBoostGraph.

◆ extractDependencyFreeNode()

bool exatn::runtime::TensorGraph::extractDependencyFreeNode ( VertexIdType *  node_id)
inline

Extracts a dependency-free node from the list. Returns FALSE if no such node exists.

◆ extractExecutingNode()

bool exatn::runtime::TensorGraph::extractExecutingNode ( VertexIdType *  node_id)
inline

Extracts an executed DAG node from the list of executing nodes.

◆ getFrontNode()

VertexIdType exatn::runtime::TensorGraph::getFrontNode ( ) const
inline

Returns the current front node id.

◆ getNeighborList()

virtual std::vector<VertexIdType> exatn::runtime::TensorGraph::getNeighborList ( VertexIdType  vertex_id)
pure virtual

Returns the list of nodes connected to the given DAG node.

Implemented in exatn::runtime::DirectedBoostGraph.

◆ getNodeDegree()

virtual std::size_t exatn::runtime::TensorGraph::getNodeDegree ( VertexIdType  vertex_id)
pure virtual

Returns the number of nodes the given node is connected to.

Implemented in exatn::runtime::DirectedBoostGraph.

◆ getNodeProperties()

virtual TensorOpNode& exatn::runtime::TensorGraph::getNodeProperties ( VertexIdType  vertex_id)
pure virtual

Returns the properties (TensorOpNode) of a given DAG node (by reference). Subsequently, one may need to lock/unlock the returned TensorOpNode in order to ensure a mutually exclusive access to it.

Implemented in exatn::runtime::DirectedBoostGraph.

◆ getNumDependencies()

virtual std::size_t exatn::runtime::TensorGraph::getNumDependencies ( )
pure virtual

Returns the total number of dependencies (directed edges) in the DAG.

Implemented in exatn::runtime::DirectedBoostGraph.

◆ getNumNodes()

virtual std::size_t exatn::runtime::TensorGraph::getNumNodes ( )
pure virtual

Returns the total number of nodes in the DAG.

Implemented in exatn::runtime::DirectedBoostGraph.

◆ getTensorUpdateCount()

std::size_t exatn::runtime::TensorGraph::getTensorUpdateCount ( const Tensor tensor)
inline

Returns the current outstanding update count on the tensor in the DAG.

◆ hasUnexecutedNodes()

bool exatn::runtime::TensorGraph::hasUnexecutedNodes ( )
inline

Affirms that the DAG has unexecuted nodes.

◆ nodeExecuted()

bool exatn::runtime::TensorGraph::nodeExecuted ( VertexIdType  vertex_id,
int *  error_code = nullptr 
)
inline

Returns TRUE if the DAG node has been executed to completion, error_code will return the error code (if executed).

◆ nodeExecuting()

bool exatn::runtime::TensorGraph::nodeExecuting ( VertexIdType  vertex_id)
inline

Returns TRUE if the DAG node is currently being executed.

◆ printIt()

virtual void exatn::runtime::TensorGraph::printIt ( )
pure virtual

Prints the DAG

Implemented in exatn::runtime::DirectedBoostGraph.

◆ progressFrontNode()

bool exatn::runtime::TensorGraph::progressFrontNode ( VertexIdType  node_executed)
inline

Given just executed DAG node, moves forward the DAG front node if appropriate.

◆ registerDependencyFreeNode()

void exatn::runtime::TensorGraph::registerDependencyFreeNode ( VertexIdType  node_id)
inline

Registers a DAG node without dependencies.

◆ registerExecutingNode()

void exatn::runtime::TensorGraph::registerExecutingNode ( VertexIdType  node_id)
inline

Registers a DAG node as being executed.

◆ setNodeExecuted()

void exatn::runtime::TensorGraph::setNodeExecuted ( VertexIdType  vertex_id,
int  error_code = 0 
)
inline

Marks the DAG node as executed to completion.

◆ setNodeExecuting()

void exatn::runtime::TensorGraph::setNodeExecuting ( VertexIdType  vertex_id)
inline

Marks the DAG node as being currently executed.

◆ setNodeIdle()

void exatn::runtime::TensorGraph::setNodeIdle ( VertexIdType  vertex_id)
inline

Marks the DAG node as idle.


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