| The Gaudi Framework v30r0 (c919700c)

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

- File List
- File Members

PrecedenceSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_PRECEDENCESVC_H_
2 #define GAUDIHIVE_PRECEDENCESVC_H_
3
4 #include "IPrecedenceSvc.h"
5 #include "PrecedenceRulesGraph.h"
6
7 // Framework include files
8 #include "GaudiKernel/IAlgResourcePool.h"
9 #include "GaudiKernel/Service.h"
10
11 #include <boost/filesystem.hpp>
12
21 class PrecedenceSvc : public extends<Service, IPrecedenceSvc>
22 {
23
24 public:
26 PrecedenceSvc( const std::string& name, ISvcLocator* svc );
27
29 ~PrecedenceSvc() = default;
30
32 StatusCode initialize() override;
33
35 StatusCode finalize() override;
36
38 StatusCode iterate( EventSlot&, const Cause& ) override;
39
41 StatusCode simulate( EventSlot& ) const override;
42
44 bool CFRulesResolved( EventSlot& ) const override;
45
47 uint getPriority( const std::string& name ) const override
48 {
49 return (int)m_PRGraph.getAlgorithmNode( name )->getRank();
50 }
51
53 bool isBlocking( const std::string& name ) const override { return m_PRGraph.getAlgorithmNode( name )->isIOBound(); }
54
56 void dumpControlFlow() const override;
57 void dumpDataFlow() const override;
58 const std::string printState( EventSlot& ) const override;
59
62 void dumpPrecedenceRules( EventSlot& ) override;
65 void dumpPrecedenceTrace( EventSlot& ) override;
66
68 const concurrency::PrecedenceRulesGraph* getRules() const { return &m_PRGraph; };
69
70 private:
71 StatusCode assembleCFRules( Algorithm*, const std::string&, unsigned int recursionDepth = 0 );
72
73 private:
75 SmartIF<IAlgResourcePool> m_algResourcePool;
77 concurrency::PrecedenceRulesGraph m_PRGraph{"PrecedenceRulesGraph", serviceLocator()};
79 Gaudi::Property<std::string> m_mode{this, "TaskPriorityRule", "", "Task avalanche induction strategy."};
81 Gaudi::Property<bool> m_ignoreDFRules{this, "IgnoreDFRules", false, "Ignore the data flow rules."};
83 boost::filesystem::path m_dumpDirName{
84 boost::filesystem::unique_path( boost::filesystem::path( "precedence.analysis.%%%%" ) )};
85 Gaudi::Property<bool> m_dumpPrecTrace{this, "DumpPrecedenceTrace", false,
86 "Dump task precedence traces for each event."
87 "The service must be in DEBUG mode for this switch "
88 "to have effect."};
89 Gaudi::Property<std::string> m_dumpPrecTraceFile{
90 this, "PrecedenceTraceFile", "", "Override default name of the GRAPHML trace file. NOTE: if more than "
91 "1 event is processed, the setting forces creation of a single file "
92 "with cumulative precedence trace."};
93 Gaudi::Property<bool> m_dumpPrecRules{this, "DumpPrecedenceRules", false, "Dump task precedence rules. The service "
94 "must be in DEBUG mode for this switch "
95 "to have effect."};
96 Gaudi::Property<std::string> m_dumpPrecRulesFile{this, "PrecedenceRulesFile", "",
97 "Override default name of the GRAPHML precedence rules file."};
98 };
99
100 #endif /* GAUDIHIVE_PRECEDENCESVC_H_ */
PrecedenceSvc::getRules
const concurrency::PrecedenceRulesGraph * getRules() const
Precedence rules accessor.
Definition: PrecedenceSvc.h:68
PrecedenceSvc::m_dumpPrecTrace
Gaudi::Property< bool > m_dumpPrecTrace
Definition: PrecedenceSvc.h:85
PrecedenceSvc::m_PRGraph
concurrency::PrecedenceRulesGraph m_PRGraph
Graph of precedence rules.
Definition: PrecedenceSvc.h:77
SmartIF< IAlgResourcePool >
PrecedenceSvc::dumpPrecedenceRules
void dumpPrecedenceRules(EventSlot &) override
Dump precedence rules (available only in DEBUG mode, and must be enabled with the corresponding servi...
Definition: PrecedenceSvc.cpp:276
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
PrecedenceSvc::dumpDataFlow
void dumpDataFlow() const override
Definition: PrecedenceSvc.cpp:260
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
PrecedenceSvc::PrecedenceSvc
PrecedenceSvc(const std::string &name, ISvcLocator *svc)
Constructor.
Definition: PrecedenceSvc.cpp:18
PrecedenceSvc::assembleCFRules
StatusCode assembleCFRules(Algorithm *, const std::string &, unsigned int recursionDepth=0)
Definition: PrecedenceSvc.cpp:110
PrecedenceSvc
A service to resolve the task execution precedence.
Definition: PrecedenceSvc.h:21
IAlgResourcePool.h
PrecedenceSvc::~PrecedenceSvc
~PrecedenceSvc()=default
Destructor.
PrecedenceSvc::m_dumpDirName
boost::filesystem::path m_dumpDirName
Precedence analysis facilities.
Definition: PrecedenceSvc.h:83
IPrecedenceSvc.h
concurrency::PrecedenceRulesGraph::getAlgorithmNode
AlgorithmNode * getAlgorithmNode(const std::string &algoName) const
Get the AlgorithmNode from by algorithm name using graph index.
Definition: PrecedenceRulesGraph.cpp:305
concurrency::AlgorithmNode::isIOBound
bool isIOBound() const
Check if algorithm is I/O-bound.
Definition: PrecedenceRulesGraph.h:578
PrecedenceSvc::m_ignoreDFRules
Gaudi::Property< bool > m_ignoreDFRules
Scheduling strategy.
Definition: PrecedenceSvc.h:81
PrecedenceSvc::iterate
StatusCode iterate(EventSlot &, const Cause &) override
Infer the precedence effect caused by an execution flow event.
Definition: PrecedenceSvc.cpp:178
std::string
STL class.
Service.h
PrecedenceSvc::m_dumpPrecRulesFile
Gaudi::Property< std::string > m_dumpPrecRulesFile
Definition: PrecedenceSvc.h:96
PrecedenceSvc::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
A shortcut to the algorithm resource pool.
Definition: PrecedenceSvc.h:75
concurrency::AlgorithmNode::getRank
const float & getRank() const
Get Algorithm rank.
Definition: PrecedenceRulesGraph.h:568
PrecedenceSvc::getPriority
uint getPriority(const std::string &name) const override
Get priority of an algorithm.
Definition: PrecedenceSvc.h:47
Cause
Definition: PrecedenceRulesGraph.h:426
PrecedenceSvc::finalize
StatusCode finalize() override
Finalize.
Definition: PrecedenceSvc.cpp:333
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
PrecedenceSvc::m_mode
Gaudi::Property< std::string > m_mode
Scheduling strategy.
Definition: PrecedenceSvc.h:79
PrecedenceSvc::dumpPrecedenceTrace
void dumpPrecedenceTrace(EventSlot &) override
Dump precedence trace (available only in DEBUG mode, and must be enabled with the corresponding servi...
Definition: PrecedenceSvc.cpp:304
PrecedenceSvc::CFRulesResolved
bool CFRulesResolved(EventSlot &) const override
Check if the root CF decision is resolved.
Definition: PrecedenceSvc.cpp:247
PrecedenceSvc::simulate
StatusCode simulate(EventSlot &) const override
Simulate execution flow.
Definition: PrecedenceSvc.cpp:200
concurrency::PrecedenceRulesGraph
Definition: PrecedenceRulesGraph.h:694
Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:79
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
PrecedenceSvc::m_dumpPrecRules
Gaudi::Property< bool > m_dumpPrecRules
Definition: PrecedenceSvc.h:93
EventSlot
Class representing the event slot.
Definition: EventSlot.h:10
PrecedenceSvc::isBlocking
bool isBlocking(const std::string &name) const override
Check if a task is CPU-blocking.
Definition: PrecedenceSvc.h:53
PrecedenceSvc::m_dumpPrecTraceFile
Gaudi::Property< std::string > m_dumpPrecTraceFile
Definition: PrecedenceSvc.h:89
PrecedenceSvc::printState
const std::string printState(EventSlot &) const override
Definition: PrecedenceSvc.cpp:267
PrecedenceSvc::dumpControlFlow
void dumpControlFlow() const override
Dump precedence rules.
Definition: PrecedenceSvc.cpp:253
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
PrecedenceRulesGraph.h
PrecedenceSvc::initialize
StatusCode initialize() override
Initialize.
Definition: PrecedenceSvc.cpp:23