The Gaudi Framework  master (37c0b60a)
DataOnDemandSvc.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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 "DataOnDemandSvc.h"
13 #include <GaudiKernel/Chrono.h>
15 #include <GaudiKernel/DataObject.h>
17 #include <GaudiKernel/IAlgorithm.h>
21 #include <GaudiKernel/IToolSvc.h>
23 #include <GaudiKernel/MsgStream.h>
25 #include <GaudiKernel/ToStream.h>
27 #include <fmt/format.h>
28 #include <map>
29 #include <math.h>
30 #include <set>
31 #include <string>
32 // ============================================================================
33 // anonymous namespace to hide few local functions
34 // ============================================================================
35 namespace {
36  // ==========================================================================
42  inline std::string no_prefix( const std::string& value, const std::string& prefix ) {
43  return boost::algorithm::starts_with( value, prefix ) ? value.substr( prefix.size() ) : value;
44  }
45  // ==========================================================================
52  template <class MAP>
53  inline size_t add_prefix( MAP& _map, const std::string& prefix ) {
54  // empty prefix
55  if ( prefix.empty() ) { return 0; } // RETURN
57  auto it = std::find_if_not( _map.begin(), _map.end(), [&]( typename MAP::ValueType::const_reference i ) {
58  return boost::algorithm::starts_with( i.first, prefix );
59  } );
60  if ( it == _map.end() ) return 0;
61  std::string key = prefix + it->first;
62  std::string value = std::move( it->second ); // steal the value we're about to erase..
63  _map.erase( it );
64  _map[key] = std::move( value ); // and move it into its new location
65  return 1 + add_prefix( _map, prefix ); // RETURN, recursion
66  //
67  }
68  // ==========================================================================
74  template <class SET>
75  inline size_t get_dir( const std::string& object, SET& _set ) {
76  std::string::size_type ifind = object.rfind( '/' );
77  // stop recursion
78  if ( std::string::npos == ifind ) { return 0; } // RETURN
79  if ( 0 == ifind ) { return 0; }
80  //
81  const std::string top = std::string( object, 0, ifind );
82  _set.insert( top );
83  return 1 + get_dir( top, _set ); // RETURN, recursion
84  }
85  // ==========================================================================
91  template <class MAP, class SET>
92  inline size_t get_dirs( const MAP& _map, SET& _set ) {
93  size_t size = _set.size();
94  for ( const auto& item : _map ) { get_dir( item.first, _set ); }
95  return _set.size() - size;
96  }
97  // ==========================================================================
98 } // end of anonymous namespace
99 
101  ClassH cl = TClass::GetClass( type.c_str() );
102  if ( !cl ) { warning() << "Failed to access dictionary class for " << name << " of type:" << type << endmsg; }
103  m_nodes[name] = Node( cl, false, type );
104 }
105 
107  Leaf leaf( alg.type(), alg.name() );
108  if ( m_init ) {
109  StatusCode sc = configureHandler( leaf );
110  if ( sc.isFailure() ) {
111  if ( m_allowInitFailure ) {
112  // re-store the content of the leaf object to try again to initialize
113  // the algorithm later (on demand)
114  leaf = Leaf( alg.type(), alg.name() );
115  } else
116  return sc;
117  }
118  }
119  m_algs[name] = leaf;
120  return StatusCode::SUCCESS;
121 }
122 
123 // ============================================================================
124 // update the content of Data-On-Demand actions
125 // ============================================================================
127  if ( !m_updateRequired ) { return StatusCode::SUCCESS; }
128 
130  StatusCode sc = setupNodeHandlers(); // convert "Nodes" new "NodeMap"
131  if ( sc.isFailure() ) {
132  error() << "Failed to setup old \"Nodes\"" << endmsg;
133  return sc;
134  }
136  sc = setupAlgHandlers(); // convert "Algorithms" into "AlgMap"
137  if ( sc.isFailure() ) {
138  error() << "Failed to setup old \"Algorithms\"" << endmsg;
139  return sc;
140  }
142  add_prefix( m_algMap, m_prefix );
144  add_prefix( m_nodeMap, m_prefix );
147  if ( m_partialPath ) { get_dirs( m_algMap, dirs ); }
148  if ( m_partialPath ) { get_dirs( m_nodeMap, dirs ); }
149  //
150  auto _e = dirs.find( "/Event" );
151  if ( dirs.end() != _e ) { dirs.erase( _e ); }
152  // add all directories as nodes
153  for ( const auto& dir : dirs ) {
154  if ( m_algMap.end() == m_algMap.find( dir ) && m_nodeMap.end() == m_nodeMap.find( dir ) )
155  m_nodeMap[dir] = "DataObject";
156  }
157  //
158  m_algs.clear();
159  m_nodes.clear();
160  //
162  for ( const auto& alg : m_algMap ) {
163  if ( i_setAlgHandler( alg.first, alg.second ).isFailure() ) return StatusCode::FAILURE;
164  }
166  for ( const auto& node : m_nodeMap ) { i_setNodeHandler( node.first, node.second ); }
168  m_updateRequired = false;
169  //
170  return StatusCode::SUCCESS;
171 }
172 //=============================================================================
173 // Inherited Service overrides:
174 //=============================================================================
176  // initialize the Service Base class
178  if ( sc.isFailure() ) { return sc; }
179  sc = setup();
180  if ( sc.isFailure() ) { return sc; }
181  //
182  if ( m_dump ) {
183  dump( MSG::INFO );
184  } else if ( msgLevel( MSG::DEBUG ) ) {
185  dump( MSG::DEBUG );
186  }
187  //
188  if ( m_init ) { return update(); }
189  //
190  return StatusCode::SUCCESS;
191 }
192 // ============================================================================
193 // finalization of the service
194 // ============================================================================
196  //
197  info() << "Handled \"" << m_trapType.value() << "\" incidents: " << m_statAlg << "/" << m_statNode << "/" << m_stat
198  << "(Alg/Node/Total)." << endmsg;
199  if ( m_dump || msgLevel( MSG::DEBUG ) ) {
200  info() << m_total.outputUserTime( "Algorithm timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] ",
202  << m_total.outputUserTime( "Total:%2%[s]", System::Sec ) << endmsg;
203  info() << m_timer_nodes.outputUserTime( "Nodes timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] ",
205  << m_timer_nodes.outputUserTime( "Total:%2%[s]", System::Sec ) << endmsg;
206  info() << m_timer_algs.outputUserTime( "Algs timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] ",
208  << m_timer_algs.outputUserTime( "Total:%2%[s]", System::Sec ) << endmsg;
209  info() << m_timer_all.outputUserTime( "All timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] ",
211  << m_timer_all.outputUserTime( "Total:%2%[s]", System::Sec ) << endmsg;
212  }
213  // dump it!
214  if ( m_dump ) {
215  dump( MSG::INFO, false );
216  } else if ( msgLevel( MSG::DEBUG ) ) {
217  dump( MSG::DEBUG, false );
218  }
219  //
220  if ( m_incSvc ) {
221  m_incSvc->removeListener( this, m_trapType );
222  m_incSvc.reset();
223  }
224  m_algMgr.reset();
225  m_dataSvc.reset();
226  if ( m_toolSvc ) { // we may not have retrieved the ToolSvc
227  // Do not call releaseTool if the ToolSvc was already finalized.
229  for ( const auto& i : m_nodeMappers ) m_toolSvc->releaseTool( i ).ignore();
230  for ( const auto& i : m_algMappers ) m_toolSvc->releaseTool( i ).ignore();
231  } else {
232  warning() << "ToolSvc already finalized: cannot release tools. Check options." << endmsg;
233  }
236  m_toolSvc.reset();
237  }
238  return Service::finalize();
239 }
240 // ============================================================================
242 // ============================================================================
244  // reinitialize the Service Base class
245  if ( m_incSvc ) {
246  m_incSvc->removeListener( this, m_trapType );
247  m_incSvc.reset();
248  }
249  m_algMgr.reset();
250  m_dataSvc.reset();
251  for ( const auto& i : m_nodeMappers ) m_toolSvc->releaseTool( i ).ignore();
253  for ( const auto& i : m_algMappers ) m_toolSvc->releaseTool( i ).ignore();
255  m_toolSvc.reset();
256  //
258  if ( sc.isFailure() ) { return sc; }
259  //
260  sc = setup();
261  if ( sc.isFailure() ) { return sc; }
262  //
263  if ( m_dump ) {
264  dump( MSG::INFO );
265  } else if ( msgLevel( MSG::DEBUG ) ) {
266  dump( MSG::DEBUG );
267  }
268  //
269  return StatusCode::SUCCESS;
270 }
271 // ============================================================================
272 // setup service
273 // ============================================================================
275  if ( !( m_algMgr = serviceLocator() ) ) // assignment meant
276  {
277  error() << "Failed to retrieve the IAlgManager interface." << endmsg;
278  return StatusCode::FAILURE;
279  }
280 
281  if ( !( m_incSvc = serviceLocator()->service( "IncidentSvc" ) ) ) // assignment meant
282  {
283  error() << "Failed to retrieve Incident service." << endmsg;
284  return StatusCode::FAILURE;
285  }
286  m_incSvc->addListener( this, m_trapType );
287 
288  if ( !( m_dataSvc = serviceLocator()->service( m_dataSvcName ) ) ) // assignment meant
289  {
290  error() << "Failed to retrieve the data provider interface of " << m_dataSvcName << endmsg;
291  return StatusCode::FAILURE;
292  }
293 
294  // No need to get the ToolSvc if we are not using tools
295  if ( !( m_nodeMapTools.empty() && m_algMapTools.empty() ) ) {
296  if ( !( m_toolSvc = serviceLocator()->service( "ToolSvc" ) ) ) // assignment meant
297  {
298  error() << "Failed to retrieve ToolSvc" << endmsg;
299  return StatusCode::FAILURE;
300  }
301 
302  // load the node mapping tools
303  IDODNodeMapper* nodetool = nullptr;
304  for ( const auto& i : m_nodeMapTools ) {
305  const StatusCode sc = m_toolSvc->retrieveTool( i, nodetool );
306  if ( sc.isFailure() ) return sc;
307  m_nodeMappers.push_back( nodetool );
308  }
309  IDODAlgMapper* algtool = nullptr;
310  for ( const auto& i : m_algMapTools ) {
311  const StatusCode sc = m_toolSvc->retrieveTool( i, algtool );
312  if ( sc.isFailure() ) return sc;
313  m_algMappers.push_back( algtool );
314  }
315  }
316  return update();
317 }
318 // ============================================================================
319 // setup node handlers
320 // ============================================================================
322  std::string nam, typ, tag;
324  // Setup for node leafs, where simply a constructor is called...
325  for ( auto node : m_nodeMapping ) {
326  using Parser = Gaudi::Utils::AttribStringParser;
327  for ( auto attrib : Parser( node ) ) {
328  switch ( ::toupper( attrib.tag[0] ) ) {
329  case 'D':
330  tag = std::move( attrib.value );
331  break;
332  case 'T':
333  nam = std::move( attrib.value );
334  break;
335  }
336  }
337  if ( m_algMap.end() != m_algMap.find( tag ) || m_nodeMap.end() != m_nodeMap.find( tag ) ) {
338  warning() << "The obsolete property 'Nodes' redefines the action for '" + tag + "' to be '" + nam + "'" << endmsg;
339  }
340  m_nodeMap[tag] = nam;
341  }
342  //
343  m_updateRequired = true;
344  //
345  return sc;
346 }
347 // ============================================================================
348 // setup algorithm handlers
349 // ============================================================================
351  std::string typ, tag;
352 
353  for ( auto alg : m_algMapping ) {
354  using Parser = Gaudi::Utils::AttribStringParser;
355  for ( auto attrib : Parser( alg ) ) {
356  switch ( ::toupper( attrib.tag[0] ) ) {
357  case 'D':
358  tag = std::move( attrib.value );
359  break;
360  case 'T':
361  typ = std::move( attrib.value );
362  break;
363  }
364  }
365  Gaudi::Utils::TypeNameString item( typ );
366  if ( m_algMap.end() != m_algMap.find( tag ) || m_nodeMap.end() != m_nodeMap.find( tag ) ) {
367  warning() << "The obsolete property 'Algorithms' redefines the action for '" + tag + "' to be '" + item.type() +
368  "/" + item.name() + "'"
369  << endmsg;
370  }
371  m_algMap[tag] = item.type() + "/" + item.name();
372  }
373  m_updateRequired = true;
374  return StatusCode::SUCCESS;
375 }
376 // ============================================================================
378 // ============================================================================
380  if ( l.algorithm ) { return StatusCode::SUCCESS; }
381  if ( !m_algMgr ) { return StatusCode::FAILURE; }
382  l.algorithm = m_algMgr->algorithm( l.name, false );
383  if ( l.algorithm ) { return StatusCode::SUCCESS; }
384  // create it!
385  StatusCode sc = m_algMgr->createAlgorithm( l.type, l.name, l.algorithm, true );
386  if ( sc.isFailure() ) {
387  error() << "Failed to create algorithm " << l.type << "('" << l.name << "')" << endmsg;
388  l.algorithm = nullptr;
389  return sc; // RETURN
390  }
391  if ( l.algorithm->isInitialized() ) { return StatusCode::SUCCESS; }
392  // initialize it!
393  sc = l.algorithm->sysInitialize();
394  if ( sc.isFailure() ) {
395  error() << "Failed to initialize algorithm " << l.type << "('" << l.name << "')" << endmsg;
396  l.algorithm = nullptr;
397  return sc; // RETURN
398  }
399  if ( Gaudi::StateMachine::RUNNING == l.algorithm->FSMState() ) { return StatusCode::SUCCESS; }
400  // run it!
401  sc = l.algorithm->sysStart();
402  if ( sc.isFailure() ) {
403  error() << "Failed to 'run' algorithm " << l.type << "('" << l.name << "')" << endmsg;
404  l.algorithm = nullptr;
405  return sc; // RETURN
406  }
407  return StatusCode::SUCCESS;
408 }
409 
410 // local algorithms
411 namespace {
414  struct ToolGetter {
418  ToolGetter( std::string _path ) : path( std::move( _path ) ) {}
420  inline std::string operator()( IDODNodeMapper* t ) const { return t->nodeTypeForPath( path ); }
422  inline Gaudi::Utils::TypeNameString operator()( IDODAlgMapper* t ) const { return t->algorithmForPath( path ); }
423  };
424 
427  inline bool isGood( const std::string& r ) { return !r.empty(); }
428  inline bool isGood( const Gaudi::Utils::TypeNameString& r ) { return !r.name().empty(); }
430 
433  class Finder {
434  const ToolGetter getter;
435  const std::vector<IDODNodeMapper*>& nodes;
438  template <class R, class C>
439  R find( const C& l ) const {
440  for ( auto& i : l ) {
441  auto result = getter( i );
442  if ( isGood( result ) ) return result;
443  }
444  return R{ "" };
445  }
446 
447  public:
449  Finder( std::string _path, const std::vector<IDODNodeMapper*>& _nodes, const std::vector<IDODAlgMapper*>& _algs )
450  : getter( std::move( _path ) ), nodes( _nodes ), algs( _algs ) {}
452  inline std::string node() const { return find<std::string>( nodes ); }
454  inline Gaudi::Utils::TypeNameString alg() const { return find<Gaudi::Utils::TypeNameString>( algs ); }
455  };
456 } // namespace
457 
458 // ===========================================================================
459 // IIncidentListener interfaces overrides: incident handling
460 // ===========================================================================
461 void DataOnDemandSvc::handle( const Incident& incident ) {
462 
464 
465  ++m_stat;
466  // proper incident type?
467  if ( incident.type() != m_trapType ) { return; } // RETURN
468  const DataIncident* inc = dynamic_cast<const DataIncident*>( &incident );
469  if ( !inc ) { return; } // RETURN
470  // update if needed!
471  if ( m_updateRequired ) {
472  if ( !update() ) throw GaudiException( "Failed to update", name(), StatusCode::FAILURE );
473  }
474 
475  if ( msgLevel( MSG::VERBOSE ) ) {
476  verbose() << "Incident: [" << incident.type() << "] "
477  << " = " << incident.source() << " Location:" << inc->tag() << endmsg;
478  }
479  // ==========================================================================
480  Gaudi::StringKey tag( inc->tag() );
481  // ==========================================================================
482  auto icl = m_nodes.find( tag );
483  if ( icl != m_nodes.end() ) {
484  StatusCode sc = execHandler( tag, icl->second );
485  if ( sc.isSuccess() ) { ++m_statNode; }
486  return; // RETURN
487  }
488  // ==========================================================================
489  auto ialg = m_algs.find( tag );
490  if ( ialg != m_algs.end() ) {
491  StatusCode sc = execHandler( tag, ialg->second );
492  if ( sc.isSuccess() ) { ++m_statAlg; }
493  return; // RETURN
494  }
495  // ==========================================================================
496  // Fall back on the tools
497  if ( m_toolSvc ) {
498  if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Try to find mapping with mapping tools" << endmsg;
499  Finder finder( no_prefix( inc->tag(), m_prefix ), m_nodeMappers, m_algMappers );
500  // - try the node mappers
501  std::string node = finder.node();
502  if ( isGood( node ) ) {
503  // if one is found update the internal node mapping and try again.
504  if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Found Node handler: " << node << endmsg;
505  i_setNodeHandler( inc->tag(), node );
506  handle( incident );
507  --m_stat; // avoid double counting because of recursion
508  return;
509  }
510  // - try alg mappings
511  Gaudi::Utils::TypeNameString alg = finder.alg();
512  if ( isGood( alg ) ) {
513  // we got an algorithm, update alg map and try to handle again
514  if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Found Algorithm handler: " << alg << endmsg;
515  i_setAlgHandler( inc->tag(), alg ).ignore();
516  handle( incident );
517  --m_stat; // avoid double counting because of recursion
518  return;
519  }
520  }
521 }
522 // ===========================================================================
523 // execute the handler
524 // ===========================================================================
526 
528 
529  if ( n.executing ) { return StatusCode::FAILURE; } // RETURN
530 
531  Protection p( n.executing );
532 
534 
535  if ( n.dataObject ) {
536  object.reset( new DataObject() );
537  } else {
538  // try to recover the handler
539  if ( !n.clazz ) { n.clazz = TClass::GetClass( n.name.c_str() ); }
540  if ( !n.clazz ) {
541  error() << "Failed to get dictionary for class '" << n.name << "' for location:" << tag << endmsg;
542  return StatusCode::FAILURE; // RETURN
543  }
544 
545  object.reset( reinterpret_cast<DataObject*>( n.clazz->New() ) );
546 
547  if ( !object ) {
548  error() << "Failed to create an object of type:" << n.clazz->GetName() << " for location:" << tag << endmsg;
549  return StatusCode::FAILURE; // RETURN
550  }
551  }
552  //
553  StatusCode sc = m_dataSvc->registerObject( tag, object.release() );
554  if ( sc.isFailure() ) {
555  error() << "Failed to register an object of type:" << n.name << " at location:" << tag << endmsg;
556  return sc; // RETURN
557  }
558  ++n.num;
559  //
560  return StatusCode::SUCCESS;
561 }
562 // ===========================================================================
563 // execute the handler
564 // ===========================================================================
567  //
568  if ( l.executing ) { return StatusCode::FAILURE; } // RETURN
569  //
570  if ( !l.algorithm ) {
571  StatusCode sc = configureHandler( l );
572  if ( sc.isFailure() ) {
573  error() << "Failed to configure handler for: " << l.name << "[" << l.type << "] " << tag << endmsg;
574  return sc; // RETURN
575  }
576  }
577  //
578  Chrono atimer( m_total );
579  //
580  Protection p( l.executing );
581  // FIXME: this will cause problems for Hive, as we need to set
582  // the EventContext of the called Algorithm.
583  // if (!l.algorithm->getContext()) {
584  // l.algorithm->setContext( &Gaudi::Hive::currentContext() );
585  // }
586  StatusCode sc = l.algorithm->sysExecute( Gaudi::Hive::currentContext() );
587  if ( sc.isFailure() ) {
588  error() << "Failed to execute the algorithm:" << l.algorithm->name() << " for location:" << tag << endmsg;
589  return sc; // RETURN
590  }
591  ++l.num;
592  //
593  return StatusCode::SUCCESS;
594 }
595 // ============================================================================
596 /* dump the content of DataOnDemand service
597  * @param level the printout level
598  * @param mode the printout mode
599  */
600 // ============================================================================
601 void DataOnDemandSvc::dump( const MSG::Level level, const bool mode ) const {
602  if ( m_algs.empty() && m_nodes.empty() ) { return; }
603 
606  for ( auto& alg : m_algs ) {
607  auto check = _m.find( alg.first );
608  if ( _m.end() != check ) {
609  warning() << " The data item is activated for '" << check->first << "' as '" << check->second.first << "'"
610  << endmsg;
611  }
612  const Leaf& l = alg.second;
613  std::string nam = ( l.name == l.type ? l.type : ( l.type + "/" + l.name ) );
614  //
615  if ( !mode && 0 == l.num ) { continue; }
616  //
617  std::string val;
618  if ( mode ) {
619  val = ( !l.algorithm ) ? "F" : "T";
620  } else {
621  val = std::to_string( l.num );
622  }
623  //
624  _m[no_prefix( alg.first, m_prefix )] = { nam, val };
625  }
626  // nodes:
627  for ( const auto& node : m_nodes ) {
628  auto check = _m.find( node.first );
629  if ( _m.end() != check ) {
630  warning() << " The data item is already activated for '" << check->first << "' as '" << check->second.first << "'"
631  << endmsg;
632  }
633  const Node& n = node.second;
634  std::string nam = "'" + n.name + "'";
635  //
636  std::string val;
637 
638  if ( !mode && 0 == n.num ) { continue; }
639 
640  if ( mode ) {
641  val = ( 0 == n.clazz ) ? "F" : "T";
642  } else {
643  val = std::to_string( n.num );
644  }
645  //
646  _m[no_prefix( node.first, m_prefix )] = { nam, val };
647  }
648  //
649  if ( _m.empty() ) { return; }
650 
651  // set width of the columns
652  size_t n1 = 10; // minimum width
653  size_t n2 = 10; // minimum width
654  size_t n3 = 0;
655  for ( const auto& i : _m ) {
656  n1 = std::max( n1, i.first.size() );
657  n2 = std::max( n2, i.second.first.size() );
658  n3 = std::max( n3, i.second.second.size() );
659  }
660  n1 = std::min( n1, size_t{ 60 } ); // maximum width
661  n2 = std::min( n2, size_t{ 60 } ); // maximum width
662 
663  auto& msg = msgStream( level );
664 
665  if ( mode ) {
666  msg << "Data-On-Demand Actions enabled for:";
667  } else {
668  msg << "Data-On-Demand Actions has been used for:";
669  }
670 
671  const auto header = fmt::format( " | {3:<{0}.{0}s} | {4:<{1}.{1}s} | {5:>{2}.{2}s} |", n1, n2, n3, "Address",
672  "Creator", ( mode ? "S" : "#" ) );
673  const auto line = fmt::format( " {0:-^{1}}", "", header.size() - 1 );
674  msg << '\n' << line << '\n' << header << '\n' << line;
675 
676  // make the actual printout:
677  for ( const auto& item : _m ) {
678  msg << fmt::format( "\n | {3:<{0}.{0}s} | {4:<{1}.{1}s} | {5:>{2}.{2}s} |", n1, n2, n3, item.first,
679  item.second.first, item.second.second );
680  }
681 
682  msg << '\n' << line << endmsg;
683 }
684 // ============================================================================
689 // ============================================================================
690 
691 // ============================================================================
692 // The END
693 // ============================================================================
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:25
DataOnDemandSvc::m_locked_nodes
bool m_locked_nodes
Definition: DataOnDemandSvc.h:247
System::milliSec
@ milliSec
Definition: Timing.h:67
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:82
toupper
void toupper(std::string &s)
Definition: ExceptionSvc.cpp:36
DataOnDemandSvc::i_setAlgHandler
StatusCode i_setAlgHandler(const std::string &name, const Gaudi::Utils::TypeNameString &alg)
Internal method to initialize an algorithm handler.
Definition: DataOnDemandSvc.cpp:106
DataOnDemandSvc::i_setNodeHandler
void i_setNodeHandler(const std::string &name, const std::string &type)
Internal method to initialize a node handler.
Definition: DataOnDemandSvc.cpp:100
IAlgManager.h
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:118
Incident::source
const std::string & source() const
Access to the source of the incident.
Definition: Incident.h:54
std::string
STL class.
details::size
constexpr auto size(const T &, Args &&...) noexcept
Definition: AnyDataWrapper.h:23
Gaudi::Utils::TypeNameString::name
const std::string & name() const
Definition: TypeNameString.h:49
DataOnDemandSvc::m_algMapping
Gaudi::Property< Setup > m_algMapping
Definition: DataOnDemandSvc.h:270
DataOnDemandSvc::m_algMapTools
Gaudi::Property< std::vector< std::string > > m_algMapTools
Definition: DataOnDemandSvc.h:283
DataOnDemandSvc::initialize
StatusCode initialize() override
Inherited Service overrides: Service initialization.
Definition: DataOnDemandSvc.cpp:175
std::move
T move(T... args)
Gaudi::Hive::currentContext
GAUDI_API const EventContext & currentContext()
Definition: ThreadLocalContext.cpp:30
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:157
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
MSG::INFO
@ INFO
Definition: IMessageSvc.h:25
std::pair< std::string, std::string >
DataOnDemandSvc::configureHandler
StatusCode configureHandler(Leaf &leaf)
Configure handler for leaf.
Definition: DataOnDemandSvc.cpp:379
DataOnDemandSvc::m_allowInitFailure
Gaudi::Property< bool > m_allowInitFailure
Definition: DataOnDemandSvc.h:266
std::vector< IDODNodeMapper * >
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
std::find_if_not
T find_if_not(T... args)
std::string::size
T size(T... args)
GaudiException
Definition: GaudiException.h:31
DataOnDemandSvc::setupAlgHandlers
StatusCode setupAlgHandlers()
Initialize leaf handlers.
Definition: DataOnDemandSvc.cpp:350
Gaudi::Utils::Histos::Formats::header
GAUDI_API std::string header(const int ID=Default)
get the recommended header by enum
Definition: HistoTableFormat.cpp:186
DataOnDemandSvc::Protection
Definition: DataOnDemandSvc.h:111
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:19
DataOnDemandSvc::setup
StatusCode setup()
Setup routine (called by (re-) initialize.
Definition: DataOnDemandSvc.cpp:274
DataIncident.h
conf.release
string release
Definition: conf.py:27
DataOnDemandSvc::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Data provider reference.
Definition: DataOnDemandSvc.h:229
DataOnDemandSvc::m_algMappers
std::vector< IDODAlgMapper * > m_algMappers
Definition: DataOnDemandSvc.h:252
gaudirun.prefix
string prefix
Definition: gaudirun.py:361
DataOnDemandSvc::m_locked_algs
bool m_locked_algs
Definition: DataOnDemandSvc.h:248
GaudiPartProp.Nodes.Node
Node
Definition: Nodes.py:247
ToStream.h
LockedChrono.h
DataOnDemandSvc::ClassH
TClass * ClassH
Definition: DataOnDemandSvc.h:105
CommonMessaging< implements< IService, IProperty, IStateful > >::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:148
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:222
IDataProviderSvc.h
GaudiUtils::Map::empty
bool empty() const
Definition: Map.h:201
Service::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:62
std::vector::clear
T clear(T... args)
IIncidentSvc.h
std::vector::push_back
T push_back(T... args)
IDODAlgMapper
Interface of tools used by the DataOnDemandSvc to choose the algorithm to be run to produce the data ...
Definition: IDODAlgMapper.h:27
IToolSvc.h
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
DataOnDemandSvc::m_algMgr
SmartIF< IAlgManager > m_algMgr
Algorithm manager.
Definition: DataOnDemandSvc.h:227
bug_34121.t
t
Definition: bug_34121.py:31
DataOnDemandSvc::m_stat
unsigned long long m_stat
Definition: DataOnDemandSvc.h:242
Gaudi::StringKey
Definition: StringKey.h:44
GaudiUtils::Map::clear
void clear()
Definition: Map.h:195
Chrono
Definition: Chrono.h:35
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:20
Gaudi::StateMachine::CONFIGURED
@ CONFIGURED
Definition: StateMachine.h:24
DataOnDemandSvc::m_partialPath
Gaudi::Property< bool > m_partialPath
Definition: DataOnDemandSvc.h:258
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:332
StatusCode
Definition: StatusCode.h:65
DataOnDemandSvc::m_trapType
Gaudi::Property< std::string > m_trapType
Definition: DataOnDemandSvc.h:255
ChronoEntity::outputUserTime
std::string outputUserTime() const
print the chrono ;
Definition: ChronoEntity.cpp:82
DataOnDemandSvc::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
Data provider reference.
Definition: DataOnDemandSvc.h:231
DataIncident
DataOnDemandSvc::m_nodeMap
Gaudi::Property< Map > m_nodeMap
Definition: DataOnDemandSvc.h:277
axes_labels.check
def check(causes, result)
Definition: axes_labels.py:47
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:237
std::to_string
T to_string(T... args)
DataOnDemandSvc::execHandler
StatusCode execHandler(const std::string &tag, Leaf &leaf)
Execute leaf handler (algorithm)
Definition: DataOnDemandSvc.cpp:565
Gaudi::Utils::LockedChrono
Definition: LockedChrono.h:60
std::set::erase
T erase(T... args)
AttribStringParser.h
DataOnDemandSvc::Node
Definition: DataOnDemandSvc.h:122
SmartIF< IStateful >
genconfuser.verbose
verbose
Definition: genconfuser.py:28
DataOnDemandSvc::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: DataOnDemandSvc.h:279
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
DataOnDemandSvc::m_dump
Gaudi::Property< bool > m_dump
Definition: DataOnDemandSvc.h:259
std::map
STL class.
gaudirun.level
level
Definition: gaudirun.py:364
Gaudi::StateMachine::RUNNING
@ RUNNING
Definition: StateMachine.h:26
TypeNameString.h
DataOnDemandSvc::m_updateRequired
bool m_updateRequired
Definition: DataOnDemandSvc.h:237
DataOnDemandSvc::m_statNode
unsigned long long m_statNode
Definition: DataOnDemandSvc.h:241
Gaudi::Utils::TypeNameString::type
const std::string & type() const
Definition: TypeNameString.h:48
cpluginsvc.n
n
Definition: cpluginsvc.py:234
GaudiUtils::Map::end
iterator end()
Definition: Map.h:140
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
std::min
T min(T... args)
std::string::substr
T substr(T... args)
DataOnDemandSvc::m_nodeMapTools
Gaudi::Property< std::vector< std::string > > m_nodeMapTools
Definition: DataOnDemandSvc.h:281
DataOnDemandSvc::dump
void dump(const MSG::Level level, const bool mode=true) const
dump the content of DataOnDemand service
Definition: DataOnDemandSvc.cpp:601
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
DataOnDemandSvc::m_algMap
Gaudi::Property< Map > m_algMap
Definition: DataOnDemandSvc.h:276
DataOnDemandSvc::m_algs
AlgMap m_algs
Map of algorithms to handle incidents.
Definition: DataOnDemandSvc.h:233
MSG::Level
Level
Definition: IMessageSvc.h:25
gaudirun.type
type
Definition: gaudirun.py:160
ThreadLocalContext.h
DataOnDemandSvc::m_nodeMapping
Gaudi::Property< Setup > m_nodeMapping
Definition: DataOnDemandSvc.h:272
System::Sec
@ Sec
Definition: Timing.h:67
MSG::VERBOSE
@ VERBOSE
Definition: IMessageSvc.h:25
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
DataOnDemandSvc::m_dataSvcName
Gaudi::Property< std::string > m_dataSvcName
Definition: DataOnDemandSvc.h:256
DataObject.h
gaudirun.l
dictionary l
Definition: gaudirun.py:583
DataOnDemandSvc::setupNodeHandlers
StatusCode setupNodeHandlers()
Initialize node handlers.
Definition: DataOnDemandSvc.cpp:321
std
STL namespace.
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
DataOnDemandSvc.h
Chrono.h
DataObject
Definition: DataObject.h:36
DataOnDemandSvc::m_nodes
NodeMap m_nodes
Map of "empty" objects to be placed as intermediate nodes.
Definition: DataOnDemandSvc.h:235
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:295
DataOnDemandSvc::m_timer_algs
ChronoEntity m_timer_algs
Definition: DataOnDemandSvc.h:245
std::string::empty
T empty(T... args)
plotSpeedupsPyRoot.line
line
Definition: plotSpeedupsPyRoot.py:198
DataOnDemandSvc::finalize
StatusCode finalize() override
Inherited Service overrides: Service finalization.
Definition: DataOnDemandSvc.cpp:195
DataOnDemandSvc::update
StatusCode update()
update the handlers
Definition: DataOnDemandSvc.cpp:126
Incident::type
const std::string & type() const
Access to the incident type.
Definition: Incident.h:48
std::set::end
T end(T... args)
IAlgorithm.h
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
std::max
T max(T... args)
ISvcLocator.h
DataOnDemandSvc::m_timer_nodes
ChronoEntity m_timer_nodes
Definition: DataOnDemandSvc.h:244
AlgSequencer.top
top
Definition: AlgSequencer.py:37
DataOnDemandSvc::m_timer_all
ChronoEntity m_timer_all
Definition: DataOnDemandSvc.h:246
Incident
Definition: Incident.h:27
std::unique_ptr
STL class.
Gaudi::Utils::AttribStringParser
Parse attribute strings allowing iteration over the various attributes.
Definition: AttribStringParser.h:40
DataOnDemandSvc::reinitialize
StatusCode reinitialize() override
Inherited Service overrides: Service reinitialization.
Definition: DataOnDemandSvc.cpp:243
ProduceConsume.key
key
Definition: ProduceConsume.py:84
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:89
std::set< std::string >
DataOnDemandSvc::Leaf
Definition: DataOnDemandSvc.h:140
DataOnDemandSvc::m_locked_all
bool m_locked_all
Definition: DataOnDemandSvc.h:249
CollWrite.algs
algs
Definition: CollWrite.py:33
SET
#define SET(x)
DataOnDemandSvc::m_init
Gaudi::Property< bool > m_init
Definition: DataOnDemandSvc.h:265
MsgStream.h
DataOnDemandSvc
Definition: DataOnDemandSvc.h:100
DataOnDemandSvc::m_total
ChronoEntity m_total
Definition: DataOnDemandSvc.h:239
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator
Definition: Service.cpp:335
DataOnDemandSvc::m_incSvc
SmartIF< IIncidentSvc > m_incSvc
Incident service.
Definition: DataOnDemandSvc.h:225
DataOnDemandSvc::handle
void handle(const Incident &incident) override
IIncidentListener interfaces overrides: incident handling.
Definition: DataOnDemandSvc.cpp:461
IDODNodeMapper
Interface of tools used by the DataOnDemandSvc to choose the type of node to be created at a path.
Definition: IDODNodeMapper.h:27
DataOnDemandSvc::m_nodeMappers
std::vector< IDODNodeMapper * > m_nodeMappers
Definition: DataOnDemandSvc.h:251
DataOnDemandSvc::m_statAlg
unsigned long long m_statAlg
Definition: DataOnDemandSvc.h:240