The Gaudi Framework  v31r0 (aeb156f0)
concurrency::RankerByTiming Class Reference

#include <src/PRGraphVisitors.h>

Inheritance diagram for concurrency::RankerByTiming:
Collaboration diagram for concurrency::RankerByTiming:

Public Member Functions

bool visit (AlgorithmNode &) override
 
- 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 &)
 
virtual void reset ()
 

Detailed Description

Definition at line 92 of file PRGraphVisitors.h.

Member Function Documentation

bool concurrency::RankerByTiming::visit ( AlgorithmNode node)
overridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 409 of file PRGraphVisitors.cpp.

409  {
410 
411  std::ifstream myfile;
412  myfile.open( "InputExecutionPlan.graphml", std::ios::in );
413 
414  precedence::PrecTrace execPlan;
415  using boost::get;
417 
418  boost::dynamic_properties dp;
419  dp.property( "name", get( &AlgoTraceProps::m_name, execPlan ) );
420  dp.property( "index", get( &AlgoTraceProps::m_index, execPlan ) );
421  dp.property( "dataRank", get( &AlgoTraceProps::m_rank, execPlan ) );
422  dp.property( "runtime", get( &AlgoTraceProps::m_runtime, execPlan ) );
423 
424  boost::read_graphml( myfile, execPlan, dp );
425 
426  typedef boost::graph_traits<precedence::PrecTrace>::vertex_iterator itV;
428 
429  for ( vp = boost::vertices( execPlan ); vp.first != vp.second; ++vp.first ) {
430  precedence::AlgoTraceVertex v = *vp.first;
431  auto index = get( &AlgoTraceProps::m_name, execPlan );
432  if ( index[v] == node.getNodeName() ) {
433  auto index_runtime = get( &AlgoTraceProps::m_runtime, execPlan );
434  float rank = index_runtime[v];
435  node.setRank( rank );
436  // std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
437  }
438  }
439  return true;
440  }
T open(T...args)
boost::graph_traits< PrecTrace >::vertex_descriptor AlgoTraceVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoTraceProps > PrecTrace
STL class.

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