The Gaudi Framework  v30r1 (5d4f4ae2)
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 98 of file PRGraphVisitors.h.

Member Function Documentation

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

Reimplemented from concurrency::IGraphVisitor.

Definition at line 390 of file PRGraphVisitors.cpp.

391  {
392 
393  std::ifstream myfile;
394  myfile.open( "InputExecutionPlan.graphml", std::ios::in );
395 
396  precedence::PrecTrace execPlan;
398  using boost::get;
399 
400  boost::dynamic_properties dp;
401  dp.property( "name", get( &AlgoTraceProps::m_name, execPlan ) );
402  dp.property( "index", get( &AlgoTraceProps::m_index, execPlan ) );
403  dp.property( "dataRank", get( &AlgoTraceProps::m_rank, execPlan ) );
404  dp.property( "runtime", get( &AlgoTraceProps::m_runtime, execPlan ) );
405 
406  boost::read_graphml( myfile, execPlan, dp );
407 
408  typedef boost::graph_traits<precedence::PrecTrace>::vertex_iterator itV;
410 
411  for ( vp = boost::vertices( execPlan ); vp.first != vp.second; ++vp.first ) {
412  precedence::AlgoTraceVertex v = *vp.first;
413  auto index = get( &AlgoTraceProps::m_name, execPlan );
414  if ( index[v] == node.getNodeName() ) {
415  auto index_runtime = get( &AlgoTraceProps::m_runtime, execPlan );
416  float rank = index_runtime[v];
417  node.setRank( rank );
418  // std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
419  }
420  }
421  return true;
422  }
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: