The Gaudi Framework  v30r3 (a5ef0a68)
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 415 of file PRGraphVisitors.cpp.

417  {
418  typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVB;
419  typename boost::graph_traits<precedence::PrecTrace>::adjacency_iterator itVE;
420 
421  for ( boost::tie( itVB, itVE ) = adjacent_vertices( vertex, graph ); itVB != itVE; ++itVB ) {
422  m_nodesSucceeded += 1;
423  runThroughAdjacents( *itVB, graph );
424  }
425  }
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 377 of file PRGraphVisitors.cpp.

378  {
379 
380  std::ifstream myfile;
381  myfile.open( "InputExecutionPlan.graphml", std::ios::in );
382 
383  precedence::PrecTrace execPlan;
384 
386  using boost::get;
387 
388  boost::dynamic_properties dp;
389  dp.property( "name", get( &AlgoTraceProps::m_name, execPlan ) );
390  dp.property( "index", get( &AlgoTraceProps::m_index, execPlan ) );
391  dp.property( "dataRank", get( &AlgoTraceProps::m_rank, execPlan ) );
392  dp.property( "runtime", get( &AlgoTraceProps::m_runtime, execPlan ) );
393 
394  boost::read_graphml( myfile, execPlan, dp );
395 
396  typedef boost::graph_traits<precedence::PrecTrace>::vertex_iterator itV;
398 
399  for ( vp = boost::vertices( execPlan ); vp.first != vp.second; ++vp.first ) {
400  precedence::AlgoTraceVertex v = *vp.first;
401  auto index = get( &AlgoTraceProps::m_name, execPlan );
402  if ( index[v] == node.getNodeName() ) {
403  runThroughAdjacents( v, execPlan );
404  float rank = m_nodesSucceeded;
405  node.setRank( rank );
406  reset();
407  // std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
408  }
409  }
410 
411  return true;
412  }
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: