The Gaudi Framework  v32r2 (46d42edc)
concurrency::RankerByCummulativeOutDegree Class Reference

#include <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 (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 ( )
inlineoverridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 23 of file Rankers.h.

◆ 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  }
void runThroughAdjacents(boost::graph_traits< precedence::PrecTrace >::vertex_descriptor, precedence::PrecTrace)
Definition: Rankers.cpp:62

◆ 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)
overridevirtual

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;
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;
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  }
T open(T... args)
boost::graph_traits< PrecTrace >::vertex_descriptor AlgoTraceVertex
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
void runThroughAdjacents(boost::graph_traits< precedence::PrecTrace >::vertex_descriptor, precedence::PrecTrace)
Definition: Rankers.cpp:62
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoTraceProps > PrecTrace
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: