| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Private Attributes | List of all members
concurrency::AlgorithmNode Class Reference

`#include <src/PrecedenceRulesGraph.h>`

Inheritance diagram for concurrency::AlgorithmNode:
[legend]
Collaboration diagram for concurrency::AlgorithmNode:
[legend]

## Public Member Functions
| AlgorithmNode (PrecedenceRulesGraph &graph, Algorithm *algoPtr, unsigned int nodeIndex, unsigned int algoIndex, bool inverted, bool allPass)
| Constructor. More...
| ~AlgorithmNode ()
| Destructor. More...
bool | accept (IGraphVisitor &visitor) override
| Visitor entry point. More...
void | addParentNode (DecisionNode *node)
| Add a parent node. More...
const std::vector< DecisionNode * > & | getParentDecisionHubs () const
| Get all parent decision hubs. More...
void | addOutputDataNode (DataNode *node)
| Associate an AlgorithmNode, which is a data supplier for this one. More...
void | addInputDataNode (DataNode *node)
| Associate an AlgorithmNode, which is a data consumer of this one. More...
const std::vector< DataNode * > & | getOutputDataNodes () const
| Get all supplier nodes. More...
const std::vector< DataNode * > & | getInputDataNodes () const
| Get all consumer nodes. More...
void | setRank (float &rank)
| Set Algorithm rank. More...
const float & | getRank () const
| Get Algorithm rank. More...
Algorithm * | getAlgorithm () const
| get Algorithm representatives More...
const unsigned int & | getAlgoIndex () const
| Get algorithm index. More...
void | setIOBound (bool value)
| Set the I/O-boundness flag. More...
bool | isIOBound () const
| Check if algorithm is I/O-bound. More...
bool | isOptimist () const
| Check if positive control flow decision is enforced. More...
bool | isLiar () const
| Check if control flow logic is always inverted. More...
void | printState (std::stringstream &output, AlgsExecutionStates &states, const std::vector< int > &node_decisions, const unsigned int &recursionLevel) const override
| Print a string representing the control flow state. More...
Public Member Functions inherited from concurrency::ControlFlowNode
| ControlFlowNode (PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name)
| Constructor. More...
virtual | ~ControlFlowNode ()
| Destructor. More...
const unsigned int & | getNodeIndex () const
| Get node index. More...
const std::string & | getNodeName () const
| Get node name. More...

## Public Attributes
std::vector< DecisionNode * > | m_parents
| Control flow parents of an AlgorithmNode (DecisionNodes) More...
Public Attributes inherited from concurrency::ControlFlowNode
PrecedenceRulesGraph * | m_graph

## Private Attributes
Algorithm * | m_algorithm
| Algorithm representative behind the AlgorithmNode. More...
unsigned int | m_algoIndex
| The index of the algorithm. More...
std::string | m_algoName
| The name of the algorithm. More...
bool | m_inverted
| Whether the selection result is negated or not. More...
bool | m_allPass
| Whether the selection result is relevant or always "pass". More...
float | m_rank
| Algorithm rank of any kind. More...
bool | m_isIOBound
| If an algorithm is blocking. More...
std::vector< DataNode * > | m_outputs
| Algorithm outputs (DataNodes) More...
std::vector< DataNode * > | m_inputs
| Algorithm inputs (DataNodes) More...

## Additional Inherited Members
Protected Member Functions inherited from concurrency::ControlFlowNode
std::string | stateToString (const int &stateId) const
| Translation between state id and name. More...
Protected Attributes inherited from concurrency::ControlFlowNode
unsigned int | m_nodeIndex
std::string | m_nodeName

## Detailed Description

Definition at line 531 of file PrecedenceRulesGraph.h.

## Constructor & Destructor Documentation

concurrency::AlgorithmNode::AlgorithmNode | ( | PrecedenceRulesGraph & | graph,
|  | Algorithm * | algoPtr,
|  | unsigned int | nodeIndex,
|  | unsigned int | algoIndex,
|  | bool | inverted,
|  | bool | allPass
| ) |  |
| inline

Constructor.

Definition at line 535 of file PrecedenceRulesGraph.h.

537 : ControlFlowNode( graph, nodeIndex, algoPtr->name() )
538 , m_algorithm( algoPtr )
539 , m_algoIndex( algoIndex )
540 , m_algoName( algoPtr->name() )
541 , m_inverted( inverted )
542 , m_allPass( allPass )
543 , m_rank( -1 )
544 , m_isIOBound( algoPtr->isIOBound() ){};
concurrency::ControlFlowNode::ControlFlowNode
ControlFlowNode(PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name)
Constructor.
Definition: PrecedenceRulesGraph.h:451
concurrency::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: PrecedenceRulesGraph.h:597
Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:737
concurrency::AlgorithmNode::m_algoName
std::string m_algoName
The name of the algorithm.
Definition: PrecedenceRulesGraph.h:599
concurrency::AlgorithmNode::m_inverted
bool m_inverted
Whether the selection result is negated or not.
Definition: PrecedenceRulesGraph.h:601
concurrency::AlgorithmNode::m_algorithm
Algorithm * m_algorithm
Algorithm representative behind the AlgorithmNode.
Definition: PrecedenceRulesGraph.h:595
concurrency::AlgorithmNode::m_rank
float m_rank
Algorithm rank of any kind.
Definition: PrecedenceRulesGraph.h:605
plotSpeedupsPyRoot.graph
graph
Definition: plotSpeedupsPyRoot.py:142
Algorithm::isIOBound
bool isIOBound() const
Definition: Algorithm.h:474
concurrency::AlgorithmNode::m_isIOBound
bool m_isIOBound
If an algorithm is blocking.
Definition: PrecedenceRulesGraph.h:607
concurrency::AlgorithmNode::m_allPass
bool m_allPass
Whether the selection result is relevant or always "pass".
Definition: PrecedenceRulesGraph.h:603

concurrency::AlgorithmNode::~AlgorithmNode | ( |  | ) |

Destructor.

Definition at line 90 of file PrecedenceRulesGraph.cpp.

91 {
92
93 for ( auto node : m_outputs ) {
94 delete node;
95 }
96 }
concurrency::AlgorithmNode::m_outputs
std::vector< DataNode * > m_outputs
Algorithm outputs (DataNodes)
Definition: PrecedenceRulesGraph.h:610

## Member Function Documentation

bool concurrency::AlgorithmNode::accept | ( | IGraphVisitor & | visitor | ) |
| override virtual

Visitor entry point.

Implements concurrency::ControlFlowNode.

Definition at line 109 of file PrecedenceRulesGraph.cpp.

110 {
111
112 if ( visitor.visitEnter( *this ) ) {
113 visitor.visit( *this );
114 return true; // visitor was accepted to promote the algorithm
115 }
116
117 return false; // visitor was rejected (since the algorithm already produced a decision)
118 }

void concurrency::AlgorithmNode::addInputDataNode | ( | DataNode * | node | ) |

Associate an AlgorithmNode, which is a data consumer of this one.

Definition at line 135 of file PrecedenceRulesGraph.cpp.

136 {
137
138 if ( std::find( m_inputs.begin(), m_inputs.end(), node ) == m_inputs.end() ) m_inputs.push_back( node );
139 }
std::find
T find(T...args)
concurrency::AlgorithmNode::m_inputs
std::vector< DataNode * > m_inputs
Algorithm inputs (DataNodes)
Definition: PrecedenceRulesGraph.h:612

void concurrency::AlgorithmNode::addOutputDataNode | ( | DataNode * | node | ) |

Associate an AlgorithmNode, which is a data supplier for this one.

Definition at line 128 of file PrecedenceRulesGraph.cpp.

129 {
130
131 if ( std::find( m_outputs.begin(), m_outputs.end(), node ) == m_outputs.end() ) m_outputs.push_back( node );
132 }
concurrency::AlgorithmNode::m_outputs
std::vector< DataNode * > m_outputs
Algorithm outputs (DataNodes)
Definition: PrecedenceRulesGraph.h:610
std::find
T find(T...args)

void concurrency::AlgorithmNode::addParentNode | ( | DecisionNode * | node | ) |

Add a parent node.

Definition at line 121 of file PrecedenceRulesGraph.cpp.

122 {
123
124 if ( std::find( m_parents.begin(), m_parents.end(), node ) == m_parents.end() ) m_parents.push_back( node );
125 }
concurrency::AlgorithmNode::m_parents
std::vector< DecisionNode * > m_parents
Control flow parents of an AlgorithmNode (DecisionNodes)
Definition: PrecedenceRulesGraph.h:591
std::find
T find(T...args)

const unsigned int& concurrency::AlgorithmNode::getAlgoIndex | ( |  | ) | const
| inline

Get algorithm index.

Definition at line 573 of file PrecedenceRulesGraph.h.

573 { return m_algoIndex; }
concurrency::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: PrecedenceRulesGraph.h:597

Algorithm* concurrency::AlgorithmNode::getAlgorithm | ( |  | ) | const
| inline

get Algorithm representatives

Definition at line 571 of file PrecedenceRulesGraph.h.

571 { return m_algorithm; }
concurrency::AlgorithmNode::m_algorithm
Algorithm * m_algorithm
Algorithm representative behind the AlgorithmNode.
Definition: PrecedenceRulesGraph.h:595

const std::vector<DataNode*>& concurrency::AlgorithmNode::getInputDataNodes | ( |  | ) | const
| inline

Get all consumer nodes.

Definition at line 563 of file PrecedenceRulesGraph.h.

563 { return m_inputs; }
concurrency::AlgorithmNode::m_inputs
std::vector< DataNode * > m_inputs
Algorithm inputs (DataNodes)
Definition: PrecedenceRulesGraph.h:612

const std::vector<DataNode*>& concurrency::AlgorithmNode::getOutputDataNodes | ( |  | ) | const
| inline

Get all supplier nodes.

Definition at line 561 of file PrecedenceRulesGraph.h.

561 { return m_outputs; }
concurrency::AlgorithmNode::m_outputs
std::vector< DataNode * > m_outputs
Algorithm outputs (DataNodes)
Definition: PrecedenceRulesGraph.h:610

const std::vector<DecisionNode*>& concurrency::AlgorithmNode::getParentDecisionHubs | ( |  | ) | const
| inline

Get all parent decision hubs.

Definition at line 554 of file PrecedenceRulesGraph.h.

554 { return m_parents; }
concurrency::AlgorithmNode::m_parents
std::vector< DecisionNode * > m_parents
Control flow parents of an AlgorithmNode (DecisionNodes)
Definition: PrecedenceRulesGraph.h:591

const float& concurrency::AlgorithmNode::getRank | ( |  | ) | const
| inline

Get Algorithm rank.

Definition at line 568 of file PrecedenceRulesGraph.h.

568 { return m_rank; }
concurrency::AlgorithmNode::m_rank
float m_rank
Algorithm rank of any kind.
Definition: PrecedenceRulesGraph.h:605

bool concurrency::AlgorithmNode::isIOBound | ( |  | ) | const
| inline

Check if algorithm is I/O-bound.

Definition at line 578 of file PrecedenceRulesGraph.h.

578 { return m_isIOBound; }
concurrency::AlgorithmNode::m_isIOBound
bool m_isIOBound
If an algorithm is blocking.
Definition: PrecedenceRulesGraph.h:607

bool concurrency::AlgorithmNode::isLiar | ( |  | ) | const
| inline

Check if control flow logic is always inverted.

Definition at line 583 of file PrecedenceRulesGraph.h.

583 { return m_inverted; };
concurrency::AlgorithmNode::m_inverted
bool m_inverted
Whether the selection result is negated or not.
Definition: PrecedenceRulesGraph.h:601

bool concurrency::AlgorithmNode::isOptimist | ( |  | ) | const
| inline

Check if positive control flow decision is enforced.

Definition at line 581 of file PrecedenceRulesGraph.h.

581 { return m_allPass; };
concurrency::AlgorithmNode::m_allPass
bool m_allPass
Whether the selection result is relevant or always "pass".
Definition: PrecedenceRulesGraph.h:603

void concurrency::AlgorithmNode::printState | ( | std::stringstream & | output,
|  | AlgsExecutionStates & | states,
|  | const std::vector< int > & | node_decisions,
|  | const unsigned int & | recursionLevel
| ) |  | const
| override virtual

Print a string representing the control flow state.

Implements concurrency::ControlFlowNode.

Definition at line 99 of file PrecedenceRulesGraph.cpp.

101 {
102 output << std::string( recursionLevel, ' ' ) << m_nodeName << " (" << m_nodeIndex << ")"
103 << ", w/ decision: " << stateToString( node_decisions[m_nodeIndex] ) << "(" << node_decisions[m_nodeIndex]
104 << ")"
105 << ", in state: " << AlgsExecutionStates::stateNames[states[m_algoIndex]] << std::endl;
106 }
concurrency::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: PrecedenceRulesGraph.h:597
std::endl
T endl(T...args)
concurrency::ControlFlowNode::stateToString
std::string stateToString(const int &stateId) const
Translation between state id and name.
Definition: PrecedenceRulesGraph.cpp:16
std::string
STL class.
concurrency::ControlFlowNode::m_nodeIndex
unsigned int m_nodeIndex
Definition: PrecedenceRulesGraph.h:474
concurrency::ControlFlowNode::m_nodeName
std::string m_nodeName
Definition: PrecedenceRulesGraph.h:475
AlgsExecutionStates::stateNames
static std::map< State, std::string > stateNames
Definition: AlgsExecutionStates.h:42

void concurrency::AlgorithmNode::setIOBound | ( | bool | value | ) |
| inline

Set the I/O-boundness flag.

Definition at line 576 of file PrecedenceRulesGraph.h.

576 { m_isIOBound = value; }
concurrency::AlgorithmNode::m_isIOBound
bool m_isIOBound
If an algorithm is blocking.
Definition: PrecedenceRulesGraph.h:607

void concurrency::AlgorithmNode::setRank | ( | float & | rank | ) |
| inline

Set Algorithm rank.

Definition at line 566 of file PrecedenceRulesGraph.h.

566 { m_rank = rank; }
concurrency::AlgorithmNode::m_rank
float m_rank
Algorithm rank of any kind.
Definition: PrecedenceRulesGraph.h:605

## Member Data Documentation

unsigned int concurrency::AlgorithmNode::m_algoIndex
| private

The index of the algorithm.

Definition at line 597 of file PrecedenceRulesGraph.h.

std::string concurrency::AlgorithmNode::m_algoName
| private

The name of the algorithm.

Definition at line 599 of file PrecedenceRulesGraph.h.

Algorithm* concurrency::AlgorithmNode::m_algorithm
| private

Algorithm representative behind the AlgorithmNode.

Definition at line 595 of file PrecedenceRulesGraph.h.

bool concurrency::AlgorithmNode::m_allPass
| private

Whether the selection result is relevant or always "pass".

Definition at line 603 of file PrecedenceRulesGraph.h.

std::vector<DataNode*> concurrency::AlgorithmNode::m_inputs
| private

Algorithm inputs (DataNodes)

Definition at line 612 of file PrecedenceRulesGraph.h.

bool concurrency::AlgorithmNode::m_inverted
| private

Whether the selection result is negated or not.

Definition at line 601 of file PrecedenceRulesGraph.h.

bool concurrency::AlgorithmNode::m_isIOBound
| private

If an algorithm is blocking.

Definition at line 607 of file PrecedenceRulesGraph.h.

std::vector<DataNode*> concurrency::AlgorithmNode::m_outputs
| private

Algorithm outputs (DataNodes)

Definition at line 610 of file PrecedenceRulesGraph.h.

std::vector<DecisionNode*> concurrency::AlgorithmNode::m_parents

Control flow parents of an AlgorithmNode (DecisionNodes)

Definition at line 591 of file PrecedenceRulesGraph.h.

float concurrency::AlgorithmNode::m_rank
| private

Algorithm rank of any kind.

Definition at line 605 of file PrecedenceRulesGraph.h.

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

- GaudiHive/src/PrecedenceRulesGraph.h
- GaudiHive/src/PrecedenceRulesGraph.cpp