| The Gaudi Framework v29r1 (5cd95fa2)

- 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 413 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 417 of file PrecedenceRulesGraph.h.

419 : ControlFlowNode( graph, nodeIndex, algoPtr->name() )
420 , m_algorithm( algoPtr )
421 , m_algoIndex( algoIndex )
422 , m_algoName( algoPtr->name() )
423 , m_inverted( inverted )
424 , m_allPass( allPass )
425 , m_rank( -1 )
426 , m_isIOBound( algoPtr->isIOBound() ){};
concurrency::ControlFlowNode::ControlFlowNode
ControlFlowNode(PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name)
Constructor.
Definition: PrecedenceRulesGraph.h:337
concurrency::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: PrecedenceRulesGraph.h:479
Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:731
concurrency::AlgorithmNode::m_algoName
std::string m_algoName
The name of the algorithm.
Definition: PrecedenceRulesGraph.h:481
concurrency::AlgorithmNode::m_inverted
bool m_inverted
Whether the selection result is negated or not.
Definition: PrecedenceRulesGraph.h:483
concurrency::AlgorithmNode::m_algorithm
Algorithm * m_algorithm
Algorithm representative behind the AlgorithmNode.
Definition: PrecedenceRulesGraph.h:477
concurrency::AlgorithmNode::m_rank
float m_rank
Algorithm rank of any kind.
Definition: PrecedenceRulesGraph.h:487
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:489
concurrency::AlgorithmNode::m_allPass
bool m_allPass
Whether the selection result is relevant or always "pass".
Definition: PrecedenceRulesGraph.h:485

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:492

## 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:494

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:492
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:473
std::find
T find(T...args)

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

Get algorithm index.

Definition at line 455 of file PrecedenceRulesGraph.h.

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

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

get Algorithm representatives

Definition at line 453 of file PrecedenceRulesGraph.h.

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

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

Get all consumer nodes.

Definition at line 445 of file PrecedenceRulesGraph.h.

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

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

Get all supplier nodes.

Definition at line 443 of file PrecedenceRulesGraph.h.

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

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

Get all parent decision hubs.

Definition at line 436 of file PrecedenceRulesGraph.h.

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

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

Get Algorithm rank.

Definition at line 450 of file PrecedenceRulesGraph.h.

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

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

Check if algorithm is I/O-bound.

Definition at line 460 of file PrecedenceRulesGraph.h.

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

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

Check if control flow logic is always inverted.

Definition at line 465 of file PrecedenceRulesGraph.h.

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

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

Check if positive control flow decision is enforced.

Definition at line 463 of file PrecedenceRulesGraph.h.

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

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:479
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:360
concurrency::ControlFlowNode::m_nodeName
std::string m_nodeName
Definition: PrecedenceRulesGraph.h:361
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 458 of file PrecedenceRulesGraph.h.

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

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

Set Algorithm rank.

Definition at line 448 of file PrecedenceRulesGraph.h.

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

## Member Data Documentation

unsigned int concurrency::AlgorithmNode::m_algoIndex
| private

The index of the algorithm.

Definition at line 479 of file PrecedenceRulesGraph.h.

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

The name of the algorithm.

Definition at line 481 of file PrecedenceRulesGraph.h.

Algorithm* concurrency::AlgorithmNode::m_algorithm
| private

Algorithm representative behind the AlgorithmNode.

Definition at line 477 of file PrecedenceRulesGraph.h.

bool concurrency::AlgorithmNode::m_allPass
| private

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

Definition at line 485 of file PrecedenceRulesGraph.h.

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

Algorithm inputs (DataNodes)

Definition at line 494 of file PrecedenceRulesGraph.h.

bool concurrency::AlgorithmNode::m_inverted
| private

Whether the selection result is negated or not.

Definition at line 483 of file PrecedenceRulesGraph.h.

bool concurrency::AlgorithmNode::m_isIOBound
| private

If an algorithm is blocking.

Definition at line 489 of file PrecedenceRulesGraph.h.

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

Algorithm outputs (DataNodes)

Definition at line 492 of file PrecedenceRulesGraph.h.

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

Control flow parents of an AlgorithmNode (DecisionNodes)

Definition at line 473 of file PrecedenceRulesGraph.h.

float concurrency::AlgorithmNode::m_rank
| private

Algorithm rank of any kind.

Definition at line 487 of file PrecedenceRulesGraph.h.

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

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