The Gaudi Framework  v31r0 (aeb156f0)
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 80 of file PRGraphVisitors.h.

Member Function Documentation

void concurrency::RankerByCummulativeOutDegree::reset ( )
inlineoverridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 85 of file PRGraphVisitors.h.

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

Definition at line 397 of file PRGraphVisitors.cpp.

398  {
399  typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVB;
400  typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVE;
401 
402  for ( boost::tie( itVB, itVE ) = adjacent_vertices( vertex, graph ); itVB != itVE; ++itVB ) {
403  m_nodesSucceeded += 1;
404  runThroughAdjacents( *itVB, graph );
405  }
406  }
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 360 of file PRGraphVisitors.cpp.

360  {
361 
362  std::ifstream myfile;
363  myfile.open( "InputExecutionPlan.graphml", std::ios::in );
364 
365  precedence::PrecTrace execPlan;
366 
367  using boost::get;
369 
370  boost::dynamic_properties dp;
371  dp.property( "name", get( &AlgoTraceProps::m_name, execPlan ) );
372  dp.property( "index", get( &AlgoTraceProps::m_index, execPlan ) );
373  dp.property( "dataRank", get( &AlgoTraceProps::m_rank, execPlan ) );
374  dp.property( "runtime", get( &AlgoTraceProps::m_runtime, execPlan ) );
375 
376  boost::read_graphml( myfile, execPlan, dp );
377 
378  typedef boost::graph_traits<precedence::PrecTrace>::vertex_iterator itV;
380 
381  for ( vp = boost::vertices( execPlan ); vp.first != vp.second; ++vp.first ) {
382  precedence::AlgoTraceVertex v = *vp.first;
383  auto index = get( &AlgoTraceProps::m_name, execPlan );
384  if ( index[v] == node.getNodeName() ) {
385  runThroughAdjacents( v, execPlan );
386  float rank = m_nodesSucceeded;
387  node.setRank( rank );
388  reset();
389  // std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
390  }
391  }
392 
393  return true;
394  }
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 89 of file PRGraphVisitors.h.


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