| The Gaudi Framework v28r2p1 (f1a77ff4)

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

- File List
- File Members

ExecutionFlowManager.h
Go to the documentation of this file.
1 #ifndef EXECUTIONFLOWMANAGER_H_
2 #define EXECUTIONFLOWMANAGER_H_
3
4 #include "PRGraphVisitors.h"
5 #include "PrecedenceRulesGraph.h"
6
7 namespace concurrency {
8
9 struct IExecutionFlowManager {
10 virtual ~IExecutionFlowManager() {}
11 };
12
21 class ExecutionFlowManager : public CommonMessaging<IExecutionFlowManager> {
22 public:
24 ExecutionFlowManager() : m_name("ExecutionFlowManager"), m_PRGraph(0) {};
26 ~ExecutionFlowManager() override = default;
29 StatusCode initialize(PrecedenceRulesGraph* graph,
30 const std::unordered_map<std::string,unsigned int>& algname_index_map);
31 StatusCode initialize(PrecedenceRulesGraph* graph,
32 const std::unordered_map<std::string,unsigned int>& algname_index_map,
33 std::vector<EventSlot>& eventSlots,
34 const std::string& mode);
36 void simulateExecutionFlow(IGraphVisitor& visitor) const;
38 inline PrecedenceRulesGraph* getPrecedenceRulesGraph() const {return m_PRGraph;}
40 bool needsAlgorithmToRun(const unsigned int iAlgo) const;
42 void updateEventState(AlgsExecutionStates & algo_states,
43 std::vector<int>& node_decisions) const;
45 void updateDecision(const std::string& algo_name,
46 const int& slotNum,
47 AlgsExecutionStates& states,
48 std::vector<int>& node_decisions) const;
50 void updateEventState(AlgsExecutionStates& algo_states) const;
52 void promoteToControlReadyState(AlgsExecutionStates& algo_states,
53 std::vector<int>& node_decisions,
54 const int& slotNum=-1) const;
56 bool algoDataDependenciesSatisfied(const std::string& algo_name, const int& slotNum) const;
58 bool rootDecisionResolved(const std::vector<int>& node_decisions) const;
60 void printEventState(std::stringstream& ss,
61 AlgsExecutionStates& states,
62 const std::vector<int>& node_decisions,
63 const unsigned int& recursionLevel) const {m_PRGraph->printState(ss,states,node_decisions,recursionLevel);}
65 void touchReadyAlgorithms(IGraphVisitor& visitor) const;
67 const std::string& name() const override {return m_name;}
69 SmartIF<ISvcLocator>& serviceLocator() const override {return m_PRGraph->serviceLocator();}
70 private:
71 std::string m_name;
73 PrecedenceRulesGraph* m_PRGraph;
74 };
75
76 } // namespace concurrency
77
78 #endif /* EXECUTIONFLOWMANAGER_H_ */
concurrency::ExecutionFlowManager::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: ExecutionFlowManager.h:69
SmartIF< ISvcLocator >
concurrency::ExecutionFlowManager::ExecutionFlowManager
ExecutionFlowManager()
Constructor.
Definition: ExecutionFlowManager.h:24
PRGraphVisitors.h
concurrency::ExecutionFlowManager::printEventState
void printEventState(std::stringstream &ss, AlgsExecutionStates &states, const std::vector< int > &node_decisions, const unsigned int &recursionLevel) const
Print the state of the control flow for a given event.
Definition: ExecutionFlowManager.h:60
concurrency::IExecutionFlowManager::~IExecutionFlowManager
virtual ~IExecutionFlowManager()
Definition: ExecutionFlowManager.h:10
concurrency
Definition: ExecutionFlowManager.cpp:3
concurrency::ExecutionFlowManager::name
const std::string & name() const override
Retrieve name of the service.
Definition: ExecutionFlowManager.h:67
std::stringstream
STL class.
std::string
STL class.
concurrency::ExecutionFlowManager::m_name
std::string m_name
Definition: ExecutionFlowManager.h:71
AlgsExecutionStates
The AlgsExecutionStates encodes the state machine for the execution of algorithms within a single eve...
Definition: AlgsExecutionStates.h:28
concurrency::ExecutionFlowManager
Manage the execution flow using a graph of task precedence rules Once initialized, the graph is const and can be shared across events.
Definition: ExecutionFlowManager.h:21
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
concurrency::IGraphVisitor
Definition: IGraphVisitor.h:9
plotSpeedupsPyRoot.graph
graph
Definition: plotSpeedupsPyRoot.py:134
concurrency::PrecedenceRulesGraph
Definition: PrecedenceRulesGraph.h:280
std::vector< EventSlot >
concurrency::IExecutionFlowManager
Definition: ExecutionFlowManager.h:9
CommonMessaging
Definition: CommonMessaging.h:55
concurrency::ExecutionFlowManager::m_PRGraph
PrecedenceRulesGraph * m_PRGraph
the graph of precedence rules
Definition: ExecutionFlowManager.h:73
concurrency::ExecutionFlowManager::getPrecedenceRulesGraph
PrecedenceRulesGraph * getPrecedenceRulesGraph() const
Get the flow graph instance.
Definition: ExecutionFlowManager.h:38
PrecedenceRulesGraph.h
std::unordered_map< std::string, unsigned int >