The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
concurrency::RankerByTiming Class Reference

#include </builds/gaudi/Gaudi/GaudiHive/src/PRGraph/Visitors/Rankers.h>

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

Public Member Functions

bool visit (AlgorithmNode &) override
 
virtual bool visit (DecisionNode &)
 
virtual bool visit (DataNode &)
 
virtual bool visit (ConditionNode &)
 
- Public Member Functions inherited from concurrency::IGraphVisitor
virtual ~IGraphVisitor ()=default
 
virtual bool visitEnter (DecisionNode &) const
 
virtual bool visitEnter (AlgorithmNode &) const
 
virtual bool visitEnter (DataNode &) const
 
virtual bool visitEnter (ConditionNode &) const
 
virtual void reset ()
 

Detailed Description

Definition at line 40 of file Rankers.h.

Member Function Documentation

◆ visit() [1/4]

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

Reimplemented from concurrency::IGraphVisitor.

Definition at line 87 of file Rankers.cpp.

87 {
88
89 std::ifstream myfile;
90 myfile.open( "InputExecutionPlan.graphml", std::ios::in );
91
92 precedence::PrecTrace execPlan;
93 using boost::get;
94 using precedence::AlgoTraceProps;
95
96 boost::dynamic_properties dp;
97 dp.property( "name", get( &AlgoTraceProps::m_name, execPlan ) );
98 dp.property( "index", get( &AlgoTraceProps::m_index, execPlan ) );
99 dp.property( "dataRank", get( &AlgoTraceProps::m_rank, execPlan ) );
100 dp.property( "runtime", get( &AlgoTraceProps::m_runtime, execPlan ) );
101
102 boost::read_graphml( myfile, execPlan, dp );
103
104 typedef boost::graph_traits<precedence::PrecTrace>::vertex_iterator itV;
105 std::pair<itV, itV> vp;
106
107 for ( vp = boost::vertices( execPlan ); vp.first != vp.second; ++vp.first ) {
108 precedence::AlgoTraceVertex v = *vp.first;
109 auto index = get( &AlgoTraceProps::m_name, execPlan );
110 if ( index[v] == node.name() ) {
111 auto index_runtime = get( &AlgoTraceProps::m_runtime, execPlan );
112 float rank = index_runtime[v];
113 node.setRank( rank );
114 // std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
115 }
116 }
117 return true;
118 }
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...
get
decorate the vector of properties
Definition decorators.py:94
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoTraceProps > PrecTrace
boost::graph_traits< PrecTrace >::vertex_descriptor AlgoTraceVertex

◆ visit() [2/4]

virtual bool concurrency::IGraphVisitor::visit ( ConditionNode & )
inlinevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 34 of file IGraphVisitor.h.

34{ return true; }

◆ visit() [3/4]

virtual bool concurrency::IGraphVisitor::visit ( DataNode & )
inlinevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 31 of file IGraphVisitor.h.

31{ return true; }

◆ visit() [4/4]

virtual bool concurrency::IGraphVisitor::visit ( DecisionNode & )
inlinevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 25 of file IGraphVisitor.h.

25{ return true; }

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