Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PrecedenceRulesGraph.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #include "PrecedenceRulesGraph.h"
12 #include "Visitors/Promoters.h"
13 
15 
16 #include <algorithm>
17 #include <boost/property_map/transform_value_property_map.hpp>
18 #include <fstream>
19 
20 #define ON_DEBUG if ( msgLevel( MSG::DEBUG ) )
21 #define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) )
22 
23 namespace {
24  //---------------------------------------------------------------------------
26  const char* stateToString( const int& stateId ) {
27  switch ( stateId ) {
28  case 0:
29  return "FALSE";
30  case 1:
31  return "TRUE";
32  default:
33  return "UNDEFINED";
34  }
35  }
36 } // namespace
37 
38 namespace concurrency {
39 
40  //---------------------------------------------------------------------------
42 
43  if ( std::find( m_parents.begin(), m_parents.end(), node ) == m_parents.end() ) m_parents.push_back( node );
44  }
45 
46  //--------------------------------------------------------------------------
48 
49  if ( std::find( m_children.begin(), m_children.end(), node ) == m_children.end() ) m_children.push_back( node );
50  }
51 
52  //---------------------------------------------------------------------------
54  const unsigned int& recursionLevel ) const {
55 
56  auto& node_decisions = slot.controlFlowState;
57  output << std::string( recursionLevel, ' ' ) << m_nodeName << " (" << m_nodeIndex << ")"
58  << ", w/ decision: " << stateToString( node_decisions[m_nodeIndex] ) << "(" << node_decisions[m_nodeIndex]
59  << ")" << std::endl;
60 
61  for ( auto daughter : m_children ) daughter->printState( output, slot, recursionLevel + 2 );
62  }
63 
64  //---------------------------------------------------------------------------
66 
67  if ( visitor.visitEnter( *this ) ) {
68  // try to aggregate a decision
69  bool result = visitor.visit( *this );
70  return !result;
71  }
72 
73  return false; // visitor was rejected (since the decision node has an aggregated decision already)
74  }
75 
76  //---------------------------------------------------------------------------
78  const unsigned int& recursionLevel ) const {
79 
80  auto& node_decisions = slot.controlFlowState;
81  auto& states = slot.algsStates;
82  std::string indent( recursionLevel, ' ' );
83  output << indent << m_nodeName << " (" << m_nodeIndex << ")"
84  << ", w/ decision: " << stateToString( node_decisions[m_nodeIndex] ) << "(" << node_decisions[m_nodeIndex]
85  << ")"
86  << ", in state: " << states[m_algoIndex] << std::endl;
87 
88  // In a stall, CONTROLREADY nodes are interesting
89  if ( states[m_algoIndex] == AlgsExecutionStates::State::CONTROLREADY ) {
90 
91  // Check all data dependencies
92  output << indent << "========" << std::endl;
93  for ( auto dataNode : this->getInputDataNodes() ) {
94 
95  // Was the data produced?
96  ConditionNode* conditionNode = dynamic_cast<ConditionNode*>( dataNode );
97  DataReadyPromoter visitor( slot, {} );
98  bool wasProduced = false;
99  if ( conditionNode ) {
100  // ConditionNodes always request data on visit()
101  // Instead take the opposite of visitEnter(), since you may not enter if it already exists
102  wasProduced = !visitor.visitEnter( *conditionNode );
103  } else {
104  // For DataNodes, the check is done in visit()
105  wasProduced = visitor.visit( *dataNode );
106  }
107 
108  // Print out states of producer algs if data is missing
109  if ( !wasProduced ) {
110 
111  // Say if it's conditions data or not
112  if ( conditionNode )
113  output << indent << "missing conditions data: " << dataNode->name() << std::endl;
114  else
115  output << indent << "missing data: " << dataNode->name() << std::endl;
116 
117  // Find out if the algorithm needs it because of a tool
118  DataHandleFinder finder( dataNode->name() );
119  this->getAlgorithm()->acceptDHVisitor( &finder );
120  if ( finder.holderNames().size() > 1 ) {
121  output << indent << "required by tool:";
122  for ( auto const& holderName : finder.holderNames() ) {
123  if ( holderName != this->name() ) output << " " << holderName;
124  }
125  output << std::endl;
126  }
127 
128  if ( conditionNode ) {
129  // State which IOVs the data exists for
130  output << indent << "current EventID: " << EventIDBase( slot.eventContext->eventID() ) << std::endl;
131  std::vector<EventIDRange> validRanges;
132  conditionNode->m_condSvc->validRanges( validRanges, dataNode->name() )
133  .ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
134  for ( auto& range : validRanges ) { output << indent << "interval of validity: " << range << std::endl; }
135  if ( validRanges.empty() ) output << indent << "no interval(s) of validity" << std::endl;
136  } else {
137  // State which algs produce this data
138  output << indent << "can be produced by alg(s): ";
139  for ( auto algoNode : dataNode->getProducers() ) {
140  output << "( " << algoNode->name() << " in state: " << states[algoNode->getAlgoIndex()] << " ) ";
141  }
142  output << std::endl;
143  }
144 
145  // See where data is available (ignore conditions, since these are top-level)
146  if ( !conditionNode ) {
147  std::vector<EventSlot>* testSubSlots = &slot.allSubSlots;
148  auto* subSlotMap = &slot.subSlotsByNode;
149 
150  // Examine the top-level slot if you did not start there
151  if ( slot.parentSlot ) {
152  visitor.m_slot = slot.parentSlot;
153  testSubSlots = &slot.parentSlot->allSubSlots;
154  subSlotMap = &slot.parentSlot->subSlotsByNode;
155  if ( visitor.visit( *dataNode ) ) {
156  output << indent << "data is available at whole-event level" << std::endl;
157  }
158  }
159 
160  // Examine all sub slots, grouped by entry point
161  for ( auto& pair : *subSlotMap ) {
162  if ( pair.second.size() > 0 ) {
163  bool madeLine = false;
164 
165  // Loop over the slots for this entry point
166  for ( int slotIndex : pair.second ) {
167 
168  EventSlot* subSlot = &testSubSlots->at( slotIndex );
169  visitor.m_slot = subSlot;
170  if ( visitor.visit( *dataNode ) ) {
171 
172  if ( !madeLine ) {
173  // Only mention this set of sub-slots at all if one has the data
174  output << indent << "data is available in sub-slot(s) ";
175  madeLine = true;
176  }
177  output << slotIndex << ", ";
178  }
179  }
180  if ( madeLine ) { output << "entered from " << pair.first << std::endl; }
181  }
182  }
183  }
184  }
185  }
186  output << indent << "========" << std::endl;
187  }
188  }
189 
190  //---------------------------------------------------------------------------
192 
193  if ( visitor.visitEnter( *this ) ) {
194  visitor.visit( *this );
195  return true; // visitor was accepted to promote the algorithm
196  }
197 
198  return false; // visitor was rejected (since the algorithm already produced a decision)
199  }
200 
201  //---------------------------------------------------------------------------
203 
204  if ( std::find( m_parents.begin(), m_parents.end(), node ) == m_parents.end() ) m_parents.push_back( node );
205  }
206 
207  //---------------------------------------------------------------------------
209 
210  if ( std::find( m_outputs.begin(), m_outputs.end(), node ) == m_outputs.end() ) m_outputs.push_back( node );
211  }
212 
213  //---------------------------------------------------------------------------
215 
216  if ( std::find( m_inputs.begin(), m_inputs.end(), node ) == m_inputs.end() ) m_inputs.push_back( node );
217  }
218 
219  //---------------------------------------------------------------------------
221  if ( serviceLocator()->existsService( "CondSvc" ) ) {
222  SmartIF<ICondSvc> condSvc{ serviceLocator()->service( "CondSvc" ) };
223  if ( condSvc.isValid() ) {
224  info() << "CondSvc found. DF precedence rules will be augmented with 'Conditions'" << endmsg;
226  }
227  }
228 
229  // Detach condition algorithms from the CF realm
230  if ( m_conditionsRealmEnabled ) {
231  SmartIF<ICondSvc> condSvc{ serviceLocator()->service( "CondSvc", false ) };
232  auto& condAlgs = condSvc->condAlgs();
233  for ( const auto algo : condAlgs ) {
234  auto itA = m_algoNameToAlgoNodeMap.find( algo->name() );
235  if ( itA != m_algoNameToAlgoNodeMap.end() ) {
236  concurrency::AlgorithmNode* algoNode = itA->second.get();
237  debug() << "Detaching condition algorithm '" << algo->name() << "' from the CF realm.." << endmsg;
238  for ( auto parent : algoNode->getParentDecisionHubs() ) {
239  parent->m_children.erase( std::remove( parent->m_children.begin(), parent->m_children.end(), algoNode ),
240  parent->m_children.end() );
241  // clean up also auxiliary BGL-based graph of precedence rules
242  if ( m_enableAnalysis ) boost::remove_edge( node( algoNode->name() ), node( parent->name() ), m_PRGraph );
243  }
244  algoNode->m_parents.clear();
245 
246  } else {
247  warning() << "Algorithm '" << algo->name() << "' is not registered in the graph" << endmsg;
248  }
249  }
250  }
251 
253 
254  if ( !sc.isSuccess() ) error() << "Could not build the data dependency realm." << endmsg;
255 
256  return sc;
257  }
258 
259  //---------------------------------------------------------------------------
261  const unsigned int& recursionLevel ) const {
262  if ( slot.parentSlot ) {
263  // Start at sub-slot entry point
264  m_decisionNameToDecisionHubMap.at( slot.entryPoint )->printState( output, slot, recursionLevel );
265  } else {
266  // Start at the head node for whole-event slots
267  m_headNode->printState( output, slot, recursionLevel );
268  }
269 
270  // Find detached conditions algs in interesting states
271  if ( m_conditionsRealmEnabled ) {
272  bool firstPrint = true;
273  SmartIF<ICondSvc> condSvc{ serviceLocator()->service( "CondSvc", false ) };
274  auto& condAlgs = condSvc->condAlgs();
275  for ( const auto algo : condAlgs ) {
276  auto itA = m_algoNameToAlgoNodeMap.find( algo->name() );
277  if ( itA != m_algoNameToAlgoNodeMap.end() ) {
278 
279  concurrency::AlgorithmNode* algoNode = itA->second.get();
280 
281  // Ignore boring states (reduces verbosity)
282  auto& thisState = slot.algsStates[algoNode->getAlgoIndex()];
283  if ( thisState == AlgsExecutionStates::State::INITIAL ||
284  thisState == AlgsExecutionStates::State::EVTACCEPTED )
285  continue;
286 
287  // Make output
288  if ( firstPrint ) {
289  firstPrint = false;
290  output << std::endl << "Detached algorithms:" << std::endl;
291  }
292  algoNode->printState( output, slot, recursionLevel );
293  }
294  }
295  }
296  }
297 
298  //---------------------------------------------------------------------------
300 
301  const std::string& algoName = algo->name();
302 
303  m_algoNameToAlgoInputsMap[algoName] = algo->inputDataObjs();
304  m_algoNameToAlgoOutputsMap[algoName] = algo->outputDataObjs();
305 
306  ON_VERBOSE {
307  verbose() << " Inputs of " << algoName << ": ";
308  for ( auto tag : algo->inputDataObjs() ) verbose() << tag << " | ";
309  verbose() << endmsg;
310 
311  verbose() << " Outputs of " << algoName << ": ";
312  for ( auto tag : algo->outputDataObjs() ) verbose() << tag << " | ";
313  verbose() << endmsg;
314  }
315  }
316 
317  //---------------------------------------------------------------------------
319 
320  StatusCode global_sc = StatusCode::SUCCESS;
321 
322  // Production of DataNodes by AlgorithmNodes (DataNodes are created here)
323  std::vector<decltype( m_algoNameToAlgoNodeMap )::value_type*> sortedAlgs;
324  for ( auto& algo : m_algoNameToAlgoNodeMap ) { sortedAlgs.push_back( &algo ); }
325  std::sort( sortedAlgs.begin(), sortedAlgs.end(),
326  []( const auto* a, const auto* b ) { return a->first < b->first; } );
327  for ( auto* algo : sortedAlgs ) {
328 
329  auto& outputs = m_algoNameToAlgoOutputsMap[algo->first];
330  for ( auto output : outputs ) {
331  const auto sc = addDataNode( output );
332  if ( !sc.isSuccess() ) {
333  error() << "Extra producer (" << algo->first << ") for DataObject @ " << output
334  << " has been detected: this is not allowed." << endmsg;
335  global_sc = sc;
336  }
337  auto dataNode = getDataNode( output );
338  dataNode->addProducerNode( algo->second.get() );
339  algo->second->addOutputDataNode( dataNode );
340 
341  // Mirror the action above in the BGL-based graph
342  if ( m_enableAnalysis ) boost::add_edge( node( algo->second->name() ), node( output.fullKey() ), m_PRGraph );
343  }
344  }
345 
346  // Consumption of DataNodes by AlgorithmNodes
347  sortedAlgs.clear();
348  for ( auto& algo : m_algoNameToAlgoNodeMap ) { sortedAlgs.push_back( &algo ); }
349  std::sort( sortedAlgs.begin(), sortedAlgs.end(),
350  []( const auto* a, const auto* b ) { return a->first < b->first; } );
351  for ( auto* algo : sortedAlgs ) {
352 
353  for ( auto input : m_algoNameToAlgoInputsMap[algo->first] ) {
354 
355  auto itP = m_dataPathToDataNodeMap.find( input );
356 
357  DataNode* dataNode = ( itP != m_dataPathToDataNodeMap.end() ? getDataNode( input ) : nullptr );
358  if ( dataNode ) {
359  dataNode->addConsumerNode( algo->second.get() );
360  algo->second->addInputDataNode( dataNode );
361 
362  // Mirror the action above in the BGL-based graph
363  if ( m_enableAnalysis ) boost::add_edge( node( input.fullKey() ), node( algo->second->name() ), m_PRGraph );
364  }
365  }
366  }
367 
368  return global_sc;
369  }
370 
371  //---------------------------------------------------------------------------
373  bool inverted, bool allPass ) {
374 
376 
378 
379  auto& algoName = algo->name();
380 
381  concurrency::AlgorithmNode* algoNode;
382 
383  auto itA = m_algoNameToAlgoNodeMap.find( algoName );
384  if ( itA != m_algoNameToAlgoNodeMap.end() ) {
385  algoNode = itA->second.get();
386  } else {
387  auto r = m_algoNameToAlgoNodeMap.emplace(
388  algoName, std::make_unique<concurrency::AlgorithmNode>( *this, algo, m_nodeCounter, m_algoCounter, inverted,
389  allPass ) );
390  algoNode = r.first->second.get();
391 
392  // Mirror AlgorithmNode in the BGL-based graph
393  if ( m_enableAnalysis ) {
394  boost::add_vertex( AlgoProps( algo, m_nodeCounter, m_algoCounter, inverted, allPass ), m_PRGraph );
395  }
396  ++m_nodeCounter;
397  ++m_algoCounter;
398  ON_VERBOSE verbose() << "AlgorithmNode '" << algoName << "' added @ " << algoNode << endmsg;
399 
400  registerIODataObjects( algo );
401  }
402 
404  auto itP = m_decisionNameToDecisionHubMap.find( parentName );
405  if ( itP != m_decisionNameToDecisionHubMap.end() ) {
406  auto parentNode = itP->second.get();
407 
408  parentNode->addDaughterNode( algoNode );
409  algoNode->addParentNode( parentNode );
410 
411  // Mirror algorithm to CF parent relationship in the BGL-based graph
412  if ( m_enableAnalysis ) boost::add_edge( node( algo->name() ), node( parentName ), m_PRGraph );
413 
414  ON_VERBOSE verbose() << "Attached AlgorithmNode '" << algo->name() << "' to parent DecisionNode '" << parentName
415  << "'" << endmsg;
416  } else {
417  sc = StatusCode::FAILURE;
418  error() << "Parent DecisionNode '" << parentName << "' was not found" << endmsg;
419  }
420 
421  return sc;
422  }
423 
424  //---------------------------------------------------------------------------
426 
427  auto itD = m_dataPathToDataNodeMap.find( dataPath );
428  if ( itD != m_dataPathToDataNodeMap.end() ) return StatusCode::SUCCESS;
429 
431  if ( !m_conditionsRealmEnabled ) {
432  dataNode = std::make_unique<concurrency::DataNode>( *this, dataPath );
433  ON_VERBOSE verbose() << " DataNode " << dataPath << " added @ " << dataNode.get() << endmsg;
434  // Mirror the action above in the BGL-based graph
435  if ( m_enableAnalysis ) boost::add_vertex( DataProps( dataPath ), m_PRGraph );
436  } else {
437  SmartIF<ICondSvc> condSvc{ serviceLocator()->service( "CondSvc", false ) };
438  if ( condSvc->isRegistered( dataPath ) ) {
439  dataNode = std::make_unique<concurrency::ConditionNode>( *this, dataPath, condSvc );
440  ON_VERBOSE verbose() << " ConditionNode " << dataPath << " added @ " << dataNode.get() << endmsg;
441  // Mirror the action above in the BGL-based graph
442  if ( m_enableAnalysis ) boost::add_vertex( CondDataProps( dataPath ), m_PRGraph );
443  } else {
444  dataNode = std::make_unique<concurrency::DataNode>( *this, dataPath );
445  ON_VERBOSE verbose() << " DataNode " << dataPath << " added @ " << dataNode.get() << endmsg;
446  // Mirror the action above in the BGL-based graph
447  if ( m_enableAnalysis ) boost::add_vertex( DataProps( dataPath ), m_PRGraph );
448  }
449  }
450  m_dataPathToDataNodeMap.emplace( dataPath, std::move( dataNode ) );
451  return StatusCode::SUCCESS;
452  }
453 
454  //---------------------------------------------------------------------------
456  Concurrent modeConcurrent, PromptDecision modePromptDecision,
457  ModeOr modeOR, AllPass allPass, Inverted isInverted ) {
458 
460 
462 
463  auto& decisionHubName = decisionHubAlgo->name();
464 
465  auto itA = m_decisionNameToDecisionHubMap.find( decisionHubName );
466  concurrency::DecisionNode* decisionHubNode;
467  if ( itA != m_decisionNameToDecisionHubMap.end() ) {
468  decisionHubNode = itA->second.get();
469  } else {
470  auto r = m_decisionNameToDecisionHubMap.emplace(
471  decisionHubName,
472  std::make_unique<concurrency::DecisionNode>( *this, m_nodeCounter, decisionHubName, modeConcurrent,
473  modePromptDecision, modeOR, allPass, isInverted ) );
474  decisionHubNode = r.first->second.get();
475  // Mirror DecisionNode in the BGL-based graph
476  if ( m_enableAnalysis ) {
477  boost::add_vertex( DecisionHubProps( decisionHubName, m_nodeCounter, modeConcurrent, modePromptDecision, modeOR,
478  allPass, isInverted ),
479  m_PRGraph );
480  }
481 
482  ++m_nodeCounter;
483 
484  ON_VERBOSE verbose() << "DecisionNode '" << decisionHubName << "' added @ " << decisionHubNode << endmsg;
485  }
486 
488  auto itP = m_decisionNameToDecisionHubMap.find( parentName );
489  if ( itP != m_decisionNameToDecisionHubMap.end() ) {
490  auto parentNode = itP->second.get();
491  parentNode->addDaughterNode( decisionHubNode );
492  decisionHubNode->addParentNode( parentNode );
493 
494  // Mirror DecisionNode-to-DecisionNode relationship in the BGL-based graph
495  if ( m_enableAnalysis ) boost::add_edge( node( decisionHubName ), node( parentName ), m_PRGraph );
496 
497  ON_VERBOSE verbose() << "Attached DecisionNode '" << decisionHubName << "' to parent DecisionNode '" << parentName
498  << "'" << endmsg;
499  } else {
500  sc = StatusCode::FAILURE;
501  error() << "Parent DecisionNode '" << parentName << "' was not found" << endmsg;
502  }
503 
504  return sc;
505  }
506 
507  //---------------------------------------------------------------------------
509  concurrency::PromptDecision modePromptDecision, concurrency::ModeOr modeOR,
510  concurrency::AllPass allPass, concurrency::Inverted isInverted ) {
511 
512  auto itH = m_decisionNameToDecisionHubMap.find( headName );
513  if ( itH != m_decisionNameToDecisionHubMap.end() ) {
514  m_headNode = itH->second.get();
515  } else {
516  auto r = m_decisionNameToDecisionHubMap.emplace(
517  headName, std::make_unique<concurrency::DecisionNode>( *this, m_nodeCounter, headName, modeConcurrent,
518  modePromptDecision, modeOR, allPass, isInverted ) );
519  m_headNode = r.first->second.get();
520 
521  // Mirror the action above in the BGL-based graph
522  if ( m_enableAnalysis ) {
523  boost::add_vertex( DecisionHubProps( headName, m_nodeCounter, modeConcurrent, modePromptDecision, modeOR,
524  allPass, isInverted ),
525  m_PRGraph );
526  }
527 
528  ++m_nodeCounter;
529  }
530  }
531 
532  //---------------------------------------------------------------------------
534  auto vp = vertices( m_PRGraph );
535  auto i = std::find_if( vp.first, vp.second, [&]( const PRVertexDesc& v ) {
536  return std::visit( precedence::VertexName(), m_PRGraph[v] ) == name;
537  } );
538  return i != vp.second ? *i : PRVertexDesc{};
539  }
540 
541  //---------------------------------------------------------------------------
543  // iterate through Algorithm nodes
544  for ( auto& pr : m_algoNameToAlgoNodeMap ) pr.second->accept( visitor );
545 
546  // iterate through DecisionHub nodes
547  for ( auto& pr : m_decisionNameToDecisionHubMap ) pr.second->accept( visitor );
548 
549  // iterate through Data [and Conditions] nodes
550  for ( auto& pr : m_dataPathToDataNodeMap ) pr.second->accept( visitor );
551  }
552 
553  //---------------------------------------------------------------------------
555 
556  info() << "Starting ranking by data outputs .. " << endmsg;
557  for ( auto& pair : m_algoNameToAlgoNodeMap ) {
558  ON_DEBUG debug() << " Ranking " << pair.first << "... " << endmsg;
559  pair.second->accept( ranker );
560  ON_DEBUG debug() << " ... rank of " << pair.first << ": " << pair.second->getRank() << endmsg;
561  }
562  }
563 
565  std::ostringstream ost;
566  dumpControlFlow( ost, m_headNode, 0 );
567  return ost.str();
568  }
569 
571  const int& indent ) const {
572  ost << std::string( indent * 2, ' ' );
573  DecisionNode* dn = dynamic_cast<DecisionNode*>( node );
574  AlgorithmNode* an = dynamic_cast<AlgorithmNode*>( node );
575  if ( dn != 0 ) {
576  if ( node != m_headNode ) {
577  ost << node->name() << " [Seq] ";
578  ost << ( ( dn->m_modeConcurrent ) ? " [Concurrent] " : " [Sequential] " );
579  ost << ( ( dn->m_modePromptDecision ) ? " [Prompt] " : "" );
580  ost << ( ( dn->m_modeOR ) ? " [OR] " : "" );
581  ost << ( ( dn->m_allPass ) ? " [PASS] " : "" );
582  ost << "\n";
583  }
584  for ( const auto& i : dn->getDaughters() ) dumpControlFlow( ost, i, indent + 1 );
585  } else if ( an != 0 ) {
586  ost << node->name() << " [Alg] ";
587  if ( an != 0 ) {
588  auto ar = an->getAlgorithm();
589  ost << " [n= " << ar->cardinality() << "]";
590  ost << ( ( !ar->isClonable() ) ? " [unclonable] " : "" );
591  }
592  ost << "\n";
593  }
594  }
595 
596  //---------------------------------------------------------------------------
598 
599  const char idt[] = " ";
600  std::ostringstream ost;
601 
602  ost << "\n" << idt << "====================================\n";
603  ost << idt << "Data origins and destinations:\n";
604  ost << idt << "====================================\n";
605 
607  vec.reserve( m_dataPathToDataNodeMap.size() );
608  for ( auto& pair : m_dataPathToDataNodeMap ) { vec.push_back( &pair.first ); }
609  std::sort( vec.begin(), vec.end(),
610  []( const DataObjID* a, const DataObjID* b ) { return a->fullKey() < b->fullKey(); } );
611 
612  for ( const DataObjID* id : vec ) {
613  const DataNode& node = *m_dataPathToDataNodeMap.find( *id )->second;
614 
615  for ( auto algoNode : node.getProducers() ) ost << idt << " " << algoNode->name() << "\n";
616 
617  ost << idt << " V\n";
618  ost << idt << " o " << id << "\n";
619  ost << idt << " V\n";
620 
621  for ( auto algoNode : node.getConsumers() ) ost << idt << " " << algoNode->name() << "\n";
622 
623  ost << idt << "====================================\n";
624  }
625 
626  return ost.str();
627  }
628 
629  //---------------------------------------------------------------------------
630 
632  std::ofstream myfile;
633  myfile.open( fileName.c_str(), std::ios::app );
634 
635  // Declare properties to dump
636  boost::dynamic_properties dp;
637 
638  dp.property( "Entity",
639  boost::make_transform_value_property_map(
640  []( const VariantVertexProps& v ) {
641  return std::visit( []( const auto& w ) { return boost::lexical_cast<std::string>( w ); }, v );
642  },
643  boost::get( boost::vertex_bundle, m_PRGraph ) ) );
644 
645  auto add_prop = [&]( auto name, auto&& vis ) {
646  dp.property( name, boost::make_transform_value_property_map(
647  [vis = std::forward<decltype( vis )>( vis )]( const VariantVertexProps& v ) {
648  return std::visit( vis, v );
649  },
650  boost::get( boost::vertex_bundle, m_PRGraph ) ) );
651  };
652 
653  add_prop( "Name", precedence::VertexName() );
654  add_prop( "Mode", precedence::GroupMode() );
655  add_prop( "Logic", precedence::GroupLogic() );
656  add_prop( "Decision Negation", precedence::DecisionNegation() );
657  add_prop( "Negative Decision Inversion", precedence::AllPass() );
658  add_prop( "Exit Policy", precedence::GroupExit() );
659  add_prop( "Operations", precedence::Operations() );
660  add_prop( "CF Decision", precedence::CFDecision( slot ) );
661  add_prop( "State", precedence::EntityState( slot, serviceLocator(), m_conditionsRealmEnabled ) );
662  add_prop( "Start Time (Epoch ns)", precedence::StartTime( slot, serviceLocator() ) );
663  add_prop( "End Time (Epoch ns)", precedence::EndTime( slot, serviceLocator() ) );
664  add_prop( "Runtime (ns)", precedence::Duration( slot, serviceLocator() ) );
665 
666  boost::write_graphml( myfile, m_PRGraph, dp );
667 
668  myfile.close();
669  }
670 
671  //---------------------------------------------------------------------------
673  std::ofstream myfile;
674  myfile.open( fileName.c_str(), std::ios::app );
675 
676  // Fill runtimes (as this could not be done on the fly during trace assembling)
677  SmartIF<ITimelineSvc> timelineSvc = m_svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
678  if ( !timelineSvc.isValid() ) {
679  warning() << "Failed to get the TimelineSvc, timing will not be added to "
680  << "the task precedence trace dump" << endmsg;
681  } else {
682 
683  std::vector<long long int> start_times;
684 
685  for ( auto vp = vertices( m_precTrace ); vp.first != vp.second; ++vp.first ) {
686  TimelineEvent te{};
687  te.algorithm = m_precTrace[*vp.first].m_name;
688  te.slot = slot.eventContext->slot();
689  te.event = slot.eventContext->evt();
690  timelineSvc->getTimelineEvent( te );
691 
692  long int runtime{ std::chrono::duration_cast<std::chrono::microseconds>( te.end - te.start ).count() };
693  m_precTrace[*vp.first].m_runtime = runtime;
694 
695  long long int start{
696  std::chrono::duration_cast<std::chrono::nanoseconds>( te.start.time_since_epoch() ).count() };
697  m_precTrace[*vp.first].m_start = start;
698  if ( start != 0 ) start_times.push_back( start );
699  }
700 
701  auto min = std::min_element( start_times.begin(), start_times.end() );
702 
703  for ( auto vp = vertices( m_precTrace ); vp.first != vp.second; ++vp.first ) {
704 
705  auto& oldValue = m_precTrace[*vp.first].m_start;
706 
707  if ( oldValue != 0 ) oldValue = oldValue - *min;
708  }
709  }
710 
711  // Declare properties to dump
712  boost::dynamic_properties dp;
713  using boost::get;
715  dp.property( "Name", get( &AlgoTraceProps::m_name, m_precTrace ) );
716  dp.property( "Rank", get( &AlgoTraceProps::m_rank, m_precTrace ) );
717  dp.property( "Run Time (us)", get( &AlgoTraceProps::m_runtime, m_precTrace ) );
718  dp.property( "Start Time (ns)", get( &AlgoTraceProps::m_start, m_precTrace ) );
719 
720  boost::write_graphml( myfile, m_precTrace, dp );
721 
722  myfile.close();
723  }
724 
726 
727  std::string u_name = u == nullptr ? "ENTRY" : u->name();
728  std::string v_name = v->name();
729 
731 
732  if ( !u ) {
733  auto itT = m_prec_trace_map.find( "ENTRY" );
734  if ( itT != m_prec_trace_map.end() ) {
735  source = itT->second;
736  } else {
737  source = boost::add_vertex( precedence::AlgoTraceProps( "ENTRY" ), m_precTrace );
738  m_prec_trace_map["ENTRY"] = source;
739  }
740  } else {
741  auto itS = m_prec_trace_map.find( u_name );
742  if ( itS != m_prec_trace_map.end() ) {
743  source = itS->second;
744  } else {
745 
746  source =
747  boost::add_vertex( precedence::AlgoTraceProps( u_name, u->getAlgoIndex(), u->getRank() ), m_precTrace );
748  m_prec_trace_map[u_name] = source;
749  }
750  }
751 
753 
754  auto itP = m_prec_trace_map.find( v_name );
755  if ( itP != m_prec_trace_map.end() ) {
756  target = itP->second;
757  } else {
758 
759  target = boost::add_vertex( precedence::AlgoTraceProps( v_name, v->getAlgoIndex(), v->getRank() ), m_precTrace );
760  m_prec_trace_map[v_name] = target;
761  }
762 
763  boost::add_edge( source, target, m_precTrace );
764 
765  ON_DEBUG debug() << u_name << "-->" << v_name << " precedence trait added" << endmsg;
766  }
767 
768 } // namespace concurrency
EventSlot::eventContext
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:83
concurrency::AlgorithmNode::m_parents
std::vector< DecisionNode * > m_parents
Control flow parents of an AlgorithmNode (DecisionNodes)
Definition: PrecedenceRulesGraph.h:542
ConditionsStallTest.condSvc
condSvc
Definition: ConditionsStallTest.py:76
concurrency::PrecedenceRulesGraph::printState
void printState(std::stringstream &output, EventSlot &slot, const unsigned int &recursionLevel) const
Print a string representing the control flow state.
Definition: PrecedenceRulesGraph.cpp:260
std::string
STL class.
concurrency::PrecedenceRulesGraph::dumpPrecTrace
void dumpPrecTrace(const boost::filesystem::path &, const EventSlot &slot)
dump to file the precedence trace
Definition: PrecedenceRulesGraph.cpp:672
concurrency::PrecedenceRulesGraph::addDataNode
StatusCode addDataNode(const DataObjID &dataPath)
Add DataNode that represents DataObject.
Definition: PrecedenceRulesGraph.cpp:425
concurrency::PrecedenceRulesGraph::accept
void accept(IGraphVisitor &visitor) const
An entry point to visit all graph nodes.
Definition: PrecedenceRulesGraph.cpp:542
Gaudi::Algorithm::acceptDHVisitor
void acceptDHVisitor(IDataHandleVisitor *) const override
Definition: Algorithm.cpp:188
Read.app
app
Definition: Read.py:36
std::move
T move(T... args)
EventSlot::subSlotsByNode
std::unordered_map< std::string, std::vector< unsigned int > > subSlotsByNode
Listing of sub-slots by the node (name) they are attached to.
Definition: EventSlot.h:98
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:528
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
EventContext::eventID
const EventIDBase & eventID() const
Definition: EventContext.h:55
std::vector::reserve
T reserve(T... args)
concurrency::AlgorithmNode::getInputDataNodes
const std::vector< DataNode * > & getInputDataNodes() const
Get all consumer nodes.
Definition: PrecedenceRulesGraph.h:515
std::vector
STL class.
std::find
T find(T... args)
std::vector::size
T size(T... args)
fmt::runtime
const T & runtime(const T &v)
Definition: MessageSvcSink.cpp:27
EventSlot
Class representing an event slot.
Definition: EventSlot.h:24
concurrency::DecisionNode::m_modeOR
bool m_modeOR
Whether acting as "and" (false) or "or" node (true)
Definition: PrecedenceRulesGraph.h:473
concurrency::ControlFlowNode::name
const std::string & name() const
Get node name.
Definition: PrecedenceRulesGraph.h:432
concurrency::DataReadyPromoter
Definition: Promoters.h:21
precedence::StartTime
Definition: PrecedenceRulesGraph.h:261
concurrency::PrecedenceRulesGraph::m_decisionNameToDecisionHubMap
std::unordered_map< std::string, std::unique_ptr< DecisionNode > > m_decisionNameToDecisionHubMap
Index: map of decision's name to DecisionHub.
Definition: PrecedenceRulesGraph.h:710
concurrency::PrecedenceRulesGraph::dumpPrecRules
void dumpPrecRules(const boost::filesystem::path &, const EventSlot &slot)
dump to file the precedence rules
Definition: PrecedenceRulesGraph.cpp:631
concurrency::DecisionNode::m_children
std::vector< ControlFlowNode * > m_children
All direct daughter nodes in the tree.
Definition: PrecedenceRulesGraph.h:479
std::stringstream
STL class.
concurrency::AlgorithmNode::m_outputs
std::vector< DataNode * > m_outputs
Algorithm outputs (DataNodes)
Definition: PrecedenceRulesGraph.h:561
std::unique_ptr::get
T get(T... args)
concurrency::PrecedenceRulesGraph::m_enableAnalysis
bool m_enableAnalysis
Definition: PrecedenceRulesGraph.h:729
concurrency::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: PrecedenceRulesGraph.h:548
concurrency::DecisionNode::m_modePromptDecision
bool m_modePromptDecision
Whether to evaluate the hub decision ASA its child decisions allow to do that.
Definition: PrecedenceRulesGraph.h:471
DataHandleFinder.h
ON_DEBUG
#define ON_DEBUG
Definition: PrecedenceRulesGraph.cpp:20
precedence::Duration
Definition: PrecedenceRulesGraph.h:340
precedence::Operations
Definition: PrecedenceRulesGraph.h:378
precedence::EndTime
Definition: PrecedenceRulesGraph.h:301
concurrency::DecisionNode::addParentNode
void addParentNode(DecisionNode *node)
Add a parent node.
Definition: PrecedenceRulesGraph.cpp:41
concurrency::PrecedenceRulesGraph::initialize
StatusCode initialize()
Initialize graph.
Definition: PrecedenceRulesGraph.cpp:220
gaudirun.output
output
Definition: gaudirun.py:523
concurrency::ControlFlowNode::m_nodeIndex
unsigned int m_nodeIndex
Definition: PrecedenceRulesGraph.h:438
concurrency::AlgorithmNode::getParentDecisionHubs
const std::vector< DecisionNode * > & getParentDecisionHubs() const
Get all parent decision hubs.
Definition: PrecedenceRulesGraph.h:506
IOTest.start
start
Definition: IOTest.py:108
concurrency::IGraphVisitor
Definition: IGraphVisitor.h:21
concurrency::DecisionNode::addDaughterNode
void addDaughterNode(ControlFlowNode *node)
Add a daughter node.
Definition: PrecedenceRulesGraph.cpp:47
std::sort
T sort(T... args)
concurrency::AlgorithmNode::printState
void printState(std::stringstream &output, EventSlot &slot, const unsigned int &recursionLevel) const override
Print a string representing the control flow state.
Definition: PrecedenceRulesGraph.cpp:77
precedence::AlgoTraceVertex
boost::graph_traits< PrecTrace >::vertex_descriptor AlgoTraceVertex
Definition: PrecedenceRulesGraph.h:63
concurrency::AlgorithmNode::accept
bool accept(IGraphVisitor &visitor) override
Visitor entry point.
Definition: PrecedenceRulesGraph.cpp:191
concurrency::AlgorithmNode
Definition: PrecedenceRulesGraph.h:487
precedence::CFDecision
Definition: PrecedenceRulesGraph.h:184
EventSlot::entryPoint
std::string entryPoint
Event Views bookkeeping (TODO: optimize view bookkeeping)
Definition: EventSlot.h:94
std::vector::push_back
T push_back(T... args)
concurrency::PrecedenceRulesGraph::m_headNode
DecisionNode * m_headNode
the head node of the control flow graph
Definition: PrecedenceRulesGraph.h:706
TimelineEvent
Definition: ITimelineSvc.h:23
concurrency::DecisionNode::printState
void printState(std::stringstream &output, EventSlot &slot, const unsigned int &recursionLevel) const override
Print a string representing the control flow state.
Definition: PrecedenceRulesGraph.cpp:53
precedence::CondDataProps
Definition: PrecedenceRulesGraph.h:126
compareOutputFiles.target
target
Definition: compareOutputFiles.py:498
precedence::VariantVertexProps
std::variant< AlgoProps, DecisionHubProps, DataProps, CondDataProps > VariantVertexProps
Definition: PrecedenceRulesGraph.h:393
concurrency::ConditionNode
Definition: PrecedenceRulesGraph.h:605
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:72
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:444
TimingHistograms.name
name
Definition: TimingHistograms.py:25
StatusCode
Definition: StatusCode.h:65
Gaudi::tagged_bool_ns::tagged_bool
Definition: TaggedBool.h:16
ITimelineSvc
Definition: ITimelineSvc.h:37
concurrency::AlgorithmNode::addInputDataNode
void addInputDataNode(DataNode *node)
Associate an AlgorithmNode, which is a data consumer of this one.
Definition: PrecedenceRulesGraph.cpp:214
std::vector::at
T at(T... args)
concurrency::PrecedenceRulesGraph::m_dataPathToDataNodeMap
std::unordered_map< DataObjID, std::unique_ptr< DataNode >, DataObjID_Hasher > m_dataPathToDataNodeMap
Index: map of data path to DataNode.
Definition: PrecedenceRulesGraph.h:712
HistoDumpEx.r
r
Definition: HistoDumpEx.py:20
EventSlot::parentSlot
EventSlot * parentSlot
Pointer to parent slot (null for top level)
Definition: EventSlot.h:96
std::forward
T forward(T... args)
std::ofstream
STL class.
concurrency::PrecedenceRulesGraph::addAlgorithmNode
StatusCode addAlgorithmNode(Gaudi::Algorithm *daughterAlgo, const std::string &parentName, bool inverted, bool allPass)
Add algorithm node.
Definition: PrecedenceRulesGraph.cpp:372
std::min_element
T min_element(T... args)
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:51
Gaudi::Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:90
precedence::GroupMode
Definition: PrecedenceRulesGraph.h:140
concurrency::IGraphVisitor::visit
virtual bool visit(DecisionNode &)
Definition: IGraphVisitor.h:26
concurrency::PrecedenceRulesGraph::name
const std::string & name() const override
Retrieve name of the service.
Definition: PrecedenceRulesGraph.h:680
concurrency::DecisionNode::m_modeConcurrent
bool m_modeConcurrent
Whether all daughters will be evaluated concurrently or sequentially.
Definition: PrecedenceRulesGraph.h:468
precedence::DataProps
Definition: PrecedenceRulesGraph.h:120
concurrency::PrecedenceRulesGraph::m_prec_trace_map
std::map< std::string, precedence::AlgoTraceVertex > m_prec_trace_map
Definition: PrecedenceRulesGraph.h:728
concurrency::PrecedenceRulesGraph::m_nodeCounter
unsigned int m_nodeCounter
Total number of nodes in the graph.
Definition: PrecedenceRulesGraph.h:718
concurrency::PrecedenceRulesGraph::getDataNode
DataNode * getDataNode(const DataObjID &dataPath) const
Get DataNode by DataObject path using graph index.
Definition: PrecedenceRulesGraph.h:651
std::ofstream::close
T close(T... args)
GaudiPython.Bindings.nullptr
nullptr
Definition: Bindings.py:92
DataHandleFinder::holderNames
std::vector< std::string > & holderNames()
Definition: DataHandleFinder.h:36
EventSlot::allSubSlots
std::vector< EventSlot > allSubSlots
Actual sub-slot instances.
Definition: EventSlot.h:100
concurrency::PrecedenceRulesGraph::rankAlgorithms
void rankAlgorithms(IGraphVisitor &ranker) const
Rank Algorithm nodes by the number of data outputs.
Definition: PrecedenceRulesGraph.cpp:554
precedence::DecisionNegation
Definition: PrecedenceRulesGraph.h:168
std::ofstream::open
T open(T... args)
SmartIF< ICondSvc >
precedence::VertexName
Definition: PrecedenceRulesGraph.h:132
genconfuser.verbose
verbose
Definition: genconfuser.py:29
concurrency::PrecedenceRulesGraph::addDecisionHubNode
StatusCode addDecisionHubNode(Gaudi::Algorithm *daughterAlgo, const std::string &parentName, concurrency::Concurrent, concurrency::PromptDecision, concurrency::ModeOr, concurrency::AllPass, concurrency::Inverted)
Add a node, which aggregates decisions of direct daughter nodes.
Definition: PrecedenceRulesGraph.cpp:455
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
concurrency::DecisionNode::getDaughters
const std::vector< ControlFlowNode * > & getDaughters() const
Get children nodes.
Definition: PrecedenceRulesGraph.h:462
std::remove
T remove(T... args)
min
EventIDBase min(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:212
concurrency::PrecedenceRulesGraph::dumpControlFlow
std::string dumpControlFlow() const
Print out control flow of Algorithms and Sequences.
Definition: PrecedenceRulesGraph.cpp:564
precedence::AlgoTraceProps
Definition: PrecedenceRulesGraph.h:49
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoNodeMap
std::unordered_map< std::string, std::unique_ptr< AlgorithmNode > > m_algoNameToAlgoNodeMap
Index: map of algorithm's name to AlgorithmNode.
Definition: PrecedenceRulesGraph.h:708
concurrency::PrecedenceRulesGraph::m_algoCounter
unsigned int m_algoCounter
Total number of algorithm nodes in the graph.
Definition: PrecedenceRulesGraph.h:720
DataObjID
Definition: DataObjID.h:47
concurrency
Definition: PrecedenceRulesGraph.cpp:38
concurrency::PrecedenceRulesGraph::m_conditionsRealmEnabled
bool m_conditionsRealmEnabled
Enable conditions realm of precedence rules.
Definition: PrecedenceRulesGraph.h:734
precedence::AlgoProps
Definition: PrecedenceRulesGraph.h:66
concurrency::IGraphVisitor::visitEnter
virtual bool visitEnter(DecisionNode &) const
Definition: IGraphVisitor.h:25
HistoDumpEx.v
v
Definition: HistoDumpEx.py:27
concurrency::DecisionNode
Definition: PrecedenceRulesGraph.h:442
concurrency::PrecedenceRulesGraph::m_precTrace
precedence::PrecTrace m_precTrace
facilities for algorithm precedence tracing
Definition: PrecedenceRulesGraph.h:727
std::ostringstream
STL class.
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoInputsMap
std::unordered_map< std::string, DataObjIDColl > m_algoNameToAlgoInputsMap
Indexes: maps of algorithm's name to algorithm's inputs/outputs.
Definition: PrecedenceRulesGraph.h:714
concurrency::AlgorithmNode::m_inputs
std::vector< DataNode * > m_inputs
Algorithm inputs (DataNodes)
Definition: PrecedenceRulesGraph.h:563
concurrency::ControlFlowNode::m_nodeName
std::string m_nodeName
Definition: PrecedenceRulesGraph.h:439
concurrency::DecisionNode::m_allPass
bool m_allPass
Whether always passing regardless of daughter results.
Definition: PrecedenceRulesGraph.h:475
concurrency::PrecedenceRulesGraph::m_PRGraph
precedence::PRGraph m_PRGraph
BGL-based graph of precedence rules.
Definition: PrecedenceRulesGraph.h:731
concurrency::PrecedenceRulesGraph::dumpDataFlow
std::string dumpDataFlow() const
Print out all data origins and destinations, as reflected in the EF graph.
Definition: PrecedenceRulesGraph.cpp:597
concurrency::PrecedenceRulesGraph::registerIODataObjects
void registerIODataObjects(const Gaudi::Algorithm *algo)
Register algorithm in the Data Dependency index.
Definition: PrecedenceRulesGraph.cpp:299
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::endl
T endl(T... args)
concurrency::DataNode::addConsumerNode
void addConsumerNode(AlgorithmNode *node)
Add relationship to consumer AlgorithmNode.
Definition: PrecedenceRulesGraph.h:587
DataHandleHolderBase::outputDataObjs
const DataObjIDColl & outputDataObjs() const override
Definition: DataHandleHolderBase.h:84
precedence::GroupLogic
Definition: PrecedenceRulesGraph.h:150
std::vector::begin
T begin(T... args)
concurrency::ControlFlowNode
Definition: PrecedenceRulesGraph.h:417
concurrency::PrecedenceRulesGraph::m_algoNameToAlgoOutputsMap
std::unordered_map< std::string, DataObjIDColl > m_algoNameToAlgoOutputsMap
Definition: PrecedenceRulesGraph.h:715
precedence::DecisionHubProps
Definition: PrecedenceRulesGraph.h:92
Promoters.h
concurrency::AlgorithmNode::getAlgoIndex
const unsigned int & getAlgoIndex() const
Get algorithm index.
Definition: PrecedenceRulesGraph.h:525
TimelineEvent::algorithm
std::string algorithm
Definition: ITimelineSvc.h:31
ON_VERBOSE
#define ON_VERBOSE
Definition: PrecedenceRulesGraph.cpp:21
concurrency::PrecedenceRulesGraph::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: PrecedenceRulesGraph.h:682
concurrency::AlgorithmNode::getRank
const float & getRank() const
Get Algorithm rank.
Definition: PrecedenceRulesGraph.h:520
std::ostringstream::str
T str(T... args)
EventIDBase
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventIDBase.h:66
DataHandleHolderBase::inputDataObjs
const DataObjIDColl & inputDataObjs() const override
Definition: DataHandleHolderBase.h:83
concurrency::DataNode
Definition: PrecedenceRulesGraph.h:567
precedence::EntityState
Definition: PrecedenceRulesGraph.h:200
EventSlot::controlFlowState
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:87
std::vector::end
T end(T... args)
concurrency::DecisionNode::m_parents
std::vector< DecisionNode * > m_parents
Direct parent nodes.
Definition: PrecedenceRulesGraph.h:481
concurrency::DecisionNode::accept
bool accept(IGraphVisitor &visitor) override
Visitor entry point.
Definition: PrecedenceRulesGraph.cpp:65
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
concurrency::AlgorithmNode::addOutputDataNode
void addOutputDataNode(DataNode *node)
Associate an AlgorithmNode, which is a data supplier for this one.
Definition: PrecedenceRulesGraph.cpp:208
precedence::AllPass
Definition: PrecedenceRulesGraph.h:176
concurrency::ConditionNode::m_condSvc
SmartIF< ICondSvc > m_condSvc
Definition: PrecedenceRulesGraph.h:620
concurrency::DataReadyPromoter::visitEnter
bool visitEnter(AlgorithmNode &) const override
Definition: Promoters.cpp:24
PrecedenceRulesGraph.h
concurrency::PrecedenceRulesGraph::buildDataDependenciesRealm
StatusCode buildDataDependenciesRealm()
Build data dependency realm WITH data object nodes participating.
Definition: PrecedenceRulesGraph.cpp:318
concurrency::PrecedenceRulesGraph::node
PRVertexDesc node(const std::string &) const
Definition: PrecedenceRulesGraph.cpp:533
precedence::GroupExit
Definition: PrecedenceRulesGraph.h:158
concurrency::PrecedenceRulesGraph::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
Definition: PrecedenceRulesGraph.h:723
std::unique_ptr< concurrency::DataNode >
concurrency::PrecedenceRulesGraph::addHeadNode
void addHeadNode(const std::string &headName, concurrency::Concurrent, concurrency::PromptDecision, concurrency::ModeOr, concurrency::AllPass, concurrency::Inverted)
Add a node, which has no parents.
Definition: PrecedenceRulesGraph.cpp:508
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:85
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:50
concurrency::AlgorithmNode::getAlgorithm
Gaudi::Algorithm * getAlgorithm() const
get Algorithm representatives
Definition: PrecedenceRulesGraph.h:523
precedence::PRVertexDesc
boost::graph_traits< PRGraph >::vertex_descriptor PRVertexDesc
Definition: PrecedenceRulesGraph.h:395
Gaudi::Functional::details::zip::range
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.
Definition: FunctionalDetails.h:102
DataHandleFinder
Definition: DataHandleFinder.h:31
concurrency::AlgorithmNode::addParentNode
void addParentNode(DecisionNode *node)
Add a parent node.
Definition: PrecedenceRulesGraph.cpp:202
concurrency::PrecedenceRulesGraph::addEdgeToPrecTrace
void addEdgeToPrecTrace(const AlgorithmNode *u, const AlgorithmNode *v)
set cause-effect connection between two algorithms in the precedence trace
Definition: PrecedenceRulesGraph.cpp:725