The Gaudi Framework  v28r2p1 (f1a77ff4)
concurrency::RankerByTiming Class Reference

#include <src/PRGraphVisitors.h>

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

Public Member Functions

 RankerByTiming ()
 Constructor. More...
 
 ~RankerByTiming () override
 Destructor. More...
 
bool visitEnter (DecisionNode &) const override
 
bool visit (DecisionNode &) override
 
bool visitLeave (DecisionNode &) const override
 
bool visitEnter (AlgorithmNode &) const override
 
bool visit (AlgorithmNode &node) override
 
void reset () override
 
- Public Member Functions inherited from concurrency::IGraphVisitor
virtual ~IGraphVisitor ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 145 of file PRGraphVisitors.h.

Constructor & Destructor Documentation

concurrency::RankerByTiming::RankerByTiming ( )
inline

Constructor.

Definition at line 148 of file PRGraphVisitors.h.

148  {
149  m_nodesSucceeded = 0;
150  m_slotNum = -1;
151  };
concurrency::RankerByTiming::~RankerByTiming ( )
inlineoverride

Destructor.

Definition at line 153 of file PRGraphVisitors.h.

153 {}

Member Function Documentation

void concurrency::RankerByTiming::reset ( )
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 167 of file PRGraphVisitors.h.

bool concurrency::RankerByTiming::visit ( DecisionNode )
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 157 of file PRGraphVisitors.h.

157 {return true;}
bool concurrency::RankerByTiming::visit ( AlgorithmNode node)
overridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 304 of file PRGraphVisitors.cpp.

304  {
305 
306  std::ifstream myfile;
307  myfile.open("InputExecutionPlan.graphml", std::ios::in);
308 
309  boost::ExecPlan execPlan;
310 
311  boost::dynamic_properties dp;
312  dp.property("name", boost::get(&boost::AlgoNodeStruct::m_name, execPlan));
313  dp.property("index", boost::get(&boost::AlgoNodeStruct::m_index, execPlan));
314  dp.property("dataRank", boost::get(&boost::AlgoNodeStruct::m_rank, execPlan));
315  dp.property("runtime", boost::get(&boost::AlgoNodeStruct::m_runtime, execPlan));
316 
317  boost::read_graphml(myfile, execPlan, dp);
318 
319  typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
321  typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor AlgoVertex;
322 
323  for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
324  AlgoVertex v = *vp.first;
325  auto index = boost::get(&boost::AlgoNodeStruct::m_name, execPlan);
326  if (index[v] == node.getNodeName()) {
327  auto index_runtime = boost::get(&boost::AlgoNodeStruct::m_runtime, execPlan);
328  float rank = index_runtime[v];
329  node.setRank(rank);
330  //std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
331  }
332  }
333  return true;
334  }
T open(T...args)
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoNodeStruct > ExecPlan
graph_traits< ExecPlan >::vertex_descriptor AlgoVertex
STL class.
bool concurrency::RankerByTiming::visitEnter ( DecisionNode ) const
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 155 of file PRGraphVisitors.h.

155 {return true;}
bool concurrency::RankerByTiming::visitEnter ( AlgorithmNode ) const
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 162 of file PRGraphVisitors.h.

162 {return true;}
bool concurrency::RankerByTiming::visitLeave ( DecisionNode ) const
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 159 of file PRGraphVisitors.h.

159 {return true;}

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