The Gaudi Framework  v30r0 (c919700c)
concurrency::RankerByCummulativeOutDegree Class Reference

#include <src/PRGraphVisitors.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)
 
- 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 85 of file PRGraphVisitors.h.

Member Function Documentation

void concurrency::RankerByCummulativeOutDegree::reset ( )
inlineoverridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 91 of file PRGraphVisitors.h.

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

Definition at line 291 of file PRGraphVisitors.cpp.

293  {
294  typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVB;
295  typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVE;
296 
297  for ( boost::tie( itVB, itVE ) = adjacent_vertices( vertex, graph ); itVB != itVE; ++itVB ) {
298  m_nodesSucceeded += 1;
299  runThroughAdjacents( *itVB, graph );
300  }
301  }
void runThroughAdjacents(boost::graph_traits< precedence::PrecTrace >::vertex_descriptor, precedence::PrecTrace)
bool concurrency::RankerByCummulativeOutDegree::visit ( AlgorithmNode node)
overridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 253 of file PRGraphVisitors.cpp.

254  {
255 
256  std::ifstream myfile;
257  myfile.open( "InputExecutionPlan.graphml", std::ios::in );
258 
259  precedence::PrecTrace execPlan;
260 
262  using boost::get;
263 
264  boost::dynamic_properties dp;
265  dp.property( "name", get( &AlgoTraceProps::m_name, execPlan ) );
266  dp.property( "index", get( &AlgoTraceProps::m_index, execPlan ) );
267  dp.property( "dataRank", get( &AlgoTraceProps::m_rank, execPlan ) );
268  dp.property( "runtime", get( &AlgoTraceProps::m_runtime, execPlan ) );
269 
270  boost::read_graphml( myfile, execPlan, dp );
271 
272  typedef boost::graph_traits<precedence::PrecTrace>::vertex_iterator itV;
274 
275  for ( vp = boost::vertices( execPlan ); vp.first != vp.second; ++vp.first ) {
276  precedence::AlgoTraceVertex v = *vp.first;
277  auto index = get( &AlgoTraceProps::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  }
T open(T...args)
boost::graph_traits< PrecTrace >::vertex_descriptor AlgoTraceVertex
void runThroughAdjacents(boost::graph_traits< precedence::PrecTrace >::vertex_descriptor, precedence::PrecTrace)
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoTraceProps > PrecTrace
STL class.

Member Data Documentation

int concurrency::RankerByCummulativeOutDegree::m_nodesSucceeded {0}

Definition at line 95 of file PRGraphVisitors.h.


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