The Gaudi Framework  v28r3 (cc1cf868)
concurrency::RankerByTiming Class Reference

#include <src/PRGraphVisitors.h>

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

Public Member Functions

 RankerByTiming ()
 Constructor. More...
 
bool visit (AlgorithmNode &node) 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 void reset ()
 

Additional Inherited Members

- Public Attributes inherited from concurrency::IGraphVisitor
int m_nodesSucceeded
 
EventSlotm_slot
 

Detailed Description

Definition at line 89 of file PRGraphVisitors.h.

Constructor & Destructor Documentation

concurrency::RankerByTiming::RankerByTiming ( )
inline

Constructor.

Definition at line 92 of file PRGraphVisitors.h.

92  {
93  m_nodesSucceeded = 0;
94  m_slot = nullptr;
95  };

Member Function Documentation

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

Reimplemented from concurrency::IGraphVisitor.

Definition at line 245 of file PRGraphVisitors.cpp.

245  {
246 
247  std::ifstream myfile;
248  myfile.open("InputExecutionPlan.graphml", std::ios::in);
249 
250  boost::ExecPlan execPlan;
251 
252  boost::dynamic_properties dp;
253  dp.property("name", boost::get(&boost::AlgoNodeStruct::m_name, execPlan));
254  dp.property("index", boost::get(&boost::AlgoNodeStruct::m_index, execPlan));
255  dp.property("dataRank", boost::get(&boost::AlgoNodeStruct::m_rank, execPlan));
256  dp.property("runtime", boost::get(&boost::AlgoNodeStruct::m_runtime, execPlan));
257 
258  boost::read_graphml(myfile, execPlan, dp);
259 
260  typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
262  typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor AlgoVertex;
263 
264  for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
265  AlgoVertex v = *vp.first;
266  auto index = boost::get(&boost::AlgoNodeStruct::m_name, execPlan);
267  if (index[v] == node.getNodeName()) {
268  auto index_runtime = boost::get(&boost::AlgoNodeStruct::m_runtime, execPlan);
269  float rank = index_runtime[v];
270  node.setRank(rank);
271  //std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
272  }
273  }
274  return true;
275  }
T open(T...args)
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoNodeStruct > ExecPlan
graph_traits< ExecPlan >::vertex_descriptor AlgoVertex
STL class.

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