The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
concurrency::RankerByCummulativeOutDegree Class Reference

#include </builds/gaudi/Gaudi/GaudiHive/src/PRGraph/Visitors/Rankers.h>

Inheritance diagram for concurrency::RankerByCummulativeOutDegree:
Collaboration diagram for concurrency::RankerByCummulativeOutDegree:

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 (DataNode &)
 
virtual bool visit (ConditionNode &)
 
- Public Member Functions inherited from concurrency::IGraphVisitor
virtual ~IGraphVisitor ()=default
 
virtual bool visitEnter (DecisionNode &) const
 
virtual bool visitEnter (AlgorithmNode &) const
 
virtual bool visitEnter (DataNode &) const
 
virtual bool visitEnter (ConditionNode &) const
 

Public Attributes

int m_nodesSucceeded { 0 }
 

Detailed Description

Definition at line 27 of file Rankers.h.

Member Function Documentation

◆ reset()

void concurrency::RankerByCummulativeOutDegree::reset ( )
inlineoverridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 32 of file Rankers.h.

◆ runThroughAdjacents()

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

Definition at line 75 of file Rankers.cpp.

76 {
77 typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVB;
78 typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVE;
79
80 for ( boost::tie( itVB, itVE ) = adjacent_vertices( vertex, graph ); itVB != itVE; ++itVB ) {
82 runThroughAdjacents( *itVB, graph );
83 }
84 }
void runThroughAdjacents(boost::graph_traits< precedence::PrecTrace >::vertex_descriptor, precedence::PrecTrace)
Definition Rankers.cpp:75

◆ visit() [1/4]

bool concurrency::RankerByCummulativeOutDegree::visit ( AlgorithmNode & node)
overridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 38 of file Rankers.cpp.

38 {
39
40 std::ifstream myfile;
41 myfile.open( "InputExecutionPlan.graphml", std::ios::in );
42
43 precedence::PrecTrace execPlan;
44
45 using boost::get;
46 using precedence::AlgoTraceProps;
47
48 boost::dynamic_properties dp;
49 dp.property( "name", get( &AlgoTraceProps::m_name, execPlan ) );
50 dp.property( "index", get( &AlgoTraceProps::m_index, execPlan ) );
51 dp.property( "dataRank", get( &AlgoTraceProps::m_rank, execPlan ) );
52 dp.property( "runtime", get( &AlgoTraceProps::m_runtime, execPlan ) );
53
54 boost::read_graphml( myfile, execPlan, dp );
55
56 typedef boost::graph_traits<precedence::PrecTrace>::vertex_iterator itV;
57 std::pair<itV, itV> vp;
58
59 for ( vp = boost::vertices( execPlan ); vp.first != vp.second; ++vp.first ) {
61 auto index = get( &AlgoTraceProps::m_name, execPlan );
62 if ( index[v] == node.name() ) {
63 runThroughAdjacents( v, execPlan );
64 float rank = m_nodesSucceeded;
65 node.setRank( rank );
66 reset();
67 // std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
68 }
69 }
70
71 return true;
72 }
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...
get
decorate the vector of properties
Definition decorators.py:94
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoTraceProps > PrecTrace
boost::graph_traits< PrecTrace >::vertex_descriptor AlgoTraceVertex

◆ visit() [2/4]

virtual bool concurrency::IGraphVisitor::visit ( ConditionNode & )
inlinevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 34 of file IGraphVisitor.h.

34{ return true; }

◆ visit() [3/4]

virtual bool concurrency::IGraphVisitor::visit ( DataNode & )
inlinevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 31 of file IGraphVisitor.h.

31{ return true; }

◆ visit() [4/4]

virtual bool concurrency::IGraphVisitor::visit ( DecisionNode & )
inlinevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 25 of file IGraphVisitor.h.

25{ return true; }

Member Data Documentation

◆ m_nodesSucceeded

int concurrency::RankerByCummulativeOutDegree::m_nodesSucceeded { 0 }

Definition at line 36 of file Rankers.h.

36{ 0 };

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