concurrency::RankerByTiming Class Reference

#include <src/EFGraphVisitors.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 118 of file EFGraphVisitors.h.

Constructor & Destructor Documentation

concurrency::RankerByTiming::RankerByTiming ( )
inline

Constructor.

Definition at line 121 of file EFGraphVisitors.h.

121  {
122  m_nodesSucceeded = 0;
123  m_slotNum = -1;
124  };
concurrency::RankerByTiming::~RankerByTiming ( )
inlineoverride

Destructor.

Definition at line 126 of file EFGraphVisitors.h.

126 {}

Member Function Documentation

void concurrency::RankerByTiming::reset ( )
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 140 of file EFGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 130 of file EFGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 222 of file EFGraphVisitors.cpp.

222  {
223 
224  std::ifstream myfile;
225  myfile.open("InputExecutionPlan.graphml", std::ios::in);
226 
227  boost::ExecPlan execPlan;
228 
229  boost::dynamic_properties dp;
230  dp.property("name", boost::get(&boost::AlgoNodeStruct::m_name, execPlan));
231  dp.property("index", boost::get(&boost::AlgoNodeStruct::m_index, execPlan));
232  dp.property("dataRank", boost::get(&boost::AlgoNodeStruct::m_rank, execPlan));
233  dp.property("runtime", boost::get(&boost::AlgoNodeStruct::m_runtime, execPlan));
234 
235  boost::read_graphml(myfile, execPlan, dp);
236 
237  typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
239  typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor AlgoVertex;
240 
241  for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
242  AlgoVertex v = *vp.first;
243  auto index = boost::get(&boost::AlgoNodeStruct::m_name, execPlan);
244  if (index[v] == node.getNodeName()) {
245  auto index_runtime = boost::get(&boost::AlgoNodeStruct::m_runtime, execPlan);
246  float rank = index_runtime[v];
247  node.setRank(rank);
248  //std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
249  }
250  }
251  return true;
252  }
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 128 of file EFGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 135 of file EFGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 132 of file EFGraphVisitors.h.

132 {return true;}

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