| The Gaudi Framework v28r2p1 (f1a77ff4)

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

- File List
- File Members

PRGraphVisitors.h
Go to the documentation of this file.
1 #ifndef PRGRAPHVISITORS_H_
2 #define PRGRAPHVISITORS_H_
3
4 #include "IGraphVisitor.h"
5 #include "PrecedenceRulesGraph.h"
6
7 namespace concurrency {
8
9 class RunSimulator : public IGraphVisitor {
10 public:
12 RunSimulator(const int& slotNum) {
13 m_nodesSucceeded = 0;
14 m_slotNum = slotNum;
15 };
17 ~RunSimulator() override {}
18
19 bool visitEnter(DecisionNode& node) const override;
20
21 bool visit(DecisionNode& node) override;
22
23 bool visitLeave(DecisionNode& node) const override;
24
25
26 bool visitEnter(AlgorithmNode& node) const override;
27
28 bool visit(AlgorithmNode& node) override;
29
30
31 void reset() override { m_nodesSucceeded = 0; }
32
33 };
34
38 class Trigger : public IGraphVisitor {
39 public:
41 Trigger(const int& slotNum) {
42 m_nodesSucceeded = 0;
43 m_slotNum = slotNum;
44 };
46 ~Trigger() override {}
47
48 bool visitEnter(DecisionNode& node) const override;
49
50 bool visit(DecisionNode& node) override;
51
52 bool visitLeave(DecisionNode& /*node*/) const override {return true;};
53
54
55 bool visitEnter(AlgorithmNode& node) const override;
56
57 bool visit(AlgorithmNode& node) override;
58
59
60 void reset() override { m_nodesSucceeded = 0; }
61
62 };
63
64
65 class Supervisor : public IGraphVisitor {
66 public:
68 Supervisor(const int& slotNum) {
69 m_nodesSucceeded = 0;
70 m_slotNum = slotNum;
71 };
73 ~Supervisor() override {}
74
75 bool visitEnter(DecisionNode& node) const override;
76
77 bool visit(DecisionNode& node) override;
78
79 bool visitLeave(DecisionNode& /*node*/) const override {return true;};
80
81
82 bool visitEnter(AlgorithmNode& node) const override;
83
84 bool visit(AlgorithmNode& node) override;
85
86
87 void reset() override { m_nodesSucceeded = 0; }
88
89 };
90
91 class RankerByProductConsumption : public IGraphVisitor {
92 public:
94 RankerByProductConsumption() {
95 m_nodesSucceeded = 0;
96 m_slotNum = -1;
97 };
99 ~RankerByProductConsumption() override {}
100
101 bool visitEnter(DecisionNode&) const override {return true;}
102
103 bool visit(DecisionNode&) override {return true;}\
104
105 bool visitLeave(DecisionNode&) const override {return true;}
106
107
108 bool visitEnter(AlgorithmNode&) const override {return true;}
109
110 bool visit(AlgorithmNode& node) override;
111
112
113 void reset() override { m_nodesSucceeded = 0; }
114
115 };
116
117 class RankerByCummulativeOutDegree : public IGraphVisitor {
118 public:
120 RankerByCummulativeOutDegree() {
121 m_nodesSucceeded = 0;
122 m_slotNum = -1;
123 };
125 ~RankerByCummulativeOutDegree() override {}
126
127 bool visitEnter(DecisionNode&) const override {return true;}
128
129 bool visit(DecisionNode&) override {return true;}
130
131 bool visitLeave(DecisionNode&) const override {return true;}
132
133
134 bool visitEnter(AlgorithmNode&) const override {return true;}
135
136 bool visit(AlgorithmNode& node) override;
137
138
139 void reset() override { m_nodesSucceeded = 0; }
140
141 void runThroughAdjacents(boost::graph_traits<boost::ExecPlan>::vertex_descriptor vertex, boost::ExecPlan graph);
142
143 };
144
145 class RankerByTiming : public IGraphVisitor {
146 public:
148 RankerByTiming() {
149 m_nodesSucceeded = 0;
150 m_slotNum = -1;
151 };
153 ~RankerByTiming() override {}
154
155 bool visitEnter(DecisionNode&) const override {return true;}
156
157 bool visit(DecisionNode&) override {return true;}
158
159 bool visitLeave(DecisionNode&) const override {return true;}
160
161
162 bool visitEnter(AlgorithmNode&) const override {return true;}
163
164 bool visit(AlgorithmNode& node) override;
165
166
167 void reset() override { m_nodesSucceeded = 0; }
168
169 };
170
171 class RankerByEccentricity : public IGraphVisitor {
172 public:
174 RankerByEccentricity() {
175 m_nodesSucceeded = 0;
176 m_slotNum = -1;
177 };
179 ~RankerByEccentricity() override {}
180
181 bool visitEnter(DecisionNode&) const override {return true;}
182
183 bool visit(DecisionNode&) override {return true;}
184
185 bool visitLeave(DecisionNode&) const override {return true;}
186
187
188 bool visitEnter(AlgorithmNode&) const override {return true;}
189
190 bool visit(AlgorithmNode& node) override;
191
192
193 void reset() override { m_nodesSucceeded = 0; }
194
195 };
196
197 class RankerByDataRealmEccentricity : public IGraphVisitor {
198 public:
200 RankerByDataRealmEccentricity() {
201 m_nodesSucceeded = 0;
202 m_slotNum = -1;
203 m_currentDepth = 0;
204 m_maxKnownDepth = 0;
205 };
207 ~RankerByDataRealmEccentricity() override {}
208
209 bool visitEnter(DecisionNode&) const override {return true;}
210
211 bool visit(DecisionNode&) override {return true;}
212
213 bool visitLeave(DecisionNode&) const override {return true;}
214
215
216 bool visitEnter(AlgorithmNode&) const override {return true;}
217
218 bool visit(AlgorithmNode& node) override;
219
220
221 void reset() override {
222 m_nodesSucceeded = 0;
223 m_currentDepth = 0;
224 m_maxKnownDepth = 0;
225 }
226
229 void recursiveVisit(AlgorithmNode& node);
230
231 uint m_currentDepth;
232 uint m_maxKnownDepth;
233
234 };
235
236 }
237
238
239
240 #endif /* PRGRAPHVISITORS_H_ */
concurrency::DecisionNode
Definition: PrecedenceRulesGraph.h:86
concurrency::RankerByCummulativeOutDegree::~RankerByCummulativeOutDegree
~RankerByCummulativeOutDegree() override
Destructor.
Definition: PRGraphVisitors.h:125
concurrency::RunSimulator::reset
void reset() override
Definition: PRGraphVisitors.h:31
concurrency::RunSimulator
Definition: PRGraphVisitors.h:9
concurrency::RankerByDataRealmEccentricity::visitLeave
bool visitLeave(DecisionNode &) const override
Definition: PRGraphVisitors.h:213
boost::ExecPlan
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoNodeStruct > ExecPlan
Definition: PrecedenceRulesGraph.h:37
concurrency::RankerByTiming::visitEnter
bool visitEnter(AlgorithmNode &) const override
Definition: PRGraphVisitors.h:162
concurrency
Definition: ExecutionFlowManager.cpp:3
concurrency::RankerByProductConsumption::visitEnter
bool visitEnter(AlgorithmNode &) const override
Definition: PRGraphVisitors.h:108
concurrency::RankerByDataRealmEccentricity::m_currentDepth
uint m_currentDepth
Definition: PRGraphVisitors.h:231
concurrency::RankerByDataRealmEccentricity::reset
void reset() override
Definition: PRGraphVisitors.h:221
concurrency::Supervisor::visitLeave
bool visitLeave(DecisionNode &) const override
Definition: PRGraphVisitors.h:79
concurrency::RunSimulator::RunSimulator
RunSimulator(const int &slotNum)
Constructor.
Definition: PRGraphVisitors.h:12
concurrency::RankerByTiming::visit
bool visit(DecisionNode &) override
Definition: PRGraphVisitors.h:157
concurrency::RankerByCummulativeOutDegree::visitLeave
bool visitLeave(DecisionNode &) const override
Definition: PRGraphVisitors.h:131
concurrency::RankerByProductConsumption::visit
bool visit(DecisionNode &) override
Definition: PRGraphVisitors.h:103
concurrency::Trigger
A visitor, performing full top-down traversals of a graph.
Definition: PRGraphVisitors.h:38
concurrency::RankerByProductConsumption::visitLeave
bool visitLeave(DecisionNode &) const override
Definition: PRGraphVisitors.h:105
concurrency::RankerByCummulativeOutDegree::reset
void reset() override
Definition: PRGraphVisitors.h:139
concurrency::Supervisor::reset
void reset() override
Definition: PRGraphVisitors.h:87
concurrency::Trigger::visitLeave
bool visitLeave(DecisionNode &) const override
Definition: PRGraphVisitors.h:52
concurrency::RankerByEccentricity::~RankerByEccentricity
~RankerByEccentricity() override
Destructor.
Definition: PRGraphVisitors.h:179
concurrency::RankerByProductConsumption::visitEnter
bool visitEnter(DecisionNode &) const override
Definition: PRGraphVisitors.h:101
concurrency::RankerByCummulativeOutDegree::RankerByCummulativeOutDegree
RankerByCummulativeOutDegree()
Constructor.
Definition: PRGraphVisitors.h:120
concurrency::RankerByEccentricity::reset
void reset() override
Definition: PRGraphVisitors.h:193
concurrency::RankerByDataRealmEccentricity::~RankerByDataRealmEccentricity
~RankerByDataRealmEccentricity() override
Destructor.
Definition: PRGraphVisitors.h:207
concurrency::RankerByProductConsumption::reset
void reset() override
Definition: PRGraphVisitors.h:113
concurrency::Trigger::~Trigger
~Trigger() override
Destructor.
Definition: PRGraphVisitors.h:46
concurrency::RunSimulator::visitEnter
bool visitEnter(DecisionNode &node) const override
Definition: PRGraphVisitors.cpp:6
concurrency::RankerByTiming
Definition: PRGraphVisitors.h:145
concurrency::RankerByDataRealmEccentricity
Definition: PRGraphVisitors.h:197
concurrency::RankerByTiming::visitLeave
bool visitLeave(DecisionNode &) const override
Definition: PRGraphVisitors.h:159
concurrency::IGraphVisitor::m_slotNum
int m_slotNum
Definition: IGraphVisitor.h:24
concurrency::RankerByDataRealmEccentricity::visitEnter
bool visitEnter(AlgorithmNode &) const override
Definition: PRGraphVisitors.h:216
concurrency::RankerByDataRealmEccentricity::visitEnter
bool visitEnter(DecisionNode &) const override
Definition: PRGraphVisitors.h:209
concurrency::RankerByEccentricity::RankerByEccentricity
RankerByEccentricity()
Constructor.
Definition: PRGraphVisitors.h:174
concurrency::RankerByCummulativeOutDegree::visitEnter
bool visitEnter(AlgorithmNode &) const override
Definition: PRGraphVisitors.h:134
concurrency::RankerByEccentricity
Definition: PRGraphVisitors.h:171
concurrency::IGraphVisitor
Definition: IGraphVisitor.h:9
concurrency::RunSimulator::visitLeave
bool visitLeave(DecisionNode &node) const override
Definition: PRGraphVisitors.cpp:38
concurrency::RankerByTiming::RankerByTiming
RankerByTiming()
Constructor.
Definition: PRGraphVisitors.h:148
plotSpeedupsPyRoot.graph
graph
Definition: plotSpeedupsPyRoot.py:134
concurrency::RankerByCummulativeOutDegree::visit
bool visit(DecisionNode &) override
Definition: PRGraphVisitors.h:129
concurrency::RankerByEccentricity::visitEnter
bool visitEnter(AlgorithmNode &) const override
Definition: PRGraphVisitors.h:188
concurrency::RankerByEccentricity::visitLeave
bool visitLeave(DecisionNode &) const override
Definition: PRGraphVisitors.h:185
concurrency::RankerByEccentricity::visit
bool visit(DecisionNode &) override
Definition: PRGraphVisitors.h:183
concurrency::RankerByProductConsumption
Definition: PRGraphVisitors.h:91
concurrency::IGraphVisitor::m_nodesSucceeded
int m_nodesSucceeded
Definition: IGraphVisitor.h:23
concurrency::RankerByDataRealmEccentricity::m_maxKnownDepth
uint m_maxKnownDepth
Definition: PRGraphVisitors.h:232
concurrency::Trigger::reset
void reset() override
Definition: PRGraphVisitors.h:60
concurrency::RankerByCummulativeOutDegree::visitEnter
bool visitEnter(DecisionNode &) const override
Definition: PRGraphVisitors.h:127
concurrency::Supervisor::~Supervisor
~Supervisor() override
Destructor.
Definition: PRGraphVisitors.h:73
concurrency::AlgorithmNode
Definition: PrecedenceRulesGraph.h:140
IGraphVisitor.h
concurrency::Supervisor
Definition: PRGraphVisitors.h:65
concurrency::Trigger::Trigger
Trigger(const int &slotNum)
Constructor.
Definition: PRGraphVisitors.h:41
concurrency::RankerByProductConsumption::~RankerByProductConsumption
~RankerByProductConsumption() override
Destructor.
Definition: PRGraphVisitors.h:99
concurrency::RunSimulator::~RunSimulator
~RunSimulator() override
Destructor.
Definition: PRGraphVisitors.h:17
concurrency::RankerByDataRealmEccentricity::RankerByDataRealmEccentricity
RankerByDataRealmEccentricity()
Constructor.
Definition: PRGraphVisitors.h:200
concurrency::RankerByEccentricity::visitEnter
bool visitEnter(DecisionNode &) const override
Definition: PRGraphVisitors.h:181
concurrency::RankerByTiming::visitEnter
bool visitEnter(DecisionNode &) const override
Definition: PRGraphVisitors.h:155
concurrency::RankerByDataRealmEccentricity::visit
bool visit(DecisionNode &) override
Definition: PRGraphVisitors.h:211
concurrency::RankerByProductConsumption::RankerByProductConsumption
RankerByProductConsumption()
Constructor.
Definition: PRGraphVisitors.h:94
concurrency::Supervisor::Supervisor
Supervisor(const int &slotNum)
Constructor.
Definition: PRGraphVisitors.h:68
PrecedenceRulesGraph.h
concurrency::RankerByTiming::~RankerByTiming
~RankerByTiming() override
Destructor.
Definition: PRGraphVisitors.h:153
concurrency::RankerByCummulativeOutDegree
Definition: PRGraphVisitors.h:117
concurrency::RankerByTiming::reset
void reset() override
Definition: PRGraphVisitors.h:167
concurrency::RunSimulator::visit
bool visit(DecisionNode &node) override
Definition: PRGraphVisitors.cpp:14