| The Gaudi Framework v30r0 (c919700c)

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

- File List
- File Members

PrecedenceRulesGraph.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_PRECEDENCERULESGRAPH_H
2 #define GAUDIHIVE_PRECEDENCERULESGRAPH_H
3
4 // std includes
5 #include <algorithm>
6 #include <chrono>
7 #include <sstream>
8 #include <unordered_map>
9 #include <vector>
10
11 #include <boost/filesystem.hpp>
12 #include <boost/graph/adjacency_list.hpp>
13 #include <boost/graph/graphml.hpp>
14 #include <boost/variant.hpp>
15
16 // fwk includes
17 #include "AlgsExecutionStates.h"
18 #include "EventSlot.h"
19 #include "GaudiKernel/Algorithm.h"
20 #include "GaudiKernel/CommonMessaging.h"
21 #include "GaudiKernel/DataObject.h"
22 #include "GaudiKernel/ICondSvc.h"
23 #include "GaudiKernel/IHiveWhiteBoard.h"
24 #include "GaudiKernel/ITimelineSvc.h"
25 #include "GaudiKernel/TaggedBool.h"
26 #include "IGraphVisitor.h"
27
28 namespace concurrency
29 {
30 using Concurrent = Gaudi::tagged_bool<class Concurrent_tag>;
31 using PromptDecision = Gaudi::tagged_bool<class PromptDecision_tag>;
32 using ModeOr = Gaudi::tagged_bool<class ModeOr_tag>;
33 using AllPass = Gaudi::tagged_bool<class AllPass_tag>;
34 using Inverted = Gaudi::tagged_bool<class Inverted_tag>;
35 }
36
37 namespace precedence
38 {
39 using boost::static_visitor;
40
41 // Precedence trace utilities ==============================================
42 struct AlgoTraceProps {
43 AlgoTraceProps() {}
44 AlgoTraceProps( const std::string& name, int index, int rank, double runtime )
45 : m_name( name ), m_index( index ), m_rank( rank ), m_runtime( runtime )
46 {
47 }
48 std::string m_name;
49 int m_index{-1};
50 int m_rank{-1};
51 int m_runtime{-1}; // ns
52 int m_eccentricity{-1};
53 };
54
55 using PrecTrace = boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, AlgoTraceProps>;
56 using AlgoTraceVertex = boost::graph_traits<PrecTrace>::vertex_descriptor;
57
58 // Precedence rules utilities ==============================================
59 struct AlgoProps {
60 AlgoProps() {}
61 AlgoProps( Algorithm* algo, uint nodeIndex, uint algoIndex, bool inverted, bool allPass )
62 : m_name( algo->name() )
63 , m_nodeIndex( nodeIndex )
64 , m_algoIndex( algoIndex )
65 , m_algorithm( algo )
66 , m_inverted( inverted )
67 , m_allPass( allPass )
68 , m_isIOBound( algo->isIOBound() )
69 {
70 }
71
72 std::string m_name{""};
73 int m_nodeIndex{-1};
74 int m_algoIndex{-1};
75 int m_rank{-1};
77 Algorithm* m_algorithm{nullptr};
78
80 bool m_inverted{false};
82 bool m_allPass{false};
84 bool m_isIOBound{false};
85 };
86
87 struct DecisionHubProps {
88 DecisionHubProps( const std::string& name, uint nodeIndex, concurrency::Concurrent modeConcurrent,
89 concurrency::PromptDecision modePromptDecision, concurrency::ModeOr modeOR,
90 concurrency::AllPass allPass, concurrency::Inverted isInverted )
91 : m_name( name )
92 , m_nodeIndex( nodeIndex )
93 , m_modeConcurrent( modeConcurrent )
94 , m_modePromptDecision( modePromptDecision )
95 , m_inverted( isInverted )
96 , m_modeOR( modeOR )
97 , m_allPass( allPass )
98 {
99 }
100
101 std::string m_name;
102 uint m_nodeIndex;
103
105 bool m_modeConcurrent;
108 bool m_modePromptDecision;
110 bool m_inverted{false};
112 bool m_modeOR;
114 bool m_allPass;
115 };
116
117 struct DataProps {
118 DataProps( const DataObjID& id ) : m_id( id ) {}
119
120 DataObjID m_id;
121 };
122
123 struct CondDataProps : DataProps {
124 CondDataProps( const DataObjID& id ) : DataProps( id ) {}
125 };
126
127 // Vertex unpacking ========================================================
128
129 struct VertexName : static_visitor<std::string> {
130 std::string operator()( const AlgoProps& props ) const { return props.m_name; }
131
132 std::string operator()( const DecisionHubProps& props ) const { return props.m_name; }
133
134 std::string operator()( const DataProps& props ) const { return props.m_id.fullKey(); }
135 };
136
137 struct GroupMode : static_visitor<std::string> {
138 std::string operator()( const AlgoProps& ) const { return ""; }
139
140 std::string operator()( const DecisionHubProps& props ) const
141 {
142 return props.m_modeConcurrent ? "Concurrent" : "Sequential";
143 }
144
145 std::string operator()( const DataProps& ) const { return ""; }
146 };
147
148 struct GroupLogic : static_visitor<std::string> {
149 std::string operator()( const AlgoProps& ) const { return ""; }
150
151 std::string operator()( const DecisionHubProps& props ) const { return props.m_modeOR ? "OR" : "AND"; }
152
153 std::string operator()( const DataProps& ) const { return ""; }
154 };
155
156 struct GroupExit : static_visitor<std::string> {
157 std::string operator()( const AlgoProps& ) const { return ""; }
158
159 std::string operator()( const DecisionHubProps& props ) const
160 {
161 return props.m_modePromptDecision ? "Early" : "Late";
162 }
163
164 std::string operator()( const DataProps& ) const { return ""; }
165 };
166
167 struct DecisionNegation : static_visitor<std::string> {
168 std::string operator()( const AlgoProps& props ) const { return props.m_inverted ? "Inverted" : "Non-inverted"; }
169
170 std::string operator()( const DecisionHubProps& ) const { return ""; }
171
172 std::string operator()( const DataProps& ) const { return ""; }
173 };
174
175 struct AllPass : static_visitor<std::string> {
176 std::string operator()( const AlgoProps& props ) const { return props.m_allPass ? "Optimist" : "Realist"; }
177
178 std::string operator()( const DecisionHubProps& props ) const { return props.m_allPass ? "Optimist" : "Realist"; }
179
180 std::string operator()( const DataProps& ) const { return ""; }
181 };
182
183 struct CFDecision : static_visitor<std::string> {
184 CFDecision( const EventSlot& slot ) : m_slot( slot ) {}
185
186 std::string operator()( const AlgoProps& props ) const
187 {
188 return std::to_string( m_slot.controlFlowState.at( props.m_nodeIndex ) );
189 }
190
191 std::string operator()( const DecisionHubProps& props ) const
192 {
193 return std::to_string( m_slot.controlFlowState.at( props.m_nodeIndex ) );
194 }
195
196 std::string operator()( const DataProps& ) const { return ""; }
197
198 EventSlot m_slot;
199 };
200
201 struct EntityState : static_visitor<std::string> {
202 EntityState( const EventSlot& slot, SmartIF<ISvcLocator>& svcLocator, bool conditionsEnabled )
203 : m_slot( slot ), m_conditionsEnabled( conditionsEnabled )
204 {
205 SmartIF<IMessageSvc> msgSvc{svcLocator};
206 MsgStream log{msgSvc, "EntityState.Getter"};
207
208 // Figure if we can discover the data object states
209 m_whiteboard = svcLocator->service<IHiveWhiteBoard>( "EventDataSvc", false );
210 if ( !m_whiteboard.isValid() ) {
211 log << MSG::WARNING << "Failed to locate EventDataSvc: no way to add DO "
212 << "states to the TTT dump " << endmsg;
213 }
214
215 if ( m_conditionsEnabled ) {
216 // Figure if we can discover Condition data object states
217 m_condSvc = svcLocator->service<ICondSvc>( "CondSvc", false );
218 if ( !m_condSvc.isValid() )
219 log << MSG::WARNING << "Failed to locate CondSvc: no way to add Condition DO "
220 << "states to the TTT dump " << endmsg;
221 }
222
223 if ( !m_slot.eventContext->valid() )
224 log << MSG::WARNING << "Event context is invalid: no way to add DO states"
225 << " in the TTT dump" << endmsg;
226 }
227
228 std::string operator()( const AlgoProps& props ) const
229 { // Returns algorithm's FSM state
230 using State = AlgsExecutionStates::State;
231 State state = m_slot.algsStates[props.m_algoIndex];
232 switch ( state ) {
233 case State::INITIAL:
234 return "INITIAL";
235 case State::CONTROLREADY:
236 return "CONTROLREADY";
237 case State::DATAREADY:
238 return "DATAREADY";
239 case State::SCHEDULED:
240 return "SCHEDULED";
241 case State::EVTACCEPTED:
242 return "EVTACCEPTED";
243 case State::EVTREJECTED:
244 return "EVTREJECTED";
245 case State::ERROR:
246 return "ERROR";
247 default:
248 return "UNKNOWN";
249 }
250 }
251
252 std::string operator()( const DecisionHubProps& ) const { return ""; }
253
254 std::string operator()( const DataProps& props ) const
255 {
256 std::string state;
257
258 if ( m_whiteboard.isValid() && m_slot.eventContext->valid() )
259 if ( m_whiteboard->selectStore( m_slot.eventContext->slot() ).isSuccess() )
260 state = m_whiteboard->exists( props.m_id.fullKey() ) ? "Produced" : "Missing";
261
262 return state;
263 }
264
265 std::string operator()( const CondDataProps& props ) const
266 {
267 std::string state;
268
269 if ( m_condSvc.isValid() && m_slot.eventContext->valid() )
270 state = m_condSvc->isValidID( *( m_slot.eventContext ), props.m_id.fullKey() ) ? "Produced" : "Missing";
271
272 return state;
273 }
274
275 EventSlot m_slot;
276
277 SmartIF<IHiveWhiteBoard> m_whiteboard;
278 SmartIF<ICondSvc> m_condSvc;
279 bool m_conditionsEnabled{false};
280 };
281
282 struct StartTime : static_visitor<std::string> {
283 StartTime( const EventSlot& slot, SmartIF<ISvcLocator>& svcLocator ) : m_slot( slot )
284 {
285 SmartIF<IMessageSvc> msgSvc{svcLocator};
286 MsgStream log{msgSvc, "StartTime.Getter"};
287
288 // Figure if we can discover the algorithm timings
289 m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
290 if ( !m_timelineSvc.isValid() ) {
291 log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to "
292 << "add algorithm start time to the TTT dumps" << endmsg;
293 }
294 }
295
296 std::string operator()( const AlgoProps& props ) const
297 {
298
299 std::string startTime;
300
301 if ( m_timelineSvc.isValid() ) {
302
303 TimelineEvent te{};
304 te.algorithm = props.m_name;
305 te.slot = m_slot.eventContext->slot();
306 te.event = m_slot.eventContext->evt();
307
308 m_timelineSvc->getTimelineEvent( te );
309 startTime = std::to_string(
310 std::chrono::duration_cast<std::chrono::nanoseconds>( te.start.time_since_epoch() ).count() );
311 }
312
313 return startTime;
314 }
315
316 std::string operator()( const DecisionHubProps& ) const { return ""; }
317
318 std::string operator()( const DataProps& ) const { return ""; }
319
320 EventSlot m_slot;
321 SmartIF<ITimelineSvc> m_timelineSvc;
322 };
323
324 struct EndTime : static_visitor<std::string> {
325 EndTime( const EventSlot& slot, SmartIF<ISvcLocator>& svcLocator ) : m_slot( slot )
326 {
327 SmartIF<IMessageSvc> msgSvc{svcLocator};
328 MsgStream log{msgSvc, "EndTime.Getter"};
329
330 // Figure if we can discover the algorithm timings
331 m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
332 if ( !m_timelineSvc.isValid() )
333 log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
334 << "algorithm completion time to the TTT dumps" << endmsg;
335 }
336
337 std::string operator()( const AlgoProps& props ) const
338 {
339
340 std::string endTime;
341
342 if ( m_timelineSvc.isValid() ) {
343
344 TimelineEvent te{};
345 te.algorithm = props.m_name;
346 te.slot = m_slot.eventContext->slot();
347 te.event = m_slot.eventContext->evt();
348
349 m_timelineSvc->getTimelineEvent( te );
350 endTime =
351 std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end.time_since_epoch() ).count() );
352 }
353
354 return endTime;
355 }
356
357 std::string operator()( const DecisionHubProps& ) const { return ""; }
358
359 std::string operator()( const DataProps& ) const { return ""; }
360
361 EventSlot m_slot;
362 SmartIF<ITimelineSvc> m_timelineSvc;
363 };
364
365 struct Duration : static_visitor<std::string> {
366 Duration( const EventSlot& slot, SmartIF<ISvcLocator>& svcLocator ) : m_slot( slot )
367 {
368 SmartIF<IMessageSvc> msgSvc{svcLocator};
369 MsgStream log{msgSvc, "Duration.Getter"};
370
371 // Figure if we can discover the algorithm timings
372 m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
373 if ( !m_timelineSvc.isValid() )
374 log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
375 << "algorithm's runtimes to the TTT dumps" << endmsg;
376 }
377
378 std::string operator()( const AlgoProps& props ) const
379 {
380
381 std::string time;
382
383 if ( m_timelineSvc.isValid() ) {
384
385 TimelineEvent te;
386 te.algorithm = props.m_name;
387 te.slot = m_slot.eventContext->slot();
388 te.event = m_slot.eventContext->evt();
389
390 m_timelineSvc->getTimelineEvent( te );
391 time = std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end - te.start ).count() );
392 }
393
394 return time;
395 }
396
397 std::string operator()( const DecisionHubProps& ) const { return ""; }
398
399 std::string operator()( const DataProps& ) const { return ""; }
400
401 EventSlot m_slot;
402 SmartIF<ITimelineSvc> m_timelineSvc;
403 };
404
405 struct Operations : static_visitor<std::string> {
406 std::string operator()( const AlgoProps& props ) const { return props.m_isIOBound ? "IO-bound" : "CPU-bound"; }
407
408 std::string operator()( const DecisionHubProps& ) const { return ""; }
409
410 std::string operator()( const DataProps& ) const { return ""; }
411 };
412
413 static inline std::ostream& operator<<( std::ostream& os, const AlgoProps& ) { return os << "Algorithm"; }
414 static inline std::ostream& operator<<( std::ostream& os, const DecisionHubProps& ) { return os << "DecisionHub"; }
415 static inline std::ostream& operator<<( std::ostream& os, const DataProps& ) { return os << "Data"; }
416 static inline std::ostream& operator<<( std::ostream& os, const CondDataProps& ) { return os << "ConditionData"; }
417
418 //=========================================================================
419
420 using VariantVertexProps = boost::variant<AlgoProps, DecisionHubProps, DataProps, CondDataProps>;
421 using PRGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, VariantVertexProps>;
422 using PRVertexDesc = boost::graph_traits<PRGraph>::vertex_descriptor;
423
424 } // namespace prules
425
426 struct Cause {
427 enum class source { Root, Task };
428
429 source m_source;
430 std::string m_sourceName;
431 };
432
433 namespace concurrency
434 {
435
436 using State = AlgsExecutionStates::State;
437 class PrecedenceRulesGraph;
438
439 using precedence::PRVertexDesc;
440 using precedence::AlgoProps;
441 using precedence::DecisionHubProps;
442 using precedence::DataProps;
443 using precedence::CondDataProps;
444 using precedence::VariantVertexProps;
445
446 // ==========================================================================
447 class ControlFlowNode
448 {
449 public:
451 ControlFlowNode( PrecedenceRulesGraph& graph, unsigned int nodeIndex, const std::string& name )
452 : m_graph( &graph ), m_nodeIndex( nodeIndex ), m_nodeName( name )
453 {
454 }
456 virtual ~ControlFlowNode() {}
457
459 virtual bool accept( IGraphVisitor& visitor ) = 0;
461 virtual void printState( std::stringstream& output, AlgsExecutionStates& states,
462 const std::vector<int>& node_decisions, const unsigned int& recursionLevel ) const = 0;
464 const unsigned int& getNodeIndex() const { return m_nodeIndex; }
466 const std::string& getNodeName() const { return m_nodeName; }
467
468 public:
469 PrecedenceRulesGraph* m_graph;
470
471 protected:
473 std::string stateToString( const int& stateId ) const;
474 unsigned int m_nodeIndex;
475 std::string m_nodeName;
476 };
477
478 class DecisionNode : public ControlFlowNode
479 {
480 public:
482 DecisionNode( PrecedenceRulesGraph& graph, unsigned int nodeIndex, const std::string& name,
483 Concurrent modeConcurrent, PromptDecision modePromptDecision, ModeOr modeOR, AllPass allPass,
484 Inverted isInverted )
485 : ControlFlowNode( graph, nodeIndex, name )
486 , m_modeConcurrent( modeConcurrent )
487 , m_modePromptDecision( modePromptDecision )
488 , m_modeOR( modeOR )
489 , m_allPass( allPass )
490 , m_inverted( isInverted )
491 , m_children()
492 {
493 }
494
496 ~DecisionNode() override;
497
499 bool accept( IGraphVisitor& visitor ) override;
501 void addParentNode( DecisionNode* node );
503 void addDaughterNode( ControlFlowNode* node );
505 const std::vector<ControlFlowNode*>& getDaughters() const { return m_children; }
507 void printState( std::stringstream& output, AlgsExecutionStates& states, const std::vector<int>& node_decisions,
508 const unsigned int& recursionLevel ) const override;
509
510 public:
512 bool m_modeConcurrent;
515 bool m_modePromptDecision;
517 bool m_modeOR;
519 bool m_allPass;
521 bool m_inverted{false};
523 std::vector<ControlFlowNode*> m_children;
525 std::vector<DecisionNode*> m_parents;
526 };
527
528 // ==========================================================================
529 class DataNode;
530
531 class AlgorithmNode : public ControlFlowNode
532 {
533 public:
535 AlgorithmNode( PrecedenceRulesGraph& graph, Algorithm* algoPtr, unsigned int nodeIndex, unsigned int algoIndex,
536 bool inverted, bool allPass )
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() ){};
546 ~AlgorithmNode();
547
549 bool accept( IGraphVisitor& visitor ) override;
550
552 void addParentNode( DecisionNode* node );
554 const std::vector<DecisionNode*>& getParentDecisionHubs() const { return m_parents; }
555
557 void addOutputDataNode( DataNode* node );
559 void addInputDataNode( DataNode* node );
561 const std::vector<DataNode*>& getOutputDataNodes() const { return m_outputs; }
563 const std::vector<DataNode*>& getInputDataNodes() const { return m_inputs; }
564
566 void setRank( float& rank ) { m_rank = rank; }
568 const float& getRank() const { return m_rank; }
569
571 Algorithm* getAlgorithm() const { return m_algorithm; }
573 const unsigned int& getAlgoIndex() const { return m_algoIndex; }
574
576 void setIOBound( bool value ) { m_isIOBound = value; }
578 bool isIOBound() const { return m_isIOBound; }
579
581 bool isOptimist() const { return m_allPass; };
583 bool isLiar() const { return m_inverted; };
584
586 void printState( std::stringstream& output, AlgsExecutionStates& states, const std::vector<int>& node_decisions,
587 const unsigned int& recursionLevel ) const override;
588
589 public:
591 std::vector<DecisionNode*> m_parents;
592
593 private:
595 Algorithm* m_algorithm;
597 unsigned int m_algoIndex;
599 std::string m_algoName;
601 bool m_inverted;
603 bool m_allPass;
605 float m_rank;
607 bool m_isIOBound;
608
610 std::vector<DataNode*> m_outputs;
612 std::vector<DataNode*> m_inputs;
613 };
614
615 // ==========================================================================
616 class DataNode
617 {
618 public:
620 DataNode( PrecedenceRulesGraph& graph, const DataObjID& path ) : m_graph( &graph ), m_data_object_path( path ) {}
621
623 virtual ~DataNode() = default;
624
625 const DataObjID& getPath() { return m_data_object_path; }
626
628 virtual bool accept( IGraphVisitor& visitor )
629 {
630 if ( visitor.visitEnter( *this ) ) return visitor.visit( *this );
631 return true;
632 }
634 void addProducerNode( AlgorithmNode* node )
635 {
636 if ( std::find( m_producers.begin(), m_producers.end(), node ) == m_producers.end() )
637 m_producers.push_back( node );
638 }
640 void addConsumerNode( AlgorithmNode* node )
641 {
642 if ( std::find( m_consumers.begin(), m_consumers.end(), node ) == m_consumers.end() )
643 m_consumers.push_back( node );
644 }
646 const std::vector<AlgorithmNode*>& getProducers() const { return m_producers; }
648 const std::vector<AlgorithmNode*>& getConsumers() const { return m_consumers; }
649
650 public:
651 PrecedenceRulesGraph* m_graph;
652
653 private:
654 DataObjID m_data_object_path;
655 std::vector<AlgorithmNode*> m_producers;
656 std::vector<AlgorithmNode*> m_consumers;
657 };
658
659 class ConditionNode : public DataNode
660 {
661 public:
663 ConditionNode( PrecedenceRulesGraph& graph, const DataObjID& path, SmartIF<ICondSvc> condSvc )
664 : DataNode( graph, path ), m_condSvc( condSvc )
665 {
666 }
667
671 bool accept( IGraphVisitor& visitor ) override
672 {
673 if ( visitor.visitEnter( *this ) ) return visitor.visit( *this );
674 return true;
675 }
676
677 public:
678 // Service for Conditions handling
679 SmartIF<ICondSvc> m_condSvc;
680 };
681
682 // ==========================================================================
683 using AlgoNodesMap = std::unordered_map<std::string, AlgorithmNode*>;
684 using DecisionHubsMap = std::unordered_map<std::string, DecisionNode*>;
685 using DataNodesMap = std::unordered_map<DataObjID, DataNode*, DataObjID_Hasher>;
686
687 using AlgoInputsMap = std::unordered_map<std::string, DataObjIDColl>;
688 using AlgoOutputsMap = std::unordered_map<std::string, DataObjIDColl>;
689
690 struct IPrecedenceRulesGraph {
691 virtual ~IPrecedenceRulesGraph() = default;
692 };
693
694 class PrecedenceRulesGraph : public CommonMessaging<IPrecedenceRulesGraph>
695 {
696 public:
698 PrecedenceRulesGraph( const std::string& name, SmartIF<ISvcLocator> svc )
699 : m_headNode( 0 )
700 , m_nodeCounter( 0 )
701 , m_algoCounter( 0 )
702 , m_svcLocator( svc )
703 , m_name( name )
704 , m_initTime( std::chrono::system_clock::now() )
705 {
706 // make sure that CommonMessaging is initialized
707 setUpMessaging();
708 }
710 ~PrecedenceRulesGraph() override
711 {
712 if ( m_headNode != 0 ) delete m_headNode;
713 }
714
716 StatusCode initialize();
717
719 void accept( const std::string& algo_name, IGraphVisitor& visitor ) const;
720
722 StatusCode addDataNode( const DataObjID& dataPath );
724 DataNode* getDataNode( const DataObjID& dataPath ) const;
726 void registerIODataObjects( const Algorithm* algo );
728 StatusCode buildDataDependenciesRealm();
729
731 void addHeadNode( const std::string& headName, concurrency::Concurrent, concurrency::PromptDecision,
732 concurrency::ModeOr, concurrency::AllPass, concurrency::Inverted );
734 DecisionNode* getHeadNode() const { return m_headNode; };
736 StatusCode addAlgorithmNode( Algorithm* daughterAlgo, const std::string& parentName, bool inverted, bool allPass );
738 AlgorithmNode* getAlgorithmNode( const std::string& algoName ) const;
740 StatusCode addDecisionHubNode( Algorithm* daughterAlgo, const std::string& parentName, concurrency::Concurrent,
741 concurrency::PromptDecision, concurrency::ModeOr, concurrency::AllPass,
742 concurrency::Inverted );
744 unsigned int getControlFlowNodeCounter() const { return m_nodeCounter; }
745
747 void rankAlgorithms( IGraphVisitor& ranker ) const;
748
750 const std::string& name() const override { return m_name; }
752 SmartIF<ISvcLocator>& serviceLocator() const override { return m_svcLocator; }
754 const std::chrono::system_clock::time_point getInitTime() const { return m_initTime; }
755
757 void printState( std::stringstream& output, AlgsExecutionStates& states, const std::vector<int>& node_decisions,
758 const unsigned int& recursionLevel ) const
759 {
760 m_headNode->printState( output, states, node_decisions, recursionLevel );
761 }
762
764 void enableAnalysis() { m_enableAnalysis = true; };
765 PRVertexDesc node( const std::string& ) const;
766
768 std::string dumpDataFlow() const;
770 std::string dumpControlFlow() const;
772 void dumpPrecRules( const boost::filesystem::path&, const EventSlot& slot );
774 void dumpPrecTrace( const boost::filesystem::path& );
776 void addEdgeToPrecTrace( const AlgorithmNode* u, const AlgorithmNode* v );
778 void dumpControlFlow( std::ostringstream&, ControlFlowNode*, const int& ) const;
779
780 private:
782 DecisionNode* m_headNode;
784 AlgoNodesMap m_algoNameToAlgoNodeMap;
786 DecisionHubsMap m_decisionNameToDecisionHubMap;
788 DataNodesMap m_dataPathToDataNodeMap;
790 AlgoInputsMap m_algoNameToAlgoInputsMap;
791 AlgoOutputsMap m_algoNameToAlgoOutputsMap;
792
794 unsigned int m_nodeCounter;
796 unsigned int m_algoCounter;
797
799 mutable SmartIF<ISvcLocator> m_svcLocator;
800 const std::string m_name;
801
802 const std::chrono::system_clock::time_point m_initTime;
803
805 precedence::PrecTrace m_precTrace;
806 std::map<std::string, precedence::AlgoTraceVertex> m_prec_trace_map;
807 bool m_enableAnalysis{false};
809 precedence::PRGraph m_PRGraph;
810
812 bool m_conditionsRealmEnabled{false};
813 };
814
815 } // namespace concurrency
816 #endif
concurrency::AlgorithmNode::m_outputs
std::vector< DataNode * > m_outputs
Algorithm outputs (DataNodes)
Definition: PrecedenceRulesGraph.h:610
precedence::PRGraph
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, VariantVertexProps > PRGraph
Definition: PrecedenceRulesGraph.h:421
precedence::GroupLogic::operator()
std::string operator()(const DecisionHubProps &props) const
Definition: PrecedenceRulesGraph.h:151
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Algorithm.h
concurrency::AlgorithmNode::getAlgoIndex
const unsigned int & getAlgoIndex() const
Get algorithm index.
Definition: PrecedenceRulesGraph.h:573
precedence::CFDecision
Definition: PrecedenceRulesGraph.h:183
SmartIF< ISvcLocator >
precedence::GroupMode
Definition: PrecedenceRulesGraph.h:137
Cause::source
source
Definition: PrecedenceRulesGraph.h:427
precedence::DecisionNegation::operator()
std::string operator()(const DecisionHubProps &) const
Definition: PrecedenceRulesGraph.h:170
concurrency::DecisionNode::m_parents
std::vector< DecisionNode * > m_parents
Direct parent nodes.
Definition: PrecedenceRulesGraph.h:525
precedence::AlgoTraceProps::AlgoTraceProps
AlgoTraceProps(const std::string &name, int index, int rank, double runtime)
Definition: PrecedenceRulesGraph.h:44
concurrency::DecisionNode
Definition: PrecedenceRulesGraph.h:478
concurrency::ControlFlowNode::ControlFlowNode
ControlFlowNode(PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name)
Constructor.
Definition: PrecedenceRulesGraph.h:451
precedence::Duration
Definition: PrecedenceRulesGraph.h:365
precedence::AllPass::operator()
std::string operator()(const AlgoProps &props) const
Definition: PrecedenceRulesGraph.h:176
concurrency::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: PrecedenceRulesGraph.h:597
precedence
Definition: PrecedenceRulesGraph.h:37
concurrency::PrecedenceRulesGraph::getInitTime
const std::chrono::system_clock::time_point getInitTime() const
Definition: PrecedenceRulesGraph.h:754
precedence::StartTime::operator()
std::string operator()(const AlgoProps &props) const
Definition: PrecedenceRulesGraph.h:296
precedence::AlgoProps::AlgoProps
AlgoProps(Algorithm *algo, uint nodeIndex, uint algoIndex, bool inverted, bool allPass)
Definition: PrecedenceRulesGraph.h:61
concurrency::PrecedenceRulesGraph::m_precTrace
precedence::PrecTrace m_precTrace
facilities for algorithm precedence tracing
Definition: PrecedenceRulesGraph.h:805
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
concurrency::AlgorithmNode::setIOBound
void setIOBound(bool value)
Set the I/O-boundness flag.
Definition: PrecedenceRulesGraph.h:576
precedence::CondDataProps::CondDataProps
CondDataProps(const DataObjID &id)
Definition: PrecedenceRulesGraph.h:124
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
precedence::EntityState::operator()
std::string operator()(const AlgoProps &props) const
Definition: PrecedenceRulesGraph.h:228
precedence::AlgoTraceVertex
boost::graph_traits< PrecTrace >::vertex_descriptor AlgoTraceVertex
Definition: PrecedenceRulesGraph.h:56
compareRootHistos.state
state
Definition: compareRootHistos.py:424
DataObjID
Definition: DataObjID.h:37
concurrency::DataNode
Definition: PrecedenceRulesGraph.h:616
precedence::PRVertexDesc
boost::graph_traits< PRGraph >::vertex_descriptor PRVertexDesc
Definition: PrecedenceRulesGraph.h:422
concurrency::PrecedenceRulesGraph::m_initTime
const std::chrono::system_clock::time_point m_initTime
Definition: PrecedenceRulesGraph.h:802
concurrency::AlgorithmNode::m_algoName
std::string m_algoName
The name of the algorithm.
Definition: PrecedenceRulesGraph.h:599
concurrency::AlgorithmNode::getInputDataNodes
const std::vector< DataNode * > & getInputDataNodes() const
Get all consumer nodes.
Definition: PrecedenceRulesGraph.h:563
precedence::CFDecision::m_slot
EventSlot m_slot
Definition: PrecedenceRulesGraph.h:198
gaudirun.output
output
Definition: gaudirun.py:404
concurrency::AlgorithmNode::isOptimist
bool isOptimist() const
Check if positive control flow decision is enforced.
Definition: PrecedenceRulesGraph.h:581
concurrency
Definition: IGraphVisitor.h:4
concurrency::PrecedenceRulesGraph::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: PrecedenceRulesGraph.h:752
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoNodeMap
AlgoNodesMap m_algoNameToAlgoNodeMap
Index: map of algorithm&#39;s name to AlgorithmNode.
Definition: PrecedenceRulesGraph.h:784
concurrency::IGraphVisitor::visit
virtual bool visit(DecisionNode &)
Definition: IGraphVisitor.h:18
concurrency::AlgorithmNode::setRank
void setRank(float &rank)
Set Algorithm rank.
Definition: PrecedenceRulesGraph.h:566
concurrency::DecisionNode::m_children
std::vector< ControlFlowNode * > m_children
All direct daughter nodes in the tree.
Definition: PrecedenceRulesGraph.h:523
precedence::AlgoProps
Definition: PrecedenceRulesGraph.h:59
precedence::EntityState::operator()
std::string operator()(const CondDataProps &props) const
Definition: PrecedenceRulesGraph.h:265
precedence::EntityState::EntityState
EntityState(const EventSlot &slot, SmartIF< ISvcLocator > &svcLocator, bool conditionsEnabled)
Definition: PrecedenceRulesGraph.h:202
precedence::GroupExit::operator()
std::string operator()(const AlgoProps &) const
Definition: PrecedenceRulesGraph.h:157
std::to_string
T to_string(T...args)
precedence::Duration::m_slot
EventSlot m_slot
Definition: PrecedenceRulesGraph.h:401
precedence::VertexName::operator()
std::string operator()(const DecisionHubProps &props) const
Definition: PrecedenceRulesGraph.h:132
precedence::DataProps::DataProps
DataProps(const DataObjID &id)
Definition: PrecedenceRulesGraph.h:118
plotSpeedupsPyRoot.time
time
Definition: plotSpeedupsPyRoot.py:154
concurrency::PrecedenceRulesGraph::printState
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.
Definition: PrecedenceRulesGraph.h:757
concurrency::PrecedenceRulesGraph::m_prec_trace_map
std::map< std::string, precedence::AlgoTraceVertex > m_prec_trace_map
Definition: PrecedenceRulesGraph.h:806
concurrency::AlgorithmNode::m_parents
std::vector< DecisionNode * > m_parents
Control flow parents of an AlgorithmNode (DecisionNodes)
Definition: PrecedenceRulesGraph.h:591
concurrency::ControlFlowNode
Definition: PrecedenceRulesGraph.h:447
precedence::AlgoProps::m_isIOBound
bool m_isIOBound
If an algorithm is blocking.
Definition: PrecedenceRulesGraph.h:84
std
STL namespace.
precedence::EndTime::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:362
concurrency::AlgorithmNode::getOutputDataNodes
const std::vector< DataNode * > & getOutputDataNodes() const
Get all supplier nodes.
Definition: PrecedenceRulesGraph.h:561
TimelineEvent::algorithm
std::string algorithm
Definition: ITimelineSvc.h:18
precedence::AlgoTraceProps
Definition: PrecedenceRulesGraph.h:42
precedence::EndTime::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:359
precedence::AlgoProps::m_algoIndex
int m_algoIndex
Definition: PrecedenceRulesGraph.h:74
concurrency::PrecedenceRulesGraph::m_algoCounter
unsigned int m_algoCounter
Total number of algorithm nodes in the graph.
Definition: PrecedenceRulesGraph.h:796
TimelineEvent::event
uint event
Definition: ITimelineSvc.h:16
precedence::DecisionHubProps::m_allPass
bool m_allPass
Whether always passing regardless of daughter results.
Definition: PrecedenceRulesGraph.h:114
Cause::m_source
source m_source
Definition: PrecedenceRulesGraph.h:429
precedence::DecisionNegation::operator()
std::string operator()(const AlgoProps &props) const
Definition: PrecedenceRulesGraph.h:168
precedence::VertexName::operator()
std::string operator()(const AlgoProps &props) const
Definition: PrecedenceRulesGraph.h:130
concurrency::AlgorithmNode::m_inverted
bool m_inverted
Whether the selection result is negated or not.
Definition: PrecedenceRulesGraph.h:601
concurrency::DecisionNode::m_allPass
bool m_allPass
Whether always passing regardless of daughter results.
Definition: PrecedenceRulesGraph.h:519
precedence::CFDecision::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:196
concurrency::AlgorithmNode::getParentDecisionHubs
const std::vector< DecisionNode * > & getParentDecisionHubs() const
Get all parent decision hubs.
Definition: PrecedenceRulesGraph.h:554
precedence::CFDecision::operator()
std::string operator()(const DecisionHubProps &props) const
Definition: PrecedenceRulesGraph.h:191
TimelineEvent
Definition: ITimelineSvc.h:13
std::map< std::string, precedence::AlgoTraceVertex >
concurrency::AlgorithmNode::isIOBound
bool isIOBound() const
Check if algorithm is I/O-bound.
Definition: PrecedenceRulesGraph.h:578
std::stringstream
STL class.
concurrency::ModeOr
Gaudi::tagged_bool< class ModeOr_tag > ModeOr
Definition: PrecedenceRulesGraph.h:32
concurrency::PrecedenceRulesGraph::~PrecedenceRulesGraph
~PrecedenceRulesGraph() override
Destructor.
Definition: PrecedenceRulesGraph.h:710
precedence::EntityState::operator()
std::string operator()(const DataProps &props) const
Definition: PrecedenceRulesGraph.h:254
precedence::StartTime::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:321
concurrency::IGraphVisitor::visitEnter
virtual bool visitEnter(DecisionNode &) const
Definition: IGraphVisitor.h:17
std::string
STL class.
concurrency::AlgorithmNode::getAlgorithm
Algorithm * getAlgorithm() const
get Algorithm representatives
Definition: PrecedenceRulesGraph.h:571
precedence::StartTime::operator()
std::string operator()(const DecisionHubProps &) const
Definition: PrecedenceRulesGraph.h:316
precedence::AlgoTraceProps::AlgoTraceProps
AlgoTraceProps()
Definition: PrecedenceRulesGraph.h:43
precedence::DataProps::m_id
DataObjID m_id
Definition: PrecedenceRulesGraph.h:120
concurrency::ControlFlowNode::~ControlFlowNode
virtual ~ControlFlowNode()
Destructor.
Definition: PrecedenceRulesGraph.h:456
precedence::AllPass::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:180
concurrency::DecisionNode::m_modeOR
bool m_modeOR
Whether acting as "and" (false) or "or" node (true)
Definition: PrecedenceRulesGraph.h:517
TimelineEvent::end
time_point end
Definition: ITimelineSvc.h:21
precedence::GroupLogic::operator()
std::string operator()(const AlgoProps &) const
Definition: PrecedenceRulesGraph.h:149
precedence::AlgoProps::m_name
std::string m_name
Definition: PrecedenceRulesGraph.h:72
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:79
precedence::Operations::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:410
precedence::Duration::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:402
precedence::Duration::Duration
Duration(const EventSlot &slot, SmartIF< ISvcLocator > &svcLocator)
Definition: PrecedenceRulesGraph.h:366
concurrency::AlgorithmNode::getRank
const float & getRank() const
Get Algorithm rank.
Definition: PrecedenceRulesGraph.h:568
precedence::GroupExit
Definition: PrecedenceRulesGraph.h:156
AlgsExecutionStates
The AlgsExecutionStates encodes the state machine for the execution of algorithms within a single eve...
Definition: AlgsExecutionStates.h:28
concurrency::PrecedenceRulesGraph::m_PRGraph
precedence::PRGraph m_PRGraph
BGL-based graph of precedence rules.
Definition: PrecedenceRulesGraph.h:809
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
concurrency::ControlFlowNode::m_graph
PrecedenceRulesGraph * m_graph
Definition: PrecedenceRulesGraph.h:469
Cause
Definition: PrecedenceRulesGraph.h:426
concurrency::Inverted
Gaudi::tagged_bool< class Inverted_tag > Inverted
Definition: PrecedenceRulesGraph.h:34
precedence::Duration::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:399
concurrency::PrecedenceRulesGraph::enableAnalysis
void enableAnalysis()
BGL-based facilities.
Definition: PrecedenceRulesGraph.h:764
concurrency::DataNode::getPath
const DataObjID & getPath()
Definition: PrecedenceRulesGraph.h:625
concurrency::PrecedenceRulesGraph::m_headNode
DecisionNode * m_headNode
the head node of the control flow graph
Definition: PrecedenceRulesGraph.h:782
concurrency::ControlFlowNode::m_nodeIndex
unsigned int m_nodeIndex
Definition: PrecedenceRulesGraph.h:474
precedence::EndTime::operator()
std::string operator()(const DecisionHubProps &) const
Definition: PrecedenceRulesGraph.h:357
concurrency::DataNode::m_consumers
std::vector< AlgorithmNode * > m_consumers
Definition: PrecedenceRulesGraph.h:656
precedence::EntityState::m_condSvc
SmartIF< ICondSvc > m_condSvc
Definition: PrecedenceRulesGraph.h:278
concurrency::DecisionNode::DecisionNode
DecisionNode(PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name, Concurrent modeConcurrent, PromptDecision modePromptDecision, ModeOr modeOR, AllPass allPass, Inverted isInverted)
Constructor.
Definition: PrecedenceRulesGraph.h:482
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
concurrency::DataNode::accept
virtual bool accept(IGraphVisitor &visitor)
Entry point for a visitor.
Definition: PrecedenceRulesGraph.h:628
concurrency::PrecedenceRulesGraph::m_name
const std::string m_name
Definition: PrecedenceRulesGraph.h:800
std::ostringstream
STL class.
ITimelineSvc.h
concurrency::DecisionNode::getDaughters
const std::vector< ControlFlowNode * > & getDaughters() const
Get children nodes.
Definition: PrecedenceRulesGraph.h:505
CommonMessaging.h
precedence::EndTime::m_slot
EventSlot m_slot
Definition: PrecedenceRulesGraph.h:361
precedence::EndTime::operator()
std::string operator()(const AlgoProps &props) const
Definition: PrecedenceRulesGraph.h:337
precedence::PrecTrace
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoTraceProps > PrecTrace
Definition: PrecedenceRulesGraph.h:55
concurrency::DataNode::getConsumers
const std::vector< AlgorithmNode * > & getConsumers() const
Get all data object consumers.
Definition: PrecedenceRulesGraph.h:648
precedence::EndTime
Definition: PrecedenceRulesGraph.h:324
precedence::EndTime::EndTime
EndTime(const EventSlot &slot, SmartIF< ISvcLocator > &svcLocator)
Definition: PrecedenceRulesGraph.h:325
precedence::Duration::operator()
std::string operator()(const DecisionHubProps &) const
Definition: PrecedenceRulesGraph.h:397
TaggedBool.h
concurrency::IGraphVisitor
Definition: IGraphVisitor.h:12
concurrency::DataNode::DataNode
DataNode(PrecedenceRulesGraph &graph, const DataObjID &path)
Constructor.
Definition: PrecedenceRulesGraph.h:620
precedence::DecisionHubProps::m_modePromptDecision
bool m_modePromptDecision
Whether to evaluate the hub decision ASA its child decisions allow to do that.
Definition: PrecedenceRulesGraph.h:108
precedence::CFDecision::operator()
std::string operator()(const AlgoProps &props) const
Definition: PrecedenceRulesGraph.h:186
precedence::AlgoProps::m_nodeIndex
int m_nodeIndex
Definition: PrecedenceRulesGraph.h:73
ICondSvc
Interface for the Condition Service.
Definition: ICondSvc.h:28
precedence::AlgoProps::m_allPass
bool m_allPass
Whether the selection result is relevant or always "pass".
Definition: PrecedenceRulesGraph.h:82
ITimelineSvc
Definition: ITimelineSvc.h:24
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoOutputsMap
AlgoOutputsMap m_algoNameToAlgoOutputsMap
Definition: PrecedenceRulesGraph.h:791
precedence::VertexName
Definition: PrecedenceRulesGraph.h:129
precedence::AlgoProps::m_inverted
bool m_inverted
Whether the selection result is negated or not.
Definition: PrecedenceRulesGraph.h:80
IHiveWhiteBoard
Definition: IHiveWhiteBoard.h:17
concurrency::PrecedenceRulesGraph::PrecedenceRulesGraph
PrecedenceRulesGraph(const std::string &name, SmartIF< ISvcLocator > svc)
Constructor.
Definition: PrecedenceRulesGraph.h:698
concurrency::Concurrent
Gaudi::tagged_bool< class Concurrent_tag > Concurrent
Definition: PrecedenceRulesGraph.h:30
concurrency::DecisionNode::m_modePromptDecision
bool m_modePromptDecision
Whether to evaluate the hub decision ASA its child decisions allow to do that.
Definition: PrecedenceRulesGraph.h:515
concurrency::AlgorithmNode::m_algorithm
Algorithm * m_algorithm
Algorithm representative behind the AlgorithmNode.
Definition: PrecedenceRulesGraph.h:595
concurrency::DataNode::m_data_object_path
DataObjID m_data_object_path
Definition: PrecedenceRulesGraph.h:654
TimelineEvent::start
time_point start
Definition: ITimelineSvc.h:20
precedence::EntityState
Definition: PrecedenceRulesGraph.h:201
concurrency::ControlFlowNode::m_nodeName
std::string m_nodeName
Definition: PrecedenceRulesGraph.h:475
concurrency::AlgorithmNode::m_rank
float m_rank
Algorithm rank of any kind.
Definition: PrecedenceRulesGraph.h:605
plotSpeedupsPyRoot.graph
graph
Definition: plotSpeedupsPyRoot.py:142
precedence::StartTime
Definition: PrecedenceRulesGraph.h:282
concurrency::PrecedenceRulesGraph
Definition: PrecedenceRulesGraph.h:694
precedence::EntityState::operator()
std::string operator()(const DecisionHubProps &) const
Definition: PrecedenceRulesGraph.h:252
Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:79
precedence::Operations::operator()
std::string operator()(const DecisionHubProps &) const
Definition: PrecedenceRulesGraph.h:408
std::find
T find(T...args)
precedence::EntityState::m_slot
EventSlot m_slot
Definition: PrecedenceRulesGraph.h:275
Gaudi::Functional::m_inputs
std::vector< InputHandle_t< In > > m_inputs
Definition: MergingTransformer.h:45
precedence::Duration::operator()
std::string operator()(const AlgoProps &props) const
Definition: PrecedenceRulesGraph.h:378
std::vector< int >
precedence::DecisionNegation
Definition: PrecedenceRulesGraph.h:167
precedence::EntityState::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Definition: PrecedenceRulesGraph.h:277
concurrency::PromptDecision
Gaudi::tagged_bool< class PromptDecision_tag > PromptDecision
Definition: PrecedenceRulesGraph.h:31
concurrency::AlgorithmNode::m_inputs
std::vector< DataNode * > m_inputs
Algorithm inputs (DataNodes)
Definition: PrecedenceRulesGraph.h:612
IHiveWhiteBoard.h
concurrency::DecisionNode::m_modeConcurrent
bool m_modeConcurrent
Whether all daughters will be evaluated concurrently or sequentially.
Definition: PrecedenceRulesGraph.h:512
time_point
Clock::time_point time_point
Definition: ITimelineSvc.h:11
precedence::CondDataProps
Definition: PrecedenceRulesGraph.h:123
precedence::Operations
Definition: PrecedenceRulesGraph.h:405
TimelineEvent::slot
uint slot
Definition: ITimelineSvc.h:15
concurrency::DataNode::m_producers
std::vector< AlgorithmNode * > m_producers
Definition: PrecedenceRulesGraph.h:655
precedence::StartTime::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:318
precedence::Operations::operator()
std::string operator()(const AlgoProps &props) const
Definition: PrecedenceRulesGraph.h:406
concurrency::ConditionNode
Definition: PrecedenceRulesGraph.h:659
precedence::DecisionNegation::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:172
concurrency::PrecedenceRulesGraph::m_nodeCounter
unsigned int m_nodeCounter
Total number of nodes in the graph.
Definition: PrecedenceRulesGraph.h:794
precedence::AlgoTraceProps::m_name
std::string m_name
Definition: PrecedenceRulesGraph.h:48
EventSlot
Class representing the event slot.
Definition: EventSlot.h:10
concurrency::AllPass
Gaudi::tagged_bool< class AllPass_tag > AllPass
Definition: PrecedenceRulesGraph.h:33
concurrency::IPrecedenceRulesGraph
Definition: PrecedenceRulesGraph.h:690
precedence::GroupExit::operator()
std::string operator()(const DecisionHubProps &props) const
Definition: PrecedenceRulesGraph.h:159
CommonMessaging
Definition: CommonMessaging.h:62
concurrency::AlgorithmNode
Definition: PrecedenceRulesGraph.h:531
MSG::ERROR
Definition: IMessageSvc.h:16
IGraphVisitor.h
concurrency::AlgorithmNode::isLiar
bool isLiar() const
Check if control flow logic is always inverted.
Definition: PrecedenceRulesGraph.h:583
precedence::DecisionHubProps::DecisionHubProps
DecisionHubProps(const std::string &name, uint nodeIndex, concurrency::Concurrent modeConcurrent, concurrency::PromptDecision modePromptDecision, concurrency::ModeOr modeOR, concurrency::AllPass allPass, concurrency::Inverted isInverted)
Definition: PrecedenceRulesGraph.h:88
precedence::GroupLogic
Definition: PrecedenceRulesGraph.h:148
concurrency::DataNode::m_graph
PrecedenceRulesGraph * m_graph
Definition: PrecedenceRulesGraph.h:651
concurrency::AlgorithmNode::AlgorithmNode
AlgorithmNode(PrecedenceRulesGraph &graph, Algorithm *algoPtr, unsigned int nodeIndex, unsigned int algoIndex, bool inverted, bool allPass)
Constructor.
Definition: PrecedenceRulesGraph.h:535
precedence::DecisionHubProps::m_modeOR
bool m_modeOR
Whether acting as "and" (false) or "or" node (true)
Definition: PrecedenceRulesGraph.h:112
concurrency::ControlFlowNode::getNodeName
const std::string & getNodeName() const
Get node name.
Definition: PrecedenceRulesGraph.h:466
MSG::WARNING
Definition: IMessageSvc.h:16
precedence::AlgoProps::AlgoProps
AlgoProps()
Definition: PrecedenceRulesGraph.h:60
concurrency::ControlFlowNode::getNodeIndex
const unsigned int & getNodeIndex() const
Get node index.
Definition: PrecedenceRulesGraph.h:464
precedence::DecisionHubProps::m_modeConcurrent
bool m_modeConcurrent
Whether all daughters will be evaluated concurrently or sequentially.
Definition: PrecedenceRulesGraph.h:105
AlgsExecutionStates.h
precedence::AllPass
Definition: PrecedenceRulesGraph.h:175
precedence::DecisionHubProps
Definition: PrecedenceRulesGraph.h:87
precedence::GroupMode::operator()
std::string operator()(const DecisionHubProps &props) const
Definition: PrecedenceRulesGraph.h:140
AlgsExecutionStates::State
State
Execution states of the algorithms.
Definition: AlgsExecutionStates.h:32
DataObjID::fullKey
std::string fullKey() const
Definition: DataObjID.cpp:54
ICondSvc.h
std::ostream
STL class.
concurrency::ConditionNode::accept
bool accept(IGraphVisitor &visitor) override
Need to hide the (identical) base method with this one so that visitEnter(ConditionNode&) and visit(C...
Definition: PrecedenceRulesGraph.h:671
precedence::GroupMode::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:145
concurrency::PrecedenceRulesGraph::name
const std::string & name() const override
Retrieve name of the service.
Definition: PrecedenceRulesGraph.h:750
concurrency::AlgorithmNode::m_isIOBound
bool m_isIOBound
If an algorithm is blocking.
Definition: PrecedenceRulesGraph.h:607
precedence::StartTime::StartTime
StartTime(const EventSlot &slot, SmartIF< ISvcLocator > &svcLocator)
Definition: PrecedenceRulesGraph.h:283
precedence::AllPass::operator()
std::string operator()(const DecisionHubProps &props) const
Definition: PrecedenceRulesGraph.h:178
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
precedence::GroupMode::operator()
std::string operator()(const AlgoProps &) const
Definition: PrecedenceRulesGraph.h:138
EventSlot.h
precedence::VertexName::operator()
std::string operator()(const DataProps &props) const
Definition: PrecedenceRulesGraph.h:134
Cause::m_sourceName
std::string m_sourceName
Definition: PrecedenceRulesGraph.h:430
concurrency::AlgorithmNode::m_allPass
bool m_allPass
Whether the selection result is relevant or always "pass".
Definition: PrecedenceRulesGraph.h:603
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoInputsMap
AlgoInputsMap m_algoNameToAlgoInputsMap
Indexes: maps of algorithm&#39;s name to algorithm&#39;s inputs/outputs.
Definition: PrecedenceRulesGraph.h:790
concurrency::DataNode::addProducerNode
void addProducerNode(AlgorithmNode *node)
Add relationship to producer AlgorithmNode.
Definition: PrecedenceRulesGraph.h:634
concurrency::DataNode::getProducers
const std::vector< AlgorithmNode * > & getProducers() const
Get all data object producers.
Definition: PrecedenceRulesGraph.h:646
concurrency::PrecedenceRulesGraph::m_dataPathToDataNodeMap
DataNodesMap m_dataPathToDataNodeMap
Index: map of data path to DataNode.
Definition: PrecedenceRulesGraph.h:788
concurrency::PrecedenceRulesGraph::getControlFlowNodeCounter
unsigned int getControlFlowNodeCounter() const
Get total number of control flow graph nodes.
Definition: PrecedenceRulesGraph.h:744
precedence::GroupExit::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:164
DataObject.h
precedence::VariantVertexProps
boost::variant< AlgoProps, DecisionHubProps, DataProps, CondDataProps > VariantVertexProps
Definition: PrecedenceRulesGraph.h:420
Gaudi.Configuration.log
log
Definition: Configuration.py:13
precedence::DataProps
Definition: PrecedenceRulesGraph.h:117
concurrency::ConditionNode::m_condSvc
SmartIF< ICondSvc > m_condSvc
Definition: PrecedenceRulesGraph.h:679
precedence::DecisionHubProps::m_nodeIndex
uint m_nodeIndex
Definition: PrecedenceRulesGraph.h:102
concurrency::PrecedenceRulesGraph::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
Definition: PrecedenceRulesGraph.h:799
concurrency::ConditionNode::ConditionNode
ConditionNode(PrecedenceRulesGraph &graph, const DataObjID &path, SmartIF< ICondSvc > condSvc)
Constructor.
Definition: PrecedenceRulesGraph.h:663
precedence::StartTime::m_slot
EventSlot m_slot
Definition: PrecedenceRulesGraph.h:320
std::unordered_map< std::string, AlgorithmNode * >
precedence::DecisionHubProps::m_name
std::string m_name
Definition: PrecedenceRulesGraph.h:101
concurrency::PrecedenceRulesGraph::getHeadNode
DecisionNode * getHeadNode() const
Get head node.
Definition: PrecedenceRulesGraph.h:734
precedence::GroupLogic::operator()
std::string operator()(const DataProps &) const
Definition: PrecedenceRulesGraph.h:153
precedence::CFDecision::CFDecision
CFDecision(const EventSlot &slot)
Definition: PrecedenceRulesGraph.h:184
concurrency::DataNode::addConsumerNode
void addConsumerNode(AlgorithmNode *node)
Add relationship to consumer AlgorithmNode.
Definition: PrecedenceRulesGraph.h:640
concurrency::PrecedenceRulesGraph::m_decisionNameToDecisionHubMap
DecisionHubsMap m_decisionNameToDecisionHubMap
Index: map of decision&#39;s name to DecisionHub.
Definition: PrecedenceRulesGraph.h:786