17 bool allChildDecisionsResolved =
true;
19 int& childDecision = child->m_graph->getNodeDecisions(
m_slotNum)[child->getNodeIndex()];
26 if (childDecision == -1) {
27 allChildDecisionsResolved =
false;
31 if (allChildDecisionsResolved)
34 return allChildDecisionsResolved;
100 bool allChildDecisionsResolved =
true;
102 int& childDecision = child->m_graph->getNodeDecisions(
m_slotNum)[child->getNodeIndex()];
109 if (childDecision == -1) {
110 allChildDecisionsResolved =
false;
114 if (allChildDecisionsResolved)
117 return allChildDecisionsResolved;
159 for (
auto p : products)
160 rank += p->getConsumers().size();
177 myfile.
open(
"InputExecutionPlan.graphml", std::ios::in);
181 boost::dynamic_properties dp;
187 boost::read_graphml(myfile, execPlan, dp);
189 typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
191 typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor
AlgoVertex;
193 for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
194 AlgoVertex v = *vp.first;
197 runThroughAdjacents(v,execPlan);
211 typename boost::graph_traits<boost::ExecPlan>::adjacency_iterator itVB;
212 typename boost::graph_traits<boost::ExecPlan>::adjacency_iterator itVE;
214 for (boost::tie(itVB, itVE) = adjacent_vertices(vertex, graph); itVB != itVE; ++itVB) {
216 runThroughAdjacents(*itVB, graph);
225 myfile.
open(
"InputExecutionPlan.graphml", std::ios::in);
229 boost::dynamic_properties dp;
235 boost::read_graphml(myfile, execPlan, dp);
237 typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
239 typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor
AlgoVertex;
241 for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
242 AlgoVertex v = *vp.first;
246 float rank = index_runtime[v];
258 myfile.
open(
"Eccentricity.graphml", std::ios::in);
262 boost::dynamic_properties dp;
266 boost::read_graphml(myfile, execPlan, dp);
268 typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
270 typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor
AlgoVertex;
272 for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
273 AlgoVertex v = *vp.first;
277 float rank = index_eccentricity[v];
289 recursiveVisit(node);
291 float rank = m_maxKnownDepth;
307 if (products.empty())
308 if ( (m_currentDepth - 1) > m_maxKnownDepth)
309 m_maxKnownDepth = m_currentDepth - 1;
311 for (
auto p : products)
312 for (
auto algoNode : p->getConsumers())
313 recursiveVisit(*algoNode);
bool m_isLazy
Whether to evaluate lazily - i.e. whether to stop once result known.
bool promoteToControlReadyState(const int &slotNum, AlgsExecutionStates &states, std::vector< int > &node_decisions) const override
XXX: CF tests.
const unsigned int & getAlgoIndex() const
XXX: CF tests.
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoNodeStruct > ExecPlan
bool visit(DecisionNode &node) override
bool dataDependenciesSatisfied(const int &slotNum) const
Method to check whether the Algorithm has its all data dependency satisfied.
void setRank(float &rank)
Set Algorithm rank.
void recursiveVisit(AlgorithmNode &node)
Depth-first node parser to calculate node eccentricity (only within the data realm of the execution f...
const std::vector< DataNode * > & getOutputDataNodes() const
Get all supplier nodes.
bool visit(DecisionNode &) override
std::vector< int > & getNodeDecisions(const int &slotNum) const
bool visit(DecisionNode &) override
ExecutionFlowGraph * m_graph
AlgsExecutionStates & getAlgoStates(const int &slotNum) const
bool m_modeOR
Whether acting as "and" (false) or "or" node (true)
bool visitEnter(DecisionNode &node) const override
The AlgsExecutionStates encodes the state machine for the execution of algorithms within a single eve...
bool visitLeave(DecisionNode &node) const override
const std::vector< ControlFlowNode * > & getDaughters() const
graph_traits< ExecPlan >::vertex_descriptor AlgoVertex
bool visitEnter(DecisionNode &node) const override
bool visitLeave(DecisionNode &node) const override
bool visit(DecisionNode &) override
void runThroughAdjacents(boost::graph_traits< boost::ExecPlan >::vertex_descriptor vertex, boost::ExecPlan graph)
bool visit(DecisionNode &) override
const std::string & getNodeName() const
const unsigned int & getNodeIndex() const
XXX: CF tests.
bool visit(DecisionNode &) override
bool visit(DecisionNode &node) override
bool promoteToDataReadyState(const int &slotNum, const AlgorithmNode *requestor=nullptr) const
StatusCode updateState(unsigned int iAlgo, State newState)