| The Gaudi Framework v32r1 (f65d50dc)

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

`#include <src/PRGraph/Visitors/Rankers.h>`

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

## Public Member Functions
bool | visit (AlgorithmNode &) override
void | reset () override
void | runThroughAdjacents (boost::graph_traits< precedence::PrecTrace >::vertex_descriptor, precedence::PrecTrace)
virtual bool | visit (DecisionNode &)
virtual bool | visit (AlgorithmNode &)
virtual bool | visit (DataNode &)
virtual bool | visit (ConditionNode &)
Public Member Functions inherited from concurrency::IGraphVisitor
virtual | ~IGraphVisitor ()=default
virtual bool | visitEnter (DecisionNode &) const
virtual bool | visit (DecisionNode &)
virtual bool | visitEnter (AlgorithmNode &) const
virtual bool | visitEnter (DataNode &) const
virtual bool | visit (DataNode &)
virtual bool | visitEnter (ConditionNode &) const
virtual bool | visit (ConditionNode &)

## Public Attributes
int | m_nodesSucceeded {0}

## Detailed Description

Definition at line 18 of file Rankers.h.

## Member Function Documentation

## ◆ reset()

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

Reimplemented from concurrency::IGraphVisitor.

Definition at line 23 of file Rankers.h.

23 { m_nodesSucceeded = 0; };
concurrency::RankerByCummulativeOutDegree::m_nodesSucceeded
int m_nodesSucceeded
Definition: Rankers.h:27

## ◆ runThroughAdjacents()

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

Definition at line 62 of file Rankers.cpp.

63 {
64 typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVB;
65 typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVE;
66
67 for ( boost::tie( itVB, itVE ) = adjacent_vertices( vertex, graph ); itVB != itVE; ++itVB ) {
68 m_nodesSucceeded += 1;
69 runThroughAdjacents( *itVB, graph );
70 }
71 }
concurrency::RankerByCummulativeOutDegree::m_nodesSucceeded
int m_nodesSucceeded
Definition: Rankers.h:27
concurrency::RankerByCummulativeOutDegree::runThroughAdjacents
void runThroughAdjacents(boost::graph_traits< precedence::PrecTrace >::vertex_descriptor, precedence::PrecTrace)
Definition: Rankers.cpp:62
plotSpeedupsPyRoot.graph
graph
Definition: plotSpeedupsPyRoot.py:140

## ◆ visit() [1/5]

virtual bool concurrency::IGraphVisitor::visit
| inline

Definition at line 22 of file IGraphVisitor.h.

22 { return true; };

## ◆ visit() [2/5]

virtual bool concurrency::IGraphVisitor::visit
| inline

Definition at line 19 of file IGraphVisitor.h.

19 { return true; };

## ◆ visit() [3/5]

virtual bool concurrency::IGraphVisitor::visit
| inline

Definition at line 16 of file IGraphVisitor.h.

16 { return true; };

## ◆ visit() [4/5]

virtual bool concurrency::IGraphVisitor::visit
| inline

Definition at line 25 of file IGraphVisitor.h.

25 { return true; };

## ◆ visit() [5/5]

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

Reimplemented from concurrency::IGraphVisitor.

Definition at line 25 of file Rankers.cpp.

25 {
26
27 std::ifstream myfile;
28 myfile.open( "InputExecutionPlan.graphml", std::ios::in );
29
30 precedence::PrecTrace execPlan;
31
32 using boost::get;
33 using precedence::AlgoTraceProps;
34
35 boost::dynamic_properties dp;
36 dp.property( "name", get( &AlgoTraceProps::m_name, execPlan ) );
37 dp.property( "index", get( &AlgoTraceProps::m_index, execPlan ) );
38 dp.property( "dataRank", get( &AlgoTraceProps::m_rank, execPlan ) );
39 dp.property( "runtime", get( &AlgoTraceProps::m_runtime, execPlan ) );
40
41 boost::read_graphml( myfile, execPlan, dp );
42
43 typedef boost::graph_traits<precedence::PrecTrace>::vertex_iterator itV;
44 std::pair<itV, itV> vp;
45
46 for ( vp = boost::vertices( execPlan ); vp.first != vp.second; ++vp.first ) {
47 precedence::AlgoTraceVertex v = *vp.first;
48 auto index = get( &AlgoTraceProps::m_name, execPlan );
49 if ( index[v] == node.getNodeName() ) {
50 runThroughAdjacents( v, execPlan );
51 float rank = m_nodesSucceeded;
52 node.setRank( rank );
53 reset();
54 // std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
55 }
56 }
57
58 return true;
59 }
std::ifstream::open
T open(T... args)
precedence::AlgoTraceVertex
boost::graph_traits< PrecTrace >::vertex_descriptor AlgoTraceVertex
Definition: PrecedenceRulesGraph.h:51
precedence::AlgoTraceProps
Definition: PrecedenceRulesGraph.h:39
concurrency::RankerByCummulativeOutDegree::m_nodesSucceeded
int m_nodesSucceeded
Definition: Rankers.h:27
concurrency::RankerByCummulativeOutDegree::reset
void reset() override
Definition: Rankers.h:23
concurrency::RankerByCummulativeOutDegree::runThroughAdjacents
void runThroughAdjacents(boost::graph_traits< precedence::PrecTrace >::vertex_descriptor, precedence::PrecTrace)
Definition: Rankers.cpp:62
precedence::PrecTrace
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoTraceProps > PrecTrace
Definition: PrecedenceRulesGraph.h:50
std::pair
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:332
std::ifstream
STL class.

## Member Data Documentation

## ◆ m_nodesSucceeded

int concurrency::RankerByCummulativeOutDegree::m_nodesSucceeded {0}

Definition at line 27 of file Rankers.h.

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

- GaudiHive/src/PRGraph/Visitors/Rankers.h
- GaudiHive/src/PRGraph/Visitors/Rankers.cpp