| The Gaudi Framework v28r2p1 (f1a77ff4)

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

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

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

`#include <src/PrecedenceRulesGraph.h>`

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

## Public Member Functions
| PrecedenceRulesGraph (const std::string &name, SmartIF< ISvcLocator > svc)
| Constructor. More...
| ~PrecedenceRulesGraph () override
| Destructor. More...
StatusCode | initialize (const std::unordered_map< std::string, unsigned int > &algname_index_map)
| Initialize graph. More...
StatusCode | initialize (const std::unordered_map< std::string, unsigned int > &algname_index_map, std::vector< EventSlot > &eventSlots)
void | registerIODataObjects (const Algorithm *algo)
| Register algorithm in the Data Dependency index. More...
StatusCode | buildDataDependenciesRealm ()
| Build data dependency realm WITHOUT data object nodes: just interconnect algorithm nodes directly. More...
StatusCode | buildAugmentedDataDependenciesRealm ()
| Build data dependency realm WITH data object nodes participating. More...
void | addHeadNode (const std::string &headName, bool modeConcurrent, bool modePromptDecision, bool modeOR, bool allPass)
| Add a node, which has no parents. More...
StatusCode | addAlgorithmNode (Algorithm *daughterAlgo, const std::string &parentName, bool inverted, bool allPass)
| Add algorithm node. More...
template<class T >
void | attachAlgorithmsToNodes (const std::string &algo_name, const T &container)
| Attach pointers to real Algorithms (and their clones) to Algorithm nodes of the graph. More...
AlgorithmNode * | getAlgorithmNode (const std::string &algoName) const
| Get the AlgorithmNode from by algorithm name using graph index. More...
StatusCode | addDataNode (const DataObjID &dataPath)
| Add DataNode that represents DataObject. More...
DataNode * | getDataNode (const DataObjID &dataPath) const
| Get DataNode by DataObject path using graph index. More...
StatusCode | addDecisionHubNode (Algorithm *daughterAlgo, const std::string &parentName, bool modeConcurrent, bool modePromptDecision, bool modeOR, bool allPass)
| Add a node, which aggregates decisions of direct daughter nodes. More...
unsigned int | getControlFlowNodeCounter () const
| Get total number of graph nodes. More...
void | updateEventState (AlgsExecutionStates &states, std::vector< int > &node_decisions) const
| XXX CF tests. Is needed for older CF implementation. More...
void | updateDecision (const std::string &algo_name, const int &slotNum, AlgsExecutionStates &states, std::vector< int > &node_decisions) const
| A method to update algorithm node decision, and propagate it upwards. More...
void | rankAlgorithms (IGraphVisitor &ranker) const
| Rank Algorithm nodes by the number of data outputs. More...
void | printState (std::stringstream &output, AlgsExecutionStates &states, const std::vector< int > &node_decisions, const unsigned int &recursionLevel) const
| Print a string representing the control flow state. More...
const std::vector< AlgorithmNode * > | getDataIndependentNodes () const
const std::string & | name () const override
| Retrieve name of the service. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
const std::chrono::system_clock::time_point | getInitTime () const
AlgsExecutionStates & | getAlgoStates (const int &slotNum) const
std::vector< int > & | getNodeDecisions (const int &slotNum) const
std::string | dumpDataFlow () const
| Print out all data origins and destinations, as reflected in the EF graph. More...
void | dumpExecutionPlan ()
| dump to file encountered execution plan More...
void | addEdgeToExecutionPlan (const AlgorithmNode *u, const AlgorithmNode *v)
| set cause-effect connection between two algorithms in the execution plan More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...

## Private Attributes
friend | ExecutionFlowManager
DecisionNode * | m_headNode
| the head node of the control flow graph; may want to have multiple ones once supporting trigger paths More...
AlgoNodesMap | m_algoNameToAlgoNodeMap
| Index: map of algorithm's name to AlgorithmNode. More...
DecisionHubsMap | m_decisionNameToDecisionHubMap
| Index: map of decision's name to DecisionHub. More...
DataNodesMap | m_dataPathToDataNodeMap
| Index: map of data path to DataNode. More...
AlgoInputsMap | m_algoNameToAlgoInputsMap
| Indexes: maps of algorithm's name to algorithm's inputs/outputs. More...
AlgoOutputsMap | m_algoNameToAlgoOutputsMap
unsigned int | m_nodeCounter
| Total number of nodes in the graph. More...
SmartIF< ISvcLocator > | m_svcLocator
| Service locator (needed to access the MessageSvc) More...
const std::string | m_name
const std::chrono::system_clock::time_point | m_initTime
std::vector< EventSlot > * | m_eventSlots
boost::ExecPlan | m_ExecPlan
| temporary items to experiment with execution planning More...
std::map< std::string, boost::AlgoVertex > | m_exec_plan_map

## Additional Inherited Members
Public Types inherited from CommonMessaging< IPrecedenceRulesGraph >
using | base_class = CommonMessaging
Protected Member Functions inherited from CommonMessaging< IPrecedenceRulesGraph >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Detailed Description

Definition at line 280 of file PrecedenceRulesGraph.h.

## Constructor & Destructor Documentation

concurrency::PrecedenceRulesGraph::PrecedenceRulesGraph | ( | const std::string & | name,
|  | SmartIF< ISvcLocator > | svc
| ) |  |
| inline

Constructor.

Definition at line 284 of file PrecedenceRulesGraph.h.

284 :
285 m_headNode(0), m_nodeCounter(0), m_svcLocator(svc), m_name(name), m_initTime(std::chrono::system_clock::now()),
286 m_eventSlots(nullptr) {}
concurrency::PrecedenceRulesGraph::m_initTime
const std::chrono::system_clock::time_point m_initTime
Definition: PrecedenceRulesGraph.h:373
concurrency::PrecedenceRulesGraph::m_eventSlots
std::vector< EventSlot > * m_eventSlots
Definition: PrecedenceRulesGraph.h:375
concurrency::PrecedenceRulesGraph::m_headNode
DecisionNode * m_headNode
the head node of the control flow graph; may want to have multiple ones once supporting trigger paths...
Definition: PrecedenceRulesGraph.h:358
concurrency::PrecedenceRulesGraph::m_name
const std::string m_name
Definition: PrecedenceRulesGraph.h:372
std::chrono::system_clock::now
T now(T...args)
concurrency::PrecedenceRulesGraph::m_nodeCounter
unsigned int m_nodeCounter
Total number of nodes in the graph.
Definition: PrecedenceRulesGraph.h:369
concurrency::PrecedenceRulesGraph::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
Definition: PrecedenceRulesGraph.h:371

concurrency::PrecedenceRulesGraph::~PrecedenceRulesGraph | ( |  | ) |
| inline override

Destructor.

Definition at line 288 of file PrecedenceRulesGraph.h.

288 {
289 if (m_headNode != 0) delete m_headNode;
290 }
concurrency::PrecedenceRulesGraph::m_headNode
DecisionNode * m_headNode
the head node of the control flow graph; may want to have multiple ones once supporting trigger paths...
Definition: PrecedenceRulesGraph.h:358

## Member Function Documentation

StatusCode concurrency::PrecedenceRulesGraph::addAlgorithmNode | ( | Algorithm * | daughterAlgo,
|  | const std::string & | parentName,
|  | bool | inverted,
|  | bool | allPass
| ) |  |

Add algorithm node.

Definition at line 608 of file PrecedenceRulesGraph.cpp.

610 {
611
612 StatusCode sc = StatusCode::SUCCESS;
613
614 auto& algoName = algo->name();
615
616 auto itP = m_decisionNameToDecisionHubMap.find( parentName );
617 concurrency::DecisionNode* parentNode;
618 if ( itP != m_decisionNameToDecisionHubMap.end() ) {
619 parentNode = itP->second;
620 auto itA = m_algoNameToAlgoNodeMap.find( algoName );
621 concurrency::AlgorithmNode* algoNode;
622 if ( itA != m_algoNameToAlgoNodeMap.end() ) {
623 algoNode = itA->second;
624 } else {
625 algoNode = new concurrency::AlgorithmNode( *this, m_nodeCounter, algoName, inverted, allPass, algo->isIOBound() );
626 ++m_nodeCounter;
627 m_algoNameToAlgoNodeMap[algoName] = algoNode;
628 if (msgLevel(MSG::DEBUG))
629 debug() << "AlgoNode " << algoName << " added @ " << algoNode << endmsg;
630 registerIODataObjects(algo);
631 }
632
633 parentNode->addDaughterNode( algoNode );
634 algoNode->addParentNode( parentNode );
635 } else {
636 sc = StatusCode::FAILURE;
637 error() << "Decision hub node " << parentName << ", requested to be parent, is not registered."
638 << endmsg;
639 }
640
641 return sc;
642 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
concurrency::DecisionNode
Definition: PrecedenceRulesGraph.h:86
StatusCode::FAILURE
Definition: StatusCode.h:29
concurrency::DecisionNode::addDaughterNode
void addDaughterNode(ControlFlowNode *node)
Add a daughter node.
Definition: PrecedenceRulesGraph.cpp:43
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoNodeMap
AlgoNodesMap m_algoNameToAlgoNodeMap
Index: map of algorithm&#39;s name to AlgorithmNode.
Definition: PrecedenceRulesGraph.h:360
MSG::DEBUG
Definition: IMessageSvc.h:18
std::unordered_map::end
T end(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::unordered_map::find
T find(T...args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
concurrency::PrecedenceRulesGraph::registerIODataObjects
void registerIODataObjects(const Algorithm *algo)
Register algorithm in the Data Dependency index.
Definition: PrecedenceRulesGraph.cpp:470
concurrency::PrecedenceRulesGraph::m_nodeCounter
unsigned int m_nodeCounter
Total number of nodes in the graph.
Definition: PrecedenceRulesGraph.h:369
concurrency::AlgorithmNode
Definition: PrecedenceRulesGraph.h:140
concurrency::AlgorithmNode::addParentNode
void addParentNode(DecisionNode *node)
XXX: CF tests. Method to add a parent node.
Definition: PrecedenceRulesGraph.cpp:418
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
concurrency::PrecedenceRulesGraph::m_decisionNameToDecisionHubMap
DecisionHubsMap m_decisionNameToDecisionHubMap
Index: map of decision&#39;s name to DecisionHub.
Definition: PrecedenceRulesGraph.h:362

StatusCode concurrency::PrecedenceRulesGraph::addDataNode | ( | const DataObjID & | dataPath | ) |

Add DataNode that represents DataObject.

Definition at line 652 of file PrecedenceRulesGraph.cpp.

653 {
654
655 StatusCode sc;
656
657 auto itD = m_dataPathToDataNodeMap.find( dataPath );
658 concurrency::DataNode* dataNode;
659 if ( itD != m_dataPathToDataNodeMap.end() ) {
660 dataNode = itD->second;
661 sc = StatusCode::SUCCESS;
662 } else {
663 dataNode = new concurrency::DataNode( *this, dataPath );
664 m_dataPathToDataNodeMap[dataPath] = dataNode;
665 if (msgLevel(MSG::DEBUG))
666 debug() << " DataNode for " << dataPath << " added @ " << dataNode << endmsg;
667 sc = StatusCode::SUCCESS;
668 }
669
670 return sc;
671 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
concurrency::DataNode
Definition: PrecedenceRulesGraph.h:241
MSG::DEBUG
Definition: IMessageSvc.h:18
std::unordered_map::end
T end(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::unordered_map::find
T find(T...args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
concurrency::PrecedenceRulesGraph::m_dataPathToDataNodeMap
DataNodesMap m_dataPathToDataNodeMap
Index: map of data path to DataNode.
Definition: PrecedenceRulesGraph.h:364

StatusCode concurrency::PrecedenceRulesGraph::addDecisionHubNode | ( | Algorithm * | daughterAlgo,
|  | const std::string & | parentName,
|  | bool | modeConcurrent,
|  | bool | modePromptDecision,
|  | bool | modeOR,
|  | bool | allPass
| ) |  |

Add a node, which aggregates decisions of direct daughter nodes.

Definition at line 681 of file PrecedenceRulesGraph.cpp.

683 {
684
685 StatusCode sc = StatusCode::SUCCESS;
686
687 auto& decisionHubName = decisionHubAlgo->name();
688
689 auto itP = m_decisionNameToDecisionHubMap.find( parentName );
690 concurrency::DecisionNode* parentNode;
691 if ( itP != m_decisionNameToDecisionHubMap.end() ) {
692 parentNode = itP->second;
693 auto itA = m_decisionNameToDecisionHubMap.find( decisionHubName );
694 concurrency::DecisionNode* decisionHubNode;
695 if ( itA != m_decisionNameToDecisionHubMap.end() ) {
696 decisionHubNode = itA->second;
697 } else {
698 decisionHubNode =
699 new concurrency::DecisionNode( *this, m_nodeCounter, decisionHubName, modeConcurrent, modePromptDecision, modeOR, allPass);
700 ++m_nodeCounter;
701 m_decisionNameToDecisionHubMap[decisionHubName] = decisionHubNode;
702 if (msgLevel(MSG::DEBUG))
703 debug() << "Decision hub node " << decisionHubName << " added @ " << decisionHubNode << endmsg;
704 }
705
706 parentNode->addDaughterNode( decisionHubNode );
707 decisionHubNode->addParentNode( parentNode );
708 } else {
709 sc = StatusCode::FAILURE;
710 error() << "Decision hub node " << parentName << ", requested to be parent, is not registered."
711 << endmsg;
712 }
713
714 return sc;
715 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
concurrency::DecisionNode
Definition: PrecedenceRulesGraph.h:86
StatusCode::FAILURE
Definition: StatusCode.h:29
concurrency::DecisionNode::addDaughterNode
void addDaughterNode(ControlFlowNode *node)
Add a daughter node.
Definition: PrecedenceRulesGraph.cpp:43
MSG::DEBUG
Definition: IMessageSvc.h:18
std::unordered_map::end
T end(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::unordered_map::find
T find(T...args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
concurrency::DecisionNode::addParentNode
void addParentNode(DecisionNode *node)
XXX: CF tests. Method to add a parent node.
Definition: PrecedenceRulesGraph.cpp:36
concurrency::PrecedenceRulesGraph::m_nodeCounter
unsigned int m_nodeCounter
Total number of nodes in the graph.
Definition: PrecedenceRulesGraph.h:369
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
concurrency::PrecedenceRulesGraph::m_decisionNameToDecisionHubMap
DecisionHubsMap m_decisionNameToDecisionHubMap
Index: map of decision&#39;s name to DecisionHub.
Definition: PrecedenceRulesGraph.h:362

void concurrency::PrecedenceRulesGraph::addEdgeToExecutionPlan | ( | const AlgorithmNode * | u,
|  | const AlgorithmNode * | v
| ) |  |

set cause-effect connection between two algorithms in the execution plan

Definition at line 820 of file PrecedenceRulesGraph.cpp.

821 {
822
823 boost::AlgoVertex source;
824 float runtime( 0. );
825 if ( u == nullptr ) {
826 auto itT = m_exec_plan_map.find( "ENTRY" );
827 if ( itT != m_exec_plan_map.end() ) {
828 source = itT->second;
829 } else {
830 source = boost::add_vertex( boost::AlgoNodeStruct( "ENTRY", -999, -999, 0 ), m_ExecPlan );
831 m_exec_plan_map["ENTRY"] = source;
832 }
833 } else {
834 auto itS = m_exec_plan_map.find( u->getNodeName() );
835 if ( itS != m_exec_plan_map.end() ) {
836 source = itS->second;
837 } else {
838 auto alg = dynamic_cast<Algorithm*>( u->getAlgorithmRepresentatives()[0] );
839 if ( alg == 0 ) {
840 fatal() << "could not convert IAlgorithm to Algorithm!" << endmsg;
841 } else {
842 try {
843 const Gaudi::Details::PropertyBase& p = alg->getProperty( "AvgRuntime" );
844 runtime = std::stof( p.toString() );
845 } catch(...) {
846 if (msgLevel(MSG::DEBUG))
847 debug() << "no AvgRuntime for " << alg->name() << endmsg;
848 runtime = 1.;
849 }
850 }
851 source = boost::add_vertex( boost::AlgoNodeStruct( u->getNodeName(), u->getAlgoIndex(), u->getRank(), runtime ),
852 m_ExecPlan );
853 m_exec_plan_map[u->getNodeName()] = source;
854 }
855 }
856
857 boost::AlgoVertex target;
858 auto itP = m_exec_plan_map.find( v->getNodeName() );
859 if ( itP != m_exec_plan_map.end() ) {
860 target = itP->second;
861 } else {
862 auto alg = dynamic_cast<Algorithm*>( v->getAlgorithmRepresentatives()[0] );
863 if ( alg == 0 ) {
864 fatal() << "could not convert IAlgorithm to Algorithm!" << endmsg;
865 } else {
866 try {
867 const Gaudi::Details::PropertyBase& p = alg->getProperty( "AvgRuntime" );
868 runtime = std::stof( p.toString() );
869 } catch(...) {
870 if (msgLevel(MSG::DEBUG))
871 debug() << "no AvgRuntime for " << alg->name() << endmsg;
872 runtime = 1.;
873 }
874 }
875 target = boost::add_vertex( boost::AlgoNodeStruct( v->getNodeName(), v->getAlgoIndex(), v->getRank(), runtime ),
876 m_ExecPlan );
877 m_exec_plan_map[v->getNodeName()] = target;
878 }
879
880 if (msgLevel(MSG::DEBUG))
881 debug() << "Edge added to execution plan" << endmsg;
882 boost::add_edge(source, target, m_ExecPlan);
883 }
std::stof
T stof(T...args)
MSG::DEBUG
Definition: IMessageSvc.h:18
std::map::end
T end(T...args)
Gaudi::Details::PropertyBase::toString
virtual std::string toString() const =0
value -> string
boost::AlgoNodeStruct
Definition: PrecedenceRulesGraph.h:26
boost::AlgoVertex
graph_traits< ExecPlan >::vertex_descriptor AlgoVertex
Definition: PrecedenceRulesGraph.h:38
concurrency::PrecedenceRulesGraph::m_exec_plan_map
std::map< std::string, boost::AlgoVertex > m_exec_plan_map
Definition: PrecedenceRulesGraph.h:378
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:78
std::map::find
T find(T...args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
concurrency::PrecedenceRulesGraph::m_ExecPlan
boost::ExecPlan m_ExecPlan
temporary items to experiment with execution planning
Definition: PrecedenceRulesGraph.h:377
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void concurrency::PrecedenceRulesGraph::addHeadNode | ( | const std::string & | headName,
|  | bool | modeConcurrent,
|  | bool | modePromptDecision,
|  | bool | modeOR,
|  | bool | allPass
| ) |  |

Add a node, which has no parents.

Definition at line 718 of file PrecedenceRulesGraph.cpp.

719 {
720
721 auto itH = m_decisionNameToDecisionHubMap.find( headName );
722 if ( itH != m_decisionNameToDecisionHubMap.end() ) {
723 m_headNode = itH->second;
724 } else {
725 m_headNode = new concurrency::DecisionNode( *this, m_nodeCounter, headName, modeConcurrent, modePromptDecision, modeOR, allPass );
726 ++m_nodeCounter;
727 m_decisionNameToDecisionHubMap[headName] = m_headNode;
728 }
729 }
concurrency::DecisionNode
Definition: PrecedenceRulesGraph.h:86
std::unordered_map::end
T end(T...args)
concurrency::PrecedenceRulesGraph::m_headNode
DecisionNode * m_headNode
the head node of the control flow graph; may want to have multiple ones once supporting trigger paths...
Definition: PrecedenceRulesGraph.h:358
std::unordered_map::find
T find(T...args)
concurrency::PrecedenceRulesGraph::m_nodeCounter
unsigned int m_nodeCounter
Total number of nodes in the graph.
Definition: PrecedenceRulesGraph.h:369
concurrency::PrecedenceRulesGraph::m_decisionNameToDecisionHubMap
DecisionHubsMap m_decisionNameToDecisionHubMap
Index: map of decision&#39;s name to DecisionHub.
Definition: PrecedenceRulesGraph.h:362
template<class T >

void concurrency::PrecedenceRulesGraph::attachAlgorithmsToNodes | ( | const std::string & | algo_name,
|  | const T & | container
| ) |  |
| inline

Attach pointers to real Algorithms (and their clones) to Algorithm nodes of the graph.

Definition at line 307 of file PrecedenceRulesGraph.h.

307 {
308 auto node = getAlgorithmNode(algo_name);
309 for (auto ialgoIt = container.unsafe_begin(); ialgoIt != container.unsafe_end(); ++ialgoIt)
310 node->attachAlgorithm(*ialgoIt);
311 }
concurrency::PrecedenceRulesGraph::getAlgorithmNode
AlgorithmNode * getAlgorithmNode(const std::string &algoName) const
Get the AlgorithmNode from by algorithm name using graph index.
Definition: PrecedenceRulesGraph.cpp:645

StatusCode concurrency::PrecedenceRulesGraph::buildAugmentedDataDependenciesRealm | ( |  | ) |

Build data dependency realm WITH data object nodes participating.

Definition at line 549 of file PrecedenceRulesGraph.cpp.

550 {
551
552 StatusCode global_sc( StatusCode::SUCCESS, true );
553
554 // Create the DataObjects (DO) realm (represented by DataNodes in the graph),
555 // connected to DO producers (AlgorithmNodes)
556 for (auto algo : m_algoNameToAlgoNodeMap) {
557
558 auto& outCollection = m_algoNameToAlgoOutputsMap[algo.first];
559 for (auto outputTag : outCollection) {
560 const auto sc = addDataNode(outputTag);
561 if (!sc.isSuccess()) {
562 error() << "Extra producer (" << algo.first << ") for DataObject @ "
563 << outputTag
564 << " has been detected: this is not allowed." << endmsg;
565 global_sc = sc;
566 }
567 auto dataNode = getDataNode(outputTag);
568 dataNode->addProducerNode(algo.second);
569 algo.second->addOutputDataNode(dataNode);
570 }
571 }
572
573 // Connect previously created DO realm to DO consumers (AlgorithmNodes)
574 for ( auto algo : m_algoNameToAlgoNodeMap ) {
575 auto& inCollection = m_algoNameToAlgoInputsMap[algo.first];
576 for (auto inputTag : inCollection) {
577 DataNode* dataNode = nullptr;
578 auto primaryPath = inputTag;
579 auto itP = m_dataPathToDataNodeMap.find(primaryPath);
580 if (itP != m_dataPathToDataNodeMap.end()) {
581 dataNode = getDataNode(primaryPath);
582 //if (!inCollection[inputTag].alternativeDataProductNames().empty())
583 // warning() << "Dropping all alternative data dependencies in the graph, but '" << primaryPath
584 // << "', for algorithm " << algo.first << endmsg;
585 //} else {
586 // for (auto alterPath : inCollection[inputTag].alternativeDataProductNames()) {
587 // auto itAP = m_dataPathToDataNodeMap.find(alterPath);
588 // if (itAP != m_dataPathToDataNodeMap.end()) {
589 // dataNode = getDataNode(alterPath);
590 // warning() << "Dropping all alternative data dependencies in the graph, but '" << alterPath
591 // << "', for algorithm " << algo.first << endmsg;
592 // break;
593 // }
594 //}
595 }
596
597 if (dataNode) {
598 dataNode->addConsumerNode(algo.second);
599 algo.second->addInputDataNode(dataNode);
600 }
601 }
602 }
603
604 return global_sc;
605 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoNodeMap
AlgoNodesMap m_algoNameToAlgoNodeMap
Index: map of algorithm&#39;s name to AlgorithmNode.
Definition: PrecedenceRulesGraph.h:360
std::unordered_map::end
T end(T...args)
concurrency::PrecedenceRulesGraph::addDataNode
StatusCode addDataNode(const DataObjID &dataPath)
Add DataNode that represents DataObject.
Definition: PrecedenceRulesGraph.cpp:652
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoOutputsMap
AlgoOutputsMap m_algoNameToAlgoOutputsMap
Definition: PrecedenceRulesGraph.h:367
concurrency::PrecedenceRulesGraph::getDataNode
DataNode * getDataNode(const DataObjID &dataPath) const
Get DataNode by DataObject path using graph index.
Definition: PrecedenceRulesGraph.cpp:674
std::unordered_map::find
T find(T...args)
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoInputsMap
AlgoInputsMap m_algoNameToAlgoInputsMap
Indexes: maps of algorithm&#39;s name to algorithm&#39;s inputs/outputs.
Definition: PrecedenceRulesGraph.h:366
concurrency::PrecedenceRulesGraph::m_dataPathToDataNodeMap
DataNodesMap m_dataPathToDataNodeMap
Index: map of data path to DataNode.
Definition: PrecedenceRulesGraph.h:364

StatusCode concurrency::PrecedenceRulesGraph::buildDataDependenciesRealm | ( |  | ) |

Build data dependency realm WITHOUT data object nodes: just interconnect algorithm nodes directly.

Definition at line 496 of file PrecedenceRulesGraph.cpp.

497 {
498
499 StatusCode global_sc( StatusCode::SUCCESS );
500
501 for ( auto algo : m_algoNameToAlgoNodeMap ) {
502
503 auto targetNode = m_algoNameToAlgoNodeMap[algo.first];
504
505 // Find producers for all the inputs of the target node
506 auto& targetInCollection = m_algoNameToAlgoInputsMap[algo.first];
507 for (auto inputTag : targetInCollection) {
508 for (auto producer : m_algoNameToAlgoOutputsMap) {
509 auto& outputs = m_algoNameToAlgoOutputsMap[producer.first];
510 for (auto outputTag : outputs) {
511 if (inputTag == outputTag) {
512 auto& known_producers = targetNode->getSupplierNodes();
513 auto valid_producer = m_algoNameToAlgoNodeMap[producer.first];
514 auto& known_consumers = valid_producer->getConsumerNodes();
515 if ( std::find( known_producers.begin(), known_producers.end(), valid_producer ) ==
516 known_producers.end() )
517 targetNode->addSupplierNode( valid_producer );
518 if ( std::find( known_consumers.begin(), known_consumers.end(), targetNode ) == known_consumers.end() )
519 valid_producer->addConsumerNode( targetNode );
520 }
521 }
522 }
523 }
524
525 // Find consumers for all the outputs of the target node
526 auto& targetOutCollection = m_algoNameToAlgoOutputsMap[algo.first];
527 for (auto outputTag : targetOutCollection) {
528 for (auto consumer : m_algoNameToAlgoInputsMap) {
529 auto& inputs = m_algoNameToAlgoInputsMap[consumer.first];
530 for (auto inputTag : inputs) {
531 if (inputTag == outputTag) {
532 auto& known_consumers = targetNode->getConsumerNodes();
533 auto valid_consumer = m_algoNameToAlgoNodeMap[consumer.first];
534 auto& known_producers = valid_consumer->getSupplierNodes();
535 if ( std::find( known_producers.begin(), known_producers.end(), targetNode ) == known_producers.end() )
536 valid_consumer->addSupplierNode( targetNode );
537 if ( std::find( known_consumers.begin(), known_consumers.end(), valid_consumer ) ==
538 known_consumers.end() )
539 targetNode->addConsumerNode( valid_consumer );
540 }
541 }
542 }
543 }
544 }
545 return global_sc;
546 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoNodeMap
AlgoNodesMap m_algoNameToAlgoNodeMap
Index: map of algorithm&#39;s name to AlgorithmNode.
Definition: PrecedenceRulesGraph.h:360
BrunelScenarioForwardScheduler.inputs
inputs
Definition: BrunelScenarioForwardScheduler.py:123
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoOutputsMap
AlgoOutputsMap m_algoNameToAlgoOutputsMap
Definition: PrecedenceRulesGraph.h:367
std::find
T find(T...args)
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoInputsMap
AlgoInputsMap m_algoNameToAlgoInputsMap
Indexes: maps of algorithm&#39;s name to algorithm&#39;s inputs/outputs.
Definition: PrecedenceRulesGraph.h:366

std::string concurrency::PrecedenceRulesGraph::dumpDataFlow | ( |  | ) | const

Print out all data origins and destinations, as reflected in the EF graph.

Definition at line 776 of file PrecedenceRulesGraph.cpp.

777 {
778
779 const char idt[] = " ";
780 std::ostringstream ost;
781
782 ost << "\n" << idt << "====================================\n";
783 ost << idt << "Data origins and destinations:\n";
784 ost << idt << "====================================\n";
785
786 for ( auto& pair : m_dataPathToDataNodeMap ) {
787
788 for ( auto algoNode : pair.second->getProducers() ) ost << idt << " " << algoNode->getNodeName() << "\n";
789
790 ost << idt << " V\n";
791 ost << idt << " o " << pair.first << "\n";
792 ost << idt << " V\n";
793
794 for ( auto algoNode : pair.second->getConsumers() ) ost << idt << " " << algoNode->getNodeName() << "\n";
795
796 ost << idt << "====================================\n";
797 }
798
799 return ost.str();
800 }
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
concurrency::PrecedenceRulesGraph::m_dataPathToDataNodeMap
DataNodesMap m_dataPathToDataNodeMap
Index: map of data path to DataNode.
Definition: PrecedenceRulesGraph.h:364

void concurrency::PrecedenceRulesGraph::dumpExecutionPlan | ( |  | ) |

dump to file encountered execution plan

Definition at line 804 of file PrecedenceRulesGraph.cpp.

805 {
806 std::ofstream myfile;
807 myfile.open( "ExecutionPlan.graphml", std::ios::app );
808
809 boost::dynamic_properties dp;
810 dp.property( "name", boost::get( &boost::AlgoNodeStruct::m_name, m_ExecPlan ) );
811 dp.property( "index", boost::get( &boost::AlgoNodeStruct::m_index, m_ExecPlan ) );
812 dp.property( "rank", boost::get( &boost::AlgoNodeStruct::m_rank, m_ExecPlan ) );
813 dp.property( "runtime", boost::get( &boost::AlgoNodeStruct::m_runtime, m_ExecPlan ) );
814
815 boost::write_graphml( myfile, m_ExecPlan, dp );
816
817 myfile.close();
818 }
boost::AlgoNodeStruct::m_index
int m_index
Definition: PrecedenceRulesGraph.h:31
std::ofstream::open
T open(T...args)
boost::AlgoNodeStruct::m_rank
int m_rank
Definition: PrecedenceRulesGraph.h:32
boost::AlgoNodeStruct::m_runtime
double m_runtime
Definition: PrecedenceRulesGraph.h:33
std::ofstream
STL class.
std::ofstream::close
T close(T...args)
boost::AlgoNodeStruct::m_name
std::string m_name
Definition: PrecedenceRulesGraph.h:30
GaudiPython.Persistency.get
def get(type_)
Definition: Persistency.py:23
concurrency::PrecedenceRulesGraph::m_ExecPlan
boost::ExecPlan m_ExecPlan
temporary items to experiment with execution planning
Definition: PrecedenceRulesGraph.h:377
BrunelScenarioForwardScheduler.app
app
Definition: BrunelScenarioForwardScheduler.py:137

AlgorithmNode * concurrency::PrecedenceRulesGraph::getAlgorithmNode | ( | const std::string & | algoName | ) | const

Get the AlgorithmNode from by algorithm name using graph index.

Definition at line 645 of file PrecedenceRulesGraph.cpp.

646 {
647
648 return m_algoNameToAlgoNodeMap.at( algoName );
649 }
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoNodeMap
AlgoNodesMap m_algoNameToAlgoNodeMap
Index: map of algorithm&#39;s name to AlgorithmNode.
Definition: PrecedenceRulesGraph.h:360
std::unordered_map::at
T at(T...args)

AlgsExecutionStates& concurrency::PrecedenceRulesGraph::getAlgoStates | ( | const int & | slotNum | ) | const
| inline

Definition at line 346 of file PrecedenceRulesGraph.h.

346 {return m_eventSlots->at(slotNum).algsStates;}
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:37
std::vector::at
T at(T...args)
concurrency::PrecedenceRulesGraph::m_eventSlots
std::vector< EventSlot > * m_eventSlots
Definition: PrecedenceRulesGraph.h:375

unsigned int concurrency::PrecedenceRulesGraph::getControlFlowNodeCounter | ( |  | ) | const
| inline

Get total number of graph nodes.

Definition at line 321 of file PrecedenceRulesGraph.h.

321 {return m_nodeCounter;}
concurrency::PrecedenceRulesGraph::m_nodeCounter
unsigned int m_nodeCounter
Total number of nodes in the graph.
Definition: PrecedenceRulesGraph.h:369

const std::vector< AlgorithmNode * > concurrency::PrecedenceRulesGraph::getDataIndependentNodes | ( |  | ) | const

Definition at line 761 of file PrecedenceRulesGraph.cpp.

762 {
763
764 std::vector<AlgorithmNode*> result;
765
766 for (auto node : m_algoNameToAlgoInputsMap) {
767 DataObjIDColl collection = (node.second);
768 if (collection.empty())
769 result.push_back(getAlgorithmNode(node.first));
770 }
771
772 return result;
773 }
std::unordered_set::empty
T empty(T...args)
concurrency::PrecedenceRulesGraph::getAlgorithmNode
AlgorithmNode * getAlgorithmNode(const std::string &algoName) const
Get the AlgorithmNode from by algorithm name using graph index.
Definition: PrecedenceRulesGraph.cpp:645
std::vector::push_back
T push_back(T...args)
std::unordered_set< DataObjID, DataObjID_Hasher >
std::vector
STL class.
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoInputsMap
AlgoInputsMap m_algoNameToAlgoInputsMap
Indexes: maps of algorithm&#39;s name to algorithm&#39;s inputs/outputs.
Definition: PrecedenceRulesGraph.h:366

DataNode * concurrency::PrecedenceRulesGraph::getDataNode | ( | const DataObjID & | dataPath | ) | const

Get DataNode by DataObject path using graph index.

Definition at line 674 of file PrecedenceRulesGraph.cpp.

675 {
676
677 return m_dataPathToDataNodeMap.at( dataPath );
678 }
std::unordered_map::at
T at(T...args)
concurrency::PrecedenceRulesGraph::m_dataPathToDataNodeMap
DataNodesMap m_dataPathToDataNodeMap
Index: map of data path to DataNode.
Definition: PrecedenceRulesGraph.h:364

const std::chrono::system_clock::time_point concurrency::PrecedenceRulesGraph::getInitTime | ( |  | ) | const
| inline

Definition at line 344 of file PrecedenceRulesGraph.h.

344 {return m_initTime;}
concurrency::PrecedenceRulesGraph::m_initTime
const std::chrono::system_clock::time_point m_initTime
Definition: PrecedenceRulesGraph.h:373

std::vector<int>& concurrency::PrecedenceRulesGraph::getNodeDecisions | ( | const int & | slotNum | ) | const
| inline

Definition at line 348 of file PrecedenceRulesGraph.h.

348 {return m_eventSlots->at(slotNum).controlFlowState;}
std::vector::at
T at(T...args)
concurrency::PrecedenceRulesGraph::m_eventSlots
std::vector< EventSlot > * m_eventSlots
Definition: PrecedenceRulesGraph.h:375
EventSlot::controlFlowState
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:43

StatusCode concurrency::PrecedenceRulesGraph::initialize | ( | const std::unordered_map< std::string, unsigned int > & | algname_index_map | ) |

Initialize graph.

Definition at line 439 of file PrecedenceRulesGraph.cpp.

440 {
441
442 m_headNode->initialize( algname_index_map );
443 // StatusCode sc = buildDataDependenciesRealm();
444 StatusCode sc = buildAugmentedDataDependenciesRealm();
445
446 if ( !sc.isSuccess() ) error() << "Could not build the data dependency realm." << endmsg;
447
448 return sc;
449 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
concurrency::PrecedenceRulesGraph::m_headNode
DecisionNode * m_headNode
the head node of the control flow graph; may want to have multiple ones once supporting trigger paths...
Definition: PrecedenceRulesGraph.h:358
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
concurrency::PrecedenceRulesGraph::buildAugmentedDataDependenciesRealm
StatusCode buildAugmentedDataDependenciesRealm()
Build data dependency realm WITH data object nodes participating.
Definition: PrecedenceRulesGraph.cpp:549
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
concurrency::DecisionNode::initialize
void initialize(const std::unordered_map< std::string, unsigned int > &algname_index_map) override
Initialize.
Definition: PrecedenceRulesGraph.cpp:29

StatusCode concurrency::PrecedenceRulesGraph::initialize | ( | const std::unordered_map< std::string, unsigned int > & | algname_index_map,
|  | std::vector< EventSlot > & | eventSlots
| ) |  |

Definition at line 452 of file PrecedenceRulesGraph.cpp.

454 {
455
456 m_eventSlots = &eventSlots;
457 m_headNode->initialize( algname_index_map );
458 // StatusCode sc = buildDataDependenciesRealm();
459 StatusCode sc = buildAugmentedDataDependenciesRealm();
460
461 if ( !sc.isSuccess() ) error() << "Could not build the data dependency realm." << endmsg;
462
463 if (msgLevel(MSG::DEBUG))
464 debug() << dumpDataFlow() << endmsg;
465
466 return sc;
467 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
MSG::DEBUG
Definition: IMessageSvc.h:18
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
concurrency::PrecedenceRulesGraph::m_eventSlots
std::vector< EventSlot > * m_eventSlots
Definition: PrecedenceRulesGraph.h:375
concurrency::PrecedenceRulesGraph::m_headNode
DecisionNode * m_headNode
the head node of the control flow graph; may want to have multiple ones once supporting trigger paths...
Definition: PrecedenceRulesGraph.h:358
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
concurrency::PrecedenceRulesGraph::dumpDataFlow
std::string dumpDataFlow() const
Print out all data origins and destinations, as reflected in the EF graph.
Definition: PrecedenceRulesGraph.cpp:776
concurrency::PrecedenceRulesGraph::buildAugmentedDataDependenciesRealm
StatusCode buildAugmentedDataDependenciesRealm()
Build data dependency realm WITH data object nodes participating.
Definition: PrecedenceRulesGraph.cpp:549
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
concurrency::DecisionNode::initialize
void initialize(const std::unordered_map< std::string, unsigned int > &algname_index_map) override
Initialize.
Definition: PrecedenceRulesGraph.cpp:29

const std::string& concurrency::PrecedenceRulesGraph::name | ( |  | ) | const
| inline override

Retrieve name of the service.

Definition at line 340 of file PrecedenceRulesGraph.h.

340 {return m_name;}
concurrency::PrecedenceRulesGraph::m_name
const std::string m_name
Definition: PrecedenceRulesGraph.h:372

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

Print a string representing the control flow state.

Definition at line 333 of file PrecedenceRulesGraph.h.

336 {m_headNode->printState(output,states,node_decisions,recursionLevel);}
concurrency::PrecedenceRulesGraph::m_headNode
DecisionNode * m_headNode
the head node of the control flow graph; may want to have multiple ones once supporting trigger paths...
Definition: PrecedenceRulesGraph.h:358
concurrency::DecisionNode::printState
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.
Definition: PrecedenceRulesGraph.cpp:50

void concurrency::PrecedenceRulesGraph::rankAlgorithms | ( | IGraphVisitor & | ranker | ) | const

Rank Algorithm nodes by the number of data outputs.

Definition at line 747 of file PrecedenceRulesGraph.cpp.

748 {
749
750 info() << "Starting ranking by data outputs .. " << endmsg;
751 for (auto& pair : m_algoNameToAlgoNodeMap) {
752 if (msgLevel(MSG::DEBUG))
753 debug() << " Ranking " << pair.first << "... " << endmsg;
754 pair.second->accept(ranker);
755 if (msgLevel(MSG::DEBUG))
756 debug() << " ... rank of " << pair.first << ": " << pair.second->getRank() << endmsg;
757 }
758 }
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:123
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoNodeMap
AlgoNodesMap m_algoNameToAlgoNodeMap
Index: map of algorithm&#39;s name to AlgorithmNode.
Definition: PrecedenceRulesGraph.h:360
MSG::DEBUG
Definition: IMessageSvc.h:18
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void concurrency::PrecedenceRulesGraph::registerIODataObjects | ( | const Algorithm * | algo | ) |

Register algorithm in the Data Dependency index.

Definition at line 470 of file PrecedenceRulesGraph.cpp.

471 {
472
473 const std::string& algoName = algo->name();
474
475 DataObjIDColl inputObjs, outputObjs;
476 DHHVisitor avis( inputObjs, outputObjs );
477 algo->acceptDHVisitor( &avis );
478
479 m_algoNameToAlgoInputsMap[algoName] = inputObjs;
480 m_algoNameToAlgoOutputsMap[algoName] = outputObjs;
481
482 if (msgLevel(MSG::DEBUG)) {
483 debug() << "Inputs of " << algoName << ": ";
484 for (auto tag : inputObjs)
485 debug() << tag << " | ";
486 debug() << endmsg;
487
488 debug() << "Outputs of " << algoName << ": ";
489 for (auto tag : outputObjs)
490 debug() << tag << " | ";
491 debug() << endmsg;
492 }
493 }
Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:715
Algorithm::acceptDHVisitor
virtual void acceptDHVisitor(IDataHandleVisitor *) const override
Definition: Algorithm.cpp:205
MSG::DEBUG
Definition: IMessageSvc.h:18
std::string
STL class.
DHHVisitor
Definition: DataHandleHolderVisitor.h:8
std::unordered_set< DataObjID, DataObjID_Hasher >
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoOutputsMap
AlgoOutputsMap m_algoNameToAlgoOutputsMap
Definition: PrecedenceRulesGraph.h:367
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoInputsMap
AlgoInputsMap m_algoNameToAlgoInputsMap
Indexes: maps of algorithm&#39;s name to algorithm&#39;s inputs/outputs.
Definition: PrecedenceRulesGraph.h:366

SmartIF<ISvcLocator>& concurrency::PrecedenceRulesGraph::serviceLocator | ( |  | ) | const
| inline override

Retrieve pointer to service locator.

Definition at line 342 of file PrecedenceRulesGraph.h.

342 {return m_svcLocator;}
concurrency::PrecedenceRulesGraph::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
Definition: PrecedenceRulesGraph.h:371

void concurrency::PrecedenceRulesGraph::updateDecision | ( | const std::string & | algo_name,
|  | const int & | slotNum,
|  | AlgsExecutionStates & | states,
|  | std::vector< int > & | node_decisions
| ) |  | const

A method to update algorithm node decision, and propagate it upwards.

Definition at line 738 of file PrecedenceRulesGraph.cpp.

740 {
741 //if (msgLevel(MSG::DEBUG))
742 // debug() << "(UPDATING)Setting decision of algorithm " << algo_name << " and propagating it upwards.." << endmsg;
743 getAlgorithmNode( algo_name )->updateDecision( slotNum, algo_states, node_decisions );
744 }
concurrency::PrecedenceRulesGraph::getAlgorithmNode
AlgorithmNode * getAlgorithmNode(const std::string &algoName) const
Get the AlgorithmNode from by algorithm name using graph index.
Definition: PrecedenceRulesGraph.cpp:645
concurrency::AlgorithmNode::updateDecision
void updateDecision(const int &slotNum, AlgsExecutionStates &states, std::vector< int > &node_decisions, const AlgorithmNode *requestor=nullptr) const override
XXX: CF tests.
Definition: PrecedenceRulesGraph.cpp:371

void concurrency::PrecedenceRulesGraph::updateEventState | ( | AlgsExecutionStates & | states,
|  | std::vector< int > & | node_decisions
| ) |  | const

XXX CF tests. Is needed for older CF implementation.

Definition at line 732 of file PrecedenceRulesGraph.cpp.

733 {
734 m_headNode->updateState( algo_states, node_decisions );
735 }
concurrency::PrecedenceRulesGraph::m_headNode
DecisionNode * m_headNode
the head node of the control flow graph; may want to have multiple ones once supporting trigger paths...
Definition: PrecedenceRulesGraph.h:358
concurrency::DecisionNode::updateState
int updateState(AlgsExecutionStates &states, std::vector< int > &node_decisions) const override
Method to set algos to CONTROLREADY, if possible.
Definition: PrecedenceRulesGraph.cpp:63

## Member Data Documentation

friend concurrency::PrecedenceRulesGraph::ExecutionFlowManager
| private

Definition at line 281 of file PrecedenceRulesGraph.h.

AlgoInputsMap concurrency::PrecedenceRulesGraph::m_algoNameToAlgoInputsMap
| private

Indexes: maps of algorithm's name to algorithm's inputs/outputs.

Definition at line 366 of file PrecedenceRulesGraph.h.

AlgoNodesMap concurrency::PrecedenceRulesGraph::m_algoNameToAlgoNodeMap
| private

Index: map of algorithm's name to AlgorithmNode.

Definition at line 360 of file PrecedenceRulesGraph.h.

AlgoOutputsMap concurrency::PrecedenceRulesGraph::m_algoNameToAlgoOutputsMap
| private

Definition at line 367 of file PrecedenceRulesGraph.h.

DataNodesMap concurrency::PrecedenceRulesGraph::m_dataPathToDataNodeMap
| private

Index: map of data path to DataNode.

Definition at line 364 of file PrecedenceRulesGraph.h.

DecisionHubsMap concurrency::PrecedenceRulesGraph::m_decisionNameToDecisionHubMap
| private

Index: map of decision's name to DecisionHub.

Definition at line 362 of file PrecedenceRulesGraph.h.

std::vector<EventSlot>* concurrency::PrecedenceRulesGraph::m_eventSlots
| private

Definition at line 375 of file PrecedenceRulesGraph.h.

std::map<std::string,boost::AlgoVertex> concurrency::PrecedenceRulesGraph::m_exec_plan_map
| private

Definition at line 378 of file PrecedenceRulesGraph.h.

boost::ExecPlan concurrency::PrecedenceRulesGraph::m_ExecPlan
| private

temporary items to experiment with execution planning

Definition at line 377 of file PrecedenceRulesGraph.h.

DecisionNode* concurrency::PrecedenceRulesGraph::m_headNode
| private

the head node of the control flow graph; may want to have multiple ones once supporting trigger paths

Definition at line 358 of file PrecedenceRulesGraph.h.

const std::chrono::system_clock::time_point concurrency::PrecedenceRulesGraph::m_initTime
| private

Definition at line 373 of file PrecedenceRulesGraph.h.

const std::string concurrency::PrecedenceRulesGraph::m_name
| private

Definition at line 372 of file PrecedenceRulesGraph.h.

unsigned int concurrency::PrecedenceRulesGraph::m_nodeCounter
| private

Total number of nodes in the graph.

Definition at line 369 of file PrecedenceRulesGraph.h.

SmartIF<ISvcLocator> concurrency::PrecedenceRulesGraph::m_svcLocator
| mutable private

Service locator (needed to access the MessageSvc)

Definition at line 371 of file PrecedenceRulesGraph.h.

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

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