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