| The Gaudi Framework v28r2-patches (bc4ad17a)

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

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

Public Member Functions | List of all members
concurrency::RankerByCummulativeOutDegree Class Reference

`#include <src/PRGraphVisitors.h>`

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

## Public Member Functions
| RankerByCummulativeOutDegree ()
| Constructor. More...
| ~RankerByCummulativeOutDegree () override
| Destructor. More...
bool | visitEnter (DecisionNode &) const override
bool | visit (DecisionNode &) override
bool | visitLeave (DecisionNode &) const override
bool | visitEnter (AlgorithmNode &) const override
bool | visit (AlgorithmNode &node) override
void | reset () override
void | runThroughAdjacents (boost::graph_traits< boost::ExecPlan >::vertex_descriptor vertex, boost::ExecPlan graph)
Public Member Functions inherited from concurrency::IGraphVisitor
virtual | ~IGraphVisitor ()

## Additional Inherited Members
Public Attributes inherited from concurrency::IGraphVisitor
int | m_nodesSucceeded
int | m_slotNum

## Detailed Description

Definition at line 117 of file PRGraphVisitors.h.

## Constructor & Destructor Documentation

concurrency::RankerByCummulativeOutDegree::RankerByCummulativeOutDegree | ( |  | ) |
| inline

Constructor.

Definition at line 120 of file PRGraphVisitors.h.

120 {
121 m_nodesSucceeded = 0;
122 m_slotNum = -1;
123 };
concurrency::IGraphVisitor::m_slotNum
int m_slotNum
Definition: IGraphVisitor.h:24
concurrency::IGraphVisitor::m_nodesSucceeded
int m_nodesSucceeded
Definition: IGraphVisitor.h:23

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

Destructor.

Definition at line 125 of file PRGraphVisitors.h.

125 {}

## Member Function Documentation

void concurrency::RankerByCummulativeOutDegree::reset | ( |  | ) |
| inline override virtual

Implements concurrency::IGraphVisitor.

Definition at line 139 of file PRGraphVisitors.h.

139 { m_nodesSucceeded = 0; }
concurrency::IGraphVisitor::m_nodesSucceeded
int m_nodesSucceeded
Definition: IGraphVisitor.h:23

void concurrency::RankerByCummulativeOutDegree::runThroughAdjacents | ( | boost::graph_traits< boost::ExecPlan >::vertex_descriptor | vertex,
|  | boost::ExecPlan | graph
| ) |  |

Definition at line 291 of file PRGraphVisitors.cpp.

292 {
293 typename boost::graph_traits<boost::ExecPlan>::adjacency_iterator itVB;
294 typename boost::graph_traits<boost::ExecPlan>::adjacency_iterator itVE;
295
296 for (boost::tie(itVB, itVE) = adjacent_vertices(vertex, graph); itVB != itVE; ++itVB) {
297 m_nodesSucceeded += 1;
298 runThroughAdjacents(*itVB, graph);
299 }
300
301 }
plotSpeedupsPyRoot.graph
graph
Definition: plotSpeedupsPyRoot.py:134
concurrency::RankerByCummulativeOutDegree::runThroughAdjacents
void runThroughAdjacents(boost::graph_traits< boost::ExecPlan >::vertex_descriptor vertex, boost::ExecPlan graph)
Definition: PRGraphVisitors.cpp:291
concurrency::IGraphVisitor::m_nodesSucceeded
int m_nodesSucceeded
Definition: IGraphVisitor.h:23

bool concurrency::RankerByCummulativeOutDegree::visit | ( | DecisionNode & |  | ) |
| inline override virtual

Implements concurrency::IGraphVisitor.

Definition at line 129 of file PRGraphVisitors.h.

129 {return true;}

bool concurrency::RankerByCummulativeOutDegree::visit | ( | AlgorithmNode & | node | ) |
| override virtual

Implements concurrency::IGraphVisitor.

Definition at line 256 of file PRGraphVisitors.cpp.

256 {
257
258 std::ifstream myfile;
259 myfile.open("InputExecutionPlan.graphml", std::ios::in);
260
261 boost::ExecPlan execPlan;
262
263 boost::dynamic_properties dp;
264 dp.property("name", boost::get(&boost::AlgoNodeStruct::m_name, execPlan));
265 dp.property("index", boost::get(&boost::AlgoNodeStruct::m_index, execPlan));
266 dp.property("dataRank", boost::get(&boost::AlgoNodeStruct::m_rank, execPlan));
267 dp.property("runtime", boost::get(&boost::AlgoNodeStruct::m_runtime, execPlan));
268
269 boost::read_graphml(myfile, execPlan, dp);
270
271 typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
272 std::pair<itV, itV> vp;
273 typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor AlgoVertex;
274
275 for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
276 AlgoVertex v = *vp.first;
277 auto index = boost::get(&boost::AlgoNodeStruct::m_name, execPlan);
278 if (index[v] == node.getNodeName()) {
279 runThroughAdjacents(v,execPlan);
280 float rank = m_nodesSucceeded;
281 node.setRank(rank);
282 reset();
283 //std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
284 }
285 }
286
287 return true;
288 }
boost::AlgoNodeStruct::m_index
int m_index
Definition: PrecedenceRulesGraph.h:31
std::ifstream::open
T open(T...args)
boost::ExecPlan
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoNodeStruct > ExecPlan
Definition: PrecedenceRulesGraph.h:37
boost::AlgoNodeStruct::m_rank
int m_rank
Definition: PrecedenceRulesGraph.h:32
concurrency::RankerByCummulativeOutDegree::reset
void reset() override
Definition: PRGraphVisitors.h:139
boost::AlgoNodeStruct::m_runtime
double m_runtime
Definition: PrecedenceRulesGraph.h:33
boost::AlgoVertex
graph_traits< ExecPlan >::vertex_descriptor AlgoVertex
Definition: PrecedenceRulesGraph.h:38
boost::AlgoNodeStruct::m_name
std::string m_name
Definition: PrecedenceRulesGraph.h:30
std::pair
GaudiPython.Persistency.get
def get(type_)
Definition: Persistency.py:23
concurrency::RankerByCummulativeOutDegree::runThroughAdjacents
void runThroughAdjacents(boost::graph_traits< boost::ExecPlan >::vertex_descriptor vertex, boost::ExecPlan graph)
Definition: PRGraphVisitors.cpp:291
concurrency::IGraphVisitor::m_nodesSucceeded
int m_nodesSucceeded
Definition: IGraphVisitor.h:23
std::ifstream
STL class.

bool concurrency::RankerByCummulativeOutDegree::visitEnter | ( | DecisionNode & |  | ) | const
| inline override virtual

Implements concurrency::IGraphVisitor.

Definition at line 127 of file PRGraphVisitors.h.

127 {return true;}

bool concurrency::RankerByCummulativeOutDegree::visitEnter | ( | AlgorithmNode & |  | ) | const
| inline override virtual

Implements concurrency::IGraphVisitor.

Definition at line 134 of file PRGraphVisitors.h.

134 {return true;}

bool concurrency::RankerByCummulativeOutDegree::visitLeave | ( | DecisionNode & |  | ) | const
| inline override virtual

Implements concurrency::IGraphVisitor.

Definition at line 131 of file PRGraphVisitors.h.

131 {return true;}

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

- GaudiHive/src/PRGraphVisitors.h
- GaudiHive/src/PRGraphVisitors.cpp