![]() |
The Gaudi Framework
master (ff829712)
|
#include </builds/gaudi/Gaudi/GaudiHive/src/PRGraph/PrecedenceRulesGraph.h>
Public Member Functions | |
PrecedenceRulesGraph (const std::string &name, SmartIF< ISvcLocator > svc) | |
Constructor. | |
StatusCode | initialize () |
Initialize graph. | |
void | accept (IGraphVisitor &visitor) const |
An entry point to visit all graph nodes. | |
StatusCode | addDataNode (const DataObjID &dataPath) |
Add DataNode that represents DataObject. | |
DataNode * | getDataNode (const DataObjID &dataPath) const |
Get DataNode by DataObject path using graph index. | |
void | registerIODataObjects (const Gaudi::Algorithm *algo) |
Register algorithm in the Data Dependency index. | |
StatusCode | buildDataDependenciesRealm () |
Build data dependency realm WITH data object nodes participating. | |
void | addHeadNode (const std::string &headName, concurrency::Concurrent, concurrency::PromptDecision, concurrency::ModeOr, concurrency::AllPass, concurrency::Inverted) |
Add a node, which has no parents. | |
DecisionNode * | getHeadNode () const |
Get head node. | |
StatusCode | addAlgorithmNode (Gaudi::Algorithm *daughterAlgo, const std::string &parentName) |
Add algorithm node. | |
AlgorithmNode * | getAlgorithmNode (const std::string &algoName) const |
Get the AlgorithmNode from by algorithm name using graph index. | |
StatusCode | addDecisionHubNode (Gaudi::Algorithm *daughterAlgo, const std::string &parentName, concurrency::Concurrent, concurrency::PromptDecision, concurrency::ModeOr, concurrency::AllPass, concurrency::Inverted) |
Add a node, which aggregates decisions of direct daughter nodes. | |
unsigned int | getControlFlowNodeCounter () const |
Get total number of control flow graph nodes. | |
void | rankAlgorithms (IGraphVisitor &ranker) const |
Rank Algorithm nodes by the number of data outputs. | |
const std::string & | name () const override |
Retrieve name of the service. | |
SmartIF< ISvcLocator > & | serviceLocator () const override |
Retrieve pointer to service locator. | |
void | printState (std::stringstream &output, EventSlot &slot, const unsigned int &recursionLevel) const |
Print a string representing the control flow state. | |
void | enableAnalysis () |
BGL-based facilities. | |
PRVertexDesc | node (const std::string &) const |
std::string | dumpDataFlow () const |
Print out all data origins and destinations, as reflected in the EF graph. | |
std::string | dumpControlFlow () const |
Print out control flow of Algorithms and Sequences. | |
void | dumpPrecRules (const boost::filesystem::path &, const EventSlot &slot) |
dump to file the precedence rules | |
void | dumpPrecTrace (const boost::filesystem::path &, const EventSlot &slot) |
dump to file the precedence trace | |
void | addEdgeToPrecTrace (const AlgorithmNode *u, const AlgorithmNode *v) |
set cause-effect connection between two algorithms in the precedence trace | |
void | dumpControlFlow (std::ostringstream &, ControlFlowNode *, const int &) const |
![]() | |
MSG::Level | msgLevel () const |
get the cached level (originally extracted from the embedded MsgStream) | |
bool | msgLevel (MSG::Level lvl) const |
get the output level from the embedded MsgStream | |
![]() | |
virtual | ~CommonMessagingBase ()=default |
Virtual destructor. | |
const SmartIF< IMessageSvc > & | msgSvc () const |
The standard message service. | |
MsgStream & | msgStream () const |
Return an uninitialized MsgStream. | |
MsgStream & | msgStream (const MSG::Level level) const |
Predefined configurable message stream for the efficient printouts. | |
MsgStream & | always () const |
shortcut for the method msgStream(MSG::ALWAYS) | |
MsgStream & | fatal () const |
shortcut for the method msgStream(MSG::FATAL) | |
MsgStream & | err () const |
shortcut for the method msgStream(MSG::ERROR) | |
MsgStream & | error () const |
shortcut for the method msgStream(MSG::ERROR) | |
MsgStream & | warning () const |
shortcut for the method msgStream(MSG::WARNING) | |
MsgStream & | info () const |
shortcut for the method msgStream(MSG::INFO) | |
MsgStream & | debug () const |
shortcut for the method msgStream(MSG::DEBUG) | |
MsgStream & | verbose () const |
shortcut for the method msgStream(MSG::VERBOSE) | |
MsgStream & | msg () const |
shortcut for the method msgStream(MSG::INFO) | |
Private Attributes | |
DecisionNode * | m_headNode = nullptr |
the head node of the control flow graph | |
std::unordered_map< std::string, std::unique_ptr< AlgorithmNode > > | m_algoNameToAlgoNodeMap |
Index: map of algorithm's name to AlgorithmNode. | |
std::unordered_map< std::string, std::unique_ptr< DecisionNode > > | m_decisionNameToDecisionHubMap |
Index: map of decision's name to DecisionHub. | |
std::unordered_map< DataObjID, std::unique_ptr< DataNode >, DataObjID_Hasher > | m_dataPathToDataNodeMap |
Index: map of data path to DataNode. | |
std::unordered_map< std::string, DataObjIDColl > | m_algoNameToAlgoInputsMap |
Indexes: maps of algorithm's name to algorithm's inputs/outputs. | |
std::unordered_map< std::string, DataObjIDColl > | m_algoNameToAlgoOutputsMap |
unsigned int | m_nodeCounter = 0 |
Total number of nodes in the graph. | |
unsigned int | m_algoCounter = 0 |
Total number of algorithm nodes in the graph. | |
SmartIF< ISvcLocator > | m_svcLocator |
Service locator (needed to access the MessageSvc) | |
const std::string | m_name |
precedence::PrecTrace | m_precTrace |
facilities for algorithm precedence tracing | |
std::map< std::string, precedence::AlgoTraceVertex > | m_prec_trace_map |
bool | m_enableAnalysis { false } |
precedence::PRGraph | m_PRGraph |
BGL-based graph of precedence rules. | |
bool | m_conditionsRealmEnabled { false } |
Enable conditions realm of precedence rules. | |
Additional Inherited Members | |
![]() | |
using | base_class |
![]() | |
MSG::Level | setUpMessaging () const |
Set up local caches. | |
MSG::Level | resetMessaging () |
Reinitialize internal states. | |
void | updateMsgStreamOutputLevel (int level) |
Update the output level of the cached MsgStream. | |
Definition at line 621 of file PrecedenceRulesGraph.h.
|
inline |
Constructor.
Definition at line 624 of file PrecedenceRulesGraph.h.
void concurrency::PrecedenceRulesGraph::accept | ( | IGraphVisitor & | visitor | ) | const |
An entry point to visit all graph nodes.
Definition at line 538 of file PrecedenceRulesGraph.cpp.
StatusCode concurrency::PrecedenceRulesGraph::addAlgorithmNode | ( | Gaudi::Algorithm * | daughterAlgo, |
const std::string & | parentName ) |
Add algorithm node.
Create new, or fetch existent, AlgorithmNode
Attach AlgorithmNode to its parent DecisionNode
Definition at line 372 of file PrecedenceRulesGraph.cpp.
StatusCode concurrency::PrecedenceRulesGraph::addDataNode | ( | const DataObjID & | dataPath | ) |
Add DataNode that represents DataObject.
Definition at line 421 of file PrecedenceRulesGraph.cpp.
StatusCode concurrency::PrecedenceRulesGraph::addDecisionHubNode | ( | Gaudi::Algorithm * | daughterAlgo, |
const std::string & | parentName, | ||
concurrency::Concurrent | modeConcurrent, | ||
concurrency::PromptDecision | modePromptDecision, | ||
concurrency::ModeOr | modeOR, | ||
concurrency::AllPass | allPass, | ||
concurrency::Inverted | isInverted ) |
Add a node, which aggregates decisions of direct daughter nodes.
Create new, or fetch existent, DecisionNode
Attach DecisionNode to its parent DecisionNode
Definition at line 451 of file PrecedenceRulesGraph.cpp.
void concurrency::PrecedenceRulesGraph::addEdgeToPrecTrace | ( | const AlgorithmNode * | u, |
const AlgorithmNode * | v ) |
set cause-effect connection between two algorithms in the precedence trace
Definition at line 719 of file PrecedenceRulesGraph.cpp.
void concurrency::PrecedenceRulesGraph::addHeadNode | ( | const std::string & | headName, |
concurrency::Concurrent | modeConcurrent, | ||
concurrency::PromptDecision | modePromptDecision, | ||
concurrency::ModeOr | modeOR, | ||
concurrency::AllPass | allPass, | ||
concurrency::Inverted | isInverted ) |
Add a node, which has no parents.
Definition at line 504 of file PrecedenceRulesGraph.cpp.
StatusCode concurrency::PrecedenceRulesGraph::buildDataDependenciesRealm | ( | ) |
Build data dependency realm WITH data object nodes participating.
Definition at line 318 of file PrecedenceRulesGraph.cpp.
std::string concurrency::PrecedenceRulesGraph::dumpControlFlow | ( | ) | const |
Print out control flow of Algorithms and Sequences.
Definition at line 560 of file PrecedenceRulesGraph.cpp.
void concurrency::PrecedenceRulesGraph::dumpControlFlow | ( | std::ostringstream & | ost, |
ControlFlowNode * | node, | ||
const int & | indent ) const |
Definition at line 566 of file PrecedenceRulesGraph.cpp.
std::string concurrency::PrecedenceRulesGraph::dumpDataFlow | ( | ) | const |
Print out all data origins and destinations, as reflected in the EF graph.
Definition at line 591 of file PrecedenceRulesGraph.cpp.
void concurrency::PrecedenceRulesGraph::dumpPrecRules | ( | const boost::filesystem::path & | fileName, |
const EventSlot & | slot ) |
dump to file the precedence rules
Definition at line 625 of file PrecedenceRulesGraph.cpp.
void concurrency::PrecedenceRulesGraph::dumpPrecTrace | ( | const boost::filesystem::path & | fileName, |
const EventSlot & | slot ) |
dump to file the precedence trace
Definition at line 666 of file PrecedenceRulesGraph.cpp.
|
inline |
|
inline |
Get the AlgorithmNode from by algorithm name using graph index.
Definition at line 652 of file PrecedenceRulesGraph.h.
|
inline |
Get total number of control flow graph nodes.
Definition at line 660 of file PrecedenceRulesGraph.h.
|
inline |
Get DataNode by DataObject path using graph index.
Definition at line 638 of file PrecedenceRulesGraph.h.
|
inline |
StatusCode concurrency::PrecedenceRulesGraph::initialize | ( | ) |
Initialize graph.
Definition at line 220 of file PrecedenceRulesGraph.cpp.
|
inlineoverride |
PRVertexDesc concurrency::PrecedenceRulesGraph::node | ( | const std::string & | name | ) | const |
Definition at line 529 of file PrecedenceRulesGraph.cpp.
void concurrency::PrecedenceRulesGraph::printState | ( | std::stringstream & | output, |
EventSlot & | slot, | ||
const unsigned int & | recursionLevel ) const |
Print a string representing the control flow state.
Definition at line 260 of file PrecedenceRulesGraph.cpp.
void concurrency::PrecedenceRulesGraph::rankAlgorithms | ( | IGraphVisitor & | ranker | ) | const |
Rank Algorithm nodes by the number of data outputs.
Definition at line 550 of file PrecedenceRulesGraph.cpp.
void concurrency::PrecedenceRulesGraph::registerIODataObjects | ( | const Gaudi::Algorithm * | algo | ) |
Register algorithm in the Data Dependency index.
Definition at line 299 of file PrecedenceRulesGraph.cpp.
|
inlineoverride |
|
private |
Total number of algorithm nodes in the graph.
Definition at line 706 of file PrecedenceRulesGraph.h.
|
private |
Indexes: maps of algorithm's name to algorithm's inputs/outputs.
Definition at line 700 of file PrecedenceRulesGraph.h.
|
private |
Index: map of algorithm's name to AlgorithmNode.
Definition at line 694 of file PrecedenceRulesGraph.h.
|
private |
Definition at line 701 of file PrecedenceRulesGraph.h.
|
private |
Enable conditions realm of precedence rules.
Definition at line 720 of file PrecedenceRulesGraph.h.
|
private |
Index: map of data path to DataNode.
Definition at line 698 of file PrecedenceRulesGraph.h.
|
private |
Index: map of decision's name to DecisionHub.
Definition at line 696 of file PrecedenceRulesGraph.h.
|
private |
Definition at line 715 of file PrecedenceRulesGraph.h.
|
private |
the head node of the control flow graph
Definition at line 692 of file PrecedenceRulesGraph.h.
|
private |
Definition at line 710 of file PrecedenceRulesGraph.h.
|
private |
Total number of nodes in the graph.
Definition at line 704 of file PrecedenceRulesGraph.h.
|
private |
Definition at line 714 of file PrecedenceRulesGraph.h.
|
private |
facilities for algorithm precedence tracing
Definition at line 713 of file PrecedenceRulesGraph.h.
|
private |
BGL-based graph of precedence rules.
Definition at line 717 of file PrecedenceRulesGraph.h.
|
mutableprivate |
Service locator (needed to access the MessageSvc)
Definition at line 709 of file PrecedenceRulesGraph.h.