The Gaudi Framework  v37r1 (a7f61348)
ApplicationMgr Class Reference

#include </builds/gaudi/Gaudi/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h>

Inheritance diagram for ApplicationMgr:
Collaboration diagram for ApplicationMgr:

Public Member Functions

 ApplicationMgr (IInterface *=nullptr)
 
StatusCode queryInterface (const InterfaceID &iid, void **pinterface) override
 
StatusCode run () override
 
StatusCode configure () override
 
StatusCode terminate () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode nextEvent (int maxevt) override
 
const std::stringname () const override
 
EventContext createEventContext () override
 implementation of IEventProcessor::createEventContext() More...
 
StatusCode executeEvent (EventContext &&ctx) override
 implementation of IEventProcessor::executeEvent(void*) More...
 
StatusCode executeRun (int evtmax) override
 implementation of IEventProcessor::executeRun(int) More...
 
StatusCode stopRun () override
 implementation of IEventProcessor::stopRun() More...
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 
StatusCode sysStart () override
 
StatusCode sysStop () override
 
StatusCode sysFinalize () override
 
StatusCode sysReinitialize () override
 
StatusCode sysRestart () override
 
void push (EventContext &&ctx) override
 
bool empty () const override
 
std::optional< Gaudi::Interfaces::IQueueingEventProcessor::ResultTypepop () override
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property. More...
 
virtual StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p)=0
 Set the property from a property with a different name. More...
 
virtual StatusCode setProperty (const std::string &s)=0
 Set the property by string. More...
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals. More...
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string. More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name More...
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string More...
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties More...
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name. More...
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected More...
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Gaudi::Details::PropertyBase handlers

typedef std::map< unsigned long, SmartIF< IComponentManager > > ManagersMap
 Typedef for the map of component managers, the key is the "id" field of the basic InterfaceID of the managed components. More...
 
ManagersMap m_managers
 Map of known component managers. More...
 
Gaudi::Property< std::vector< std::string > > m_declaredManagers
 Property to declare the list of known managers. More...
 
SmartIF< ISvcManagerm_svcManager
 Cached pointer to the manager of services. More...
 
SmartIF< IAlgManagerm_algManager
 Cached pointer to the manager of algorithms. More...
 
SmartIF< ISvcLocatorm_svcLocator
 Reference to its own service locator (must be instantiated prior to any service!) More...
 
SmartIF< DLLClassManagerm_classManager
 Reference to the class manager. More...
 
Gaudi::Property< int > m_SIGo
 
Gaudi::Property< int > m_SIExit
 
Gaudi::Property< std::vector< std::string > > m_topAlgNameList
 
Gaudi::Property< std::vector< std::string > > m_outStreamNameList
 
Gaudi::Property< std::stringm_outStreamType
 
Gaudi::Property< std::stringm_messageSvcType
 
Gaudi::Property< std::stringm_jobOptionsSvcType
 
std::string m_name = "ApplicationMgr"
 Name. More...
 
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Internal State. More...
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Internal State. More...
 
Gaudi::Property< std::vector< std::string > > m_svcMapping { this, "SvcMapping", {}, "Default mapping of services" }
 
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
 
SmartIF< IMessageSvcm_messageSvc
 Reference to the message service. More...
 
SmartIF< IRunablem_runable
 Reference to the runable object. More...
 
SmartIF< IEventProcessorm_processingMgr
 Reference to processing manager object. More...
 
SmartIF< IQueueingEventProcessor > m_queueingProcessor
 Reference to a queueing processing manager object. More...
 
Gaudi::Monitoring::Hub m_monitoringHub
 
Gaudi::Property< int > m_evtMax { this, "EvtMax", -1, "Number of events to be processed (-1 means all events)" }
 
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
 
Gaudi::Property< bool > m_extSvcCreates
 
Gaudi::Property< std::vector< std::string > > m_dllNameList { this, "Dlls", {}, "List of DDL's names" }
 
Gaudi::Property< std::stringm_jobOptionsType { this, "JobOptionsType", "FILE", "Source type (e.g. dbase, file...)" }
 
Gaudi::Property< std::stringm_jobOptionsPath { this, "JobOptionsPath", {}, "The \"file\" to look for properties" }
 
Gaudi::Property< std::stringm_jobOptionsPreAction
 
Gaudi::Property< std::stringm_jobOptionsPostAction
 
Gaudi::Property< std::stringm_runableType { this, "Runable", "AppMgrRunable", "Runable type" }
 
Gaudi::Property< std::stringm_eventLoopMgr { this, "EventLoop", "EventLoopMgr", "Processing manager type" }
 
Gaudi::Property< std::stringm_evtsel { this, "EvtSel", {}, "Event selection" }
 
Gaudi::Property< std::stringm_histPersName { this, "HistogramPersistency", "NONE", "Name of the Hist Pers Svc" }
 
Gaudi::Property< int > m_outputLevel { this, "OutputLevel", MSG::INFO, "Message output level" }
 
Gaudi::Property< std::stringm_appName { this, "AppName", "ApplicationMgr", "The name of the application" }
 
Gaudi::Property< std::stringm_appVersion { this, "AppVersion", {}, "The version of the application" }
 
Gaudi::Property< bool > m_actHistory { this, "ActivateHistory", false, "Activate HistorySvc" }
 
Gaudi::Property< int > m_pluginDebugLevel
 
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
 
Gaudi::Property< bool > m_auditTools { this, "AuditTools", false }
 Defaults for auditors. More...
 
Gaudi::Property< bool > m_auditSvcs { this, "AuditServices", false }
 
Gaudi::Property< bool > m_auditAlgs { this, "AuditAlgorithms", false }
 
Gaudi::Property< std::map< std::string, std::string > > m_environment
 
Gaudi::Property< bool > m_loopCheck
 
Gaudi::Property< bool > m_stopOnSignal
 Property to enable/disable the "stop on signal" service. More...
 
Gaudi::Property< bool > m_stalledEventMonitoring
 Property to enable/disable the monitoring and reporting of stalled events. More...
 
Gaudi::Property< bool > m_propertiesPrint
 
Gaudi::Property< int > m_returnCode
 Property to record the error conditions occurring during the running. More...
 
Gaudi::Property< bool > m_printAlgsSequence
 
Gaudi::Property< bool > m_useMessageSvcForROOTMessages
 
bool m_useHiveAlgorithmManager
 
std::vector< std::stringm_okDlls
 names of successfully loaded dlls More...
 
void evtLoopPropertyHandler (Gaudi::Details::PropertyBase &theProp)
 
StatusCode decodeExtSvcNameList ()
 
StatusCode decodeCreateSvcNameList ()
 
void createSvcNameListHandler (Gaudi::Details::PropertyBase &)
 
void extSvcNameListHandler (Gaudi::Details::PropertyBase &theProp)
 
StatusCode decodeDllNameList ()
 
void dllNameListHandler (Gaudi::Details::PropertyBase &theProp)
 
void pluginDebugPropertyHandler (Gaudi::Details::PropertyBase &theProp)
 
template<class I >
SmartIF< IComponentManager > & getManager ()
 
SmartIF< ISvcManager > & svcManager ()
 
SmartIF< IAlgManager > & algManager ()
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Needed to locate the message service. More...
 
void outputLevelUpdate () override
 Function to call to update the outputLevel of the components (after a change in MessageSvc). More...
 
Gaudi::Monitoring::HubmonitoringHub () override
 
void printAlgsSequences ()
 Print the sequence of algorithms that have been loaded. More...
 
void setServiceManager (ISvcManager *) override
 
StatusCode i_startup ()
 Internal startup routine. More...
 
StatusCode GoToState (Gaudi::StateMachine::State state, bool ignoreFailures=false)
 Reach a state from current state (whichever it is) going through the correct transitions. More...
 
template<typename SELF , typename PIMPL , typename METHOD , typename... ARGS>
static auto i_delegateToEvtProc (SELF *self, PIMPL &member, std::string_view method_name, METHOD &&method, ARGS &&... args)
 Helper to delegate calls to event processor implementation. More...
 

Additional Inherited Members

- Public Types inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
using PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
 Typedef used to refer to this class from derived classes, as in. More...
 
- Public Types inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >
using base_class = CommonMessaging
 
- Protected Member Functions inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >
MSG::Level setUpMessaging () const
 Set up local caches. More...
 
MSG::Level resetMessaging ()
 Reinitialize internal states. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Detailed Description

The Application Manager class. The main purpose of the Application Manager is to steer any data processing application. This includes all data processing applications for LHCb data in all stages: simulation, reconstruction, analysis, high level triggers, etc. Specific implementations of the ApplicationMgr will be developed to cope with the different environments (on-line, off-line, interactive, batch, etc.).

Author
Pere Mato

Definition at line 55 of file ApplicationMgr.h.

Member Typedef Documentation

◆ ManagersMap

typedef std::map<unsigned long, SmartIF<IComponentManager> > ApplicationMgr::ManagersMap
protected

Typedef for the map of component managers, the key is the "id" field of the basic InterfaceID of the managed components.

Definition at line 174 of file ApplicationMgr.h.

Constructor & Destructor Documentation

◆ ApplicationMgr()

ApplicationMgr::ApplicationMgr ( IInterface = nullptr)

Definition at line 87 of file ApplicationMgr.cpp.

87  {
88  // IInterface initialization
89  addRef(); // Initial count set to 1
90 
91  // Instantiate component managers
92  m_managers[IService::interfaceID().id()] = new ServiceManager( this );
93 
95 
96  // Instantiate internal services
97  // SvcLocator/Factory HAS to be already instantiated
98  m_classManager = new DLLClassManager( this );
99 
100  AlgorithmManager* algMgr = new AlgorithmManager( this );
101  m_managers[IAlgorithm::interfaceID().id()] = algMgr;
102  // m_managers[IAlgorithm::interfaceID().id()] = new HiveAlgorithmManager(this);
103 
104  // This property is not hosted in the ApplicationMgr instance
105  declareProperty( "AlgTypeAliases", algMgr->typeAliases(),
106  "Aliases of algorithm types, to replace an algorithm type for every instance" );
107 
108  // ServiceMgr Initialization loop checking
109  svcManager()->setLoopCheckEnabled( m_loopCheck );
110 
111  m_svcMapping = { "EvtDataSvc/EventDataSvc",
112  "DetDataSvc/DetectorDataSvc",
113  "HistogramSvc/HistogramDataSvc",
114  "HbookCnv::PersSvc/HbookHistSvc",
115  "RootHistCnv::PersSvc/RootHistSvc",
116  "EvtPersistencySvc/EventPersistencySvc",
117  "DetPersistencySvc/DetectorPersistencySvc",
118  "HistogramPersistencySvc/HistogramPersistencySvc" };
119 }

Member Function Documentation

◆ algManager()

SmartIF<IAlgManager>& ApplicationMgr::algManager ( )
inline

Definition at line 142 of file ApplicationMgr.h.

142  {
143  // Cache the casted pointer to IAlgManager
144  if ( !m_algManager ) { m_algManager = getManager<IAlgorithm>(); }
145  return m_algManager;
146  }

◆ configure()

StatusCode ApplicationMgr::configure ( )
override

Definition at line 271 of file ApplicationMgr.cpp.

271  {
272 
273  // Check if the state is compatible with the transition
274  MsgStream tlog( m_messageSvc, name() );
276  tlog << MSG::INFO << "Already Configured" << endmsg;
277  return StatusCode::SUCCESS;
278  }
280  tlog << MSG::FATAL << "configure: Invalid state \"" << m_state << "\"" << endmsg;
281  return StatusCode::FAILURE;
282  }
284 
285  // Reset application return code.
287 
288  StatusCode sc;
289  sc = i_startup();
290  if ( !sc.isSuccess() ) { return sc; }
291 
292  {
294  // Get my own options using the Job options service
295  if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Getting my own properties" << endmsg;
296  bindPropertiesTo( serviceLocator()->getOptsSvc() );
297  }
298 
299  // Make sure that the OutputLevel is in sync
300  if ( m_outputLevel != MSG::NIL && m_messageSvc ) m_messageSvc->setOutputLevel( name(), m_outputLevel );
302 
303  // Check current outputLevel to eventually inform the MessageSvc
304  if ( m_outputLevel != MSG::NIL && !m_appName.empty() ) {
305  // Print a welcome message
307  << "=================================================================="
308  << "==================================================================" << std::endl
309  << " "
310  << " Welcome to " << m_appName.value();
311 
312  if ( !m_appVersion.empty() ) {
313  log << MSG::ALWAYS << " version " << m_appVersion.value();
314  } else {
315  log << MSG::ALWAYS << " (GaudiCoreSvc "
316  << "v" << GAUDI_MAJOR_VERSION << "r" << GAUDI_MINOR_VERSION
317 #if GAUDI_PATCH_VERSION
318  << "p" << GAUDI_PATCH_VERSION
319 #endif
320  << ")";
321  }
322 
323  // Add the host name and current time to the message
325  << " "
326  << " running on " << System::hostName() << " on " << Gaudi::Time::current().format( true ) << std::endl
327  << "=================================================================="
328  << "==================================================================" << endmsg;
329  }
330 
331  // print all own properties if the options "PropertiesPrint" is set to true
332  if ( m_propertiesPrint ) {
333  const auto& properties = getProperties();
334  log << MSG::ALWAYS << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
335  << " #properties = " << properties.size() << endmsg;
336  for ( const auto& property : properties ) { log << "Property ['Name': Value] = " << *property << endmsg; }
337  }
338 
339  // set the requested environment variables
340  for ( auto& var : m_environment ) {
341  const std::string& name = var.first;
342  const std::string& value = var.second;
344  const MSG::Level lvl = ( !old.empty() && ( old != "UNKNOWN" ) ) ? MSG::WARNING : MSG::DEBUG;
345  if ( m_outputLevel <= lvl ) log << lvl << "Setting " << name << " = " << value << endmsg;
346  System::setEnv( name, value );
347  }
348 
349  // Declare Service Types
350  for ( auto& j : m_svcMapping ) {
352  if ( svcManager()->declareSvcType( itm.name(), itm.type() ).isFailure() ) {
353  log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
354  return StatusCode::FAILURE;
355  } else {
356  ON_VERBOSE
357  log << MSG::VERBOSE << "declared service " << j << endmsg;
358  }
359  }
360  for ( auto& j : m_svcOptMapping ) {
362  if ( svcManager()->declareSvcType( itm.name(), itm.type() ).isFailure() ) {
363  log << MSG::ERROR << "declaring svc type:'" << j << "' failed." << endmsg;
364  return StatusCode::FAILURE;
365  }
366  }
367 
368  //--------------------------------------------------------------------------
369  // Declare other Services and Algorithms by loading DLL's
370  sc = decodeDllNameList();
371  if ( sc.isFailure() ) {
372  log << MSG::ERROR << "Failure loading declared DLL's" << endmsg;
373  return sc;
374  }
375 
376  //--------------------------------------------------------------------------
377  // Deal with the services explicitly declared by the user.
378  sc = decodeExtSvcNameList();
379  if ( sc.isFailure() ) {
380  log << MSG::ERROR << "Failure during external service association" << endmsg;
381  return sc;
382  }
383 
385  if ( sc.isFailure() ) {
386  log << MSG::ERROR << "Failure during external service creation" << endmsg;
387  return sc;
388  }
389 
390  //--------------------------------------------------------------------------
391  // Retrieve intrinsic services. If needed configure them.
392  //--------------------------------------------------------------------------
393  const Gaudi::Utils::TypeNameString evtloop_item( m_eventLoopMgr );
394  sc = svcManager()->addService( evtloop_item, ServiceManager::DEFAULT_SVC_PRIORITY * 10 );
395  if ( !sc.isSuccess() ) {
396  log << MSG::FATAL << "Error adding :" << m_eventLoopMgr << endmsg;
397  return sc;
398  } else {
399  ON_VERBOSE
400  log << MSG::VERBOSE << "added service " << evtloop_item << endmsg;
401  }
402 
403  m_runable = m_svcLocator->service( m_runableType );
404  if ( !m_runable ) {
405  log << MSG::FATAL << "Error retrieving Runable: " << m_runableType.value() << "\n Check option ApplicationMgr."
406  << m_runableType.name() << endmsg;
407  return sc;
408  }
409  m_processingMgr = m_svcLocator->service( evtloop_item );
410  if ( !m_processingMgr ) {
411  log << MSG::FATAL << "Error retrieving Processing manager: " << m_eventLoopMgr.value()
412  << "\n Check option ApplicationMgr." << m_eventLoopMgr.name() << "\n No events will be processed." << endmsg;
413  return sc;
414  }
415  // The IEventProcessor might also be an IQueueingEventProcessor
417 
418  // Establish Update Handlers for ExtSvc and DLLs Properties
422 
423  if ( m_actHistory ) {
424  // Create HistorySvc with a priority to ensure it's initialized last, finalized first
425  sc = svcManager()->addService( "HistorySvc", std::numeric_limits<int>::max() );
426  if ( sc.isFailure() ) {
427  log << MSG::FATAL << "Error adding HistorySvc" << endmsg;
428  return StatusCode::FAILURE;
429  }
430  }
431 
432  log << MSG::INFO << "Application Manager Configured successfully" << endmsg;
434  return StatusCode::SUCCESS;
435 }

◆ createEventContext()

EventContext ApplicationMgr::createEventContext ( )
override

implementation of IEventProcessor::createEventContext()

Definition at line 830 of file ApplicationMgr.cpp.

830  {
832  if ( m_processingMgr ) { return m_processingMgr->createEventContext(); }
833  }
835  ss << "createEventContext: Invalid state \"" << FSMState() << '"';
836  throw GaudiException( ss.str(), name(), StatusCode::FAILURE );
837 }

◆ createSvcNameListHandler()

void ApplicationMgr::createSvcNameListHandler ( Gaudi::Details::PropertyBase )

Definition at line 936 of file ApplicationMgr.cpp.

936  {
937  if ( !( decodeCreateSvcNameList() ).isSuccess() ) {
938  throw GaudiException( "Failed to create ext services", "MinimalEventLoopMgr::createSvcNameListHandler",
940  }
941 }

◆ decodeCreateSvcNameList()

StatusCode ApplicationMgr::decodeCreateSvcNameList ( )

Definition at line 945 of file ApplicationMgr.cpp.

945  {
947  const auto& theNames = m_createSvcNameList.value();
948  auto it = theNames.begin();
949  auto et = theNames.end();
950  while ( result.isSuccess() && it != et ) {
951  Gaudi::Utils::TypeNameString item( *it++ );
952  if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
954  log << MSG::ERROR << "decodeCreateSvcNameList: Cannot create service " << item.type() << "/" << item.name()
955  << endmsg;
956  } else {
957  ON_DEBUG {
959  log << MSG::DEBUG << "decodeCreateSvcNameList: Created service " << item.type() << "/" << item.name() << endmsg;
960  }
961  }
962  }
963  return result;
964 }

◆ decodeDllNameList()

StatusCode ApplicationMgr::decodeDllNameList ( )

Definition at line 1017 of file ApplicationMgr.cpp.

1017  {
1018 
1021 
1022  // Clean up multiple entries from DLL list
1023  // -------------------------------------------------------------------------
1024  std::vector<std::string> newList;
1025  std::map<std::string, unsigned int> dllInList, duplicateList;
1026  {
1027  for ( const auto& it : m_dllNameList ) {
1028  if ( 0 == dllInList[it] ) {
1029  newList.push_back( it ); // first instance of this module
1030  } else {
1031  ++duplicateList[it];
1032  } // module listed multiple times
1033  ++dllInList[it]; // increment count for this module
1034  }
1035  }
1036  // m_dllNameList = newList; // update primary list to new, filtered list (do not use the
1037  // property itself otherwise we get called again infinitely)
1038  // List modules that were in there twice..
1039  ON_DEBUG if ( !duplicateList.empty() ) {
1040  log << MSG::DEBUG << "Removed duplicate entries for modules : ";
1041  for ( auto it = duplicateList.begin(); it != duplicateList.end(); ++it ) {
1042  log << it->first << "(" << 1 + it->second << ")";
1043  if ( it != --duplicateList.end() ) log << ", ";
1044  }
1045  log << endmsg;
1046  }
1047  // -------------------------------------------------------------------------
1048 
1049  const std::vector<std::string>& theNames = newList;
1050 
1051  // only load the new dlls or previously failed dlls
1052  ON_DEBUG log << MSG::DEBUG << "Loading declared DLL's" << endmsg;
1053 
1054  std::vector<std::string> successNames, failNames;
1055  for ( const auto& it : theNames ) {
1056  if ( std::find( m_okDlls.rbegin(), m_okDlls.rend(), it ) == m_okDlls.rend() ) {
1057  // found a new module name
1058  StatusCode status = m_classManager->loadModule( it );
1059  if ( status.isFailure() ) {
1060  failNames.push_back( it );
1061  result = StatusCode::FAILURE;
1062  } else {
1063  successNames.push_back( it );
1064  }
1065  }
1066  }
1067 
1068  // report back to the user and store the names of the succesfully loaded dlls
1069  if ( !successNames.empty() ) {
1070  log << MSG::INFO << "Successfully loaded modules : ";
1071  for ( auto it = successNames.begin(); it != successNames.end(); it++ ) {
1072  log << ( *it );
1073  if ( ( it + 1 ) != successNames.end() ) log << ", ";
1074  // save name
1075  m_okDlls.push_back( *it );
1076  }
1077  log << endmsg;
1078  }
1079 
1080  if ( result == StatusCode::FAILURE ) {
1081  log << MSG::WARNING << "Failed to load modules: ";
1082  for ( auto it = failNames.begin(); it != failNames.end(); it++ ) {
1083  log << ( *it );
1084  if ( ( it + 1 ) != failNames.end() ) log << ", ";
1085  }
1086  log << endmsg;
1087  }
1088  return result;
1089 }

◆ decodeExtSvcNameList()

StatusCode ApplicationMgr::decodeExtSvcNameList ( )

Definition at line 979 of file ApplicationMgr.cpp.

979  {
981 
982  const auto& theNames = m_extSvcNameList.value();
983 
984  auto it = theNames.begin();
985  auto et = theNames.end();
986  while ( result.isSuccess() && it != et ) {
987  Gaudi::Utils::TypeNameString item( *it++ );
988  if ( m_extSvcCreates ) {
989  if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
991  log << MSG::ERROR << "decodeExtSvcNameList: Cannot create service " << item.type() << "/" << item.name()
992  << endmsg;
993  }
994  } else {
995  if ( ( result = svcManager()->declareSvcType( item.name(), item.type() ) ).isFailure() ) {
997  log << MSG::ERROR << "decodeExtSvcNameList: Cannot declare service " << item.type() << "/" << item.name()
998  << endmsg;
999  }
1000  }
1001  }
1002  return result;
1003 }

◆ dllNameListHandler()

void ApplicationMgr::dllNameListHandler ( Gaudi::Details::PropertyBase theProp)

Definition at line 1008 of file ApplicationMgr.cpp.

1008  {
1009  if ( !( decodeDllNameList() ).isSuccess() ) {
1010  throw GaudiException( "Failed to load DLLs.", "MinimalEventLoopMgr::dllNameListHandler", StatusCode::FAILURE );
1011  }
1012 }

◆ empty()

bool ApplicationMgr::empty ( ) const
override

Definition at line 822 of file ApplicationMgr.cpp.

◆ evtLoopPropertyHandler()

void ApplicationMgr::evtLoopPropertyHandler ( Gaudi::Details::PropertyBase theProp)

Definition at line 926 of file ApplicationMgr.cpp.

926  {
927  if ( m_processingMgr ) {
928  auto props = m_processingMgr.as<IProperty>();
929  if ( props ) props->setProperty( p ).ignore();
930  }
931 }

◆ executeEvent()

StatusCode ApplicationMgr::executeEvent ( EventContext &&  ctx)
override

implementation of IEventProcessor::executeEvent(void*)

Definition at line 808 of file ApplicationMgr.cpp.

808  {
810  if ( m_processingMgr ) { return m_processingMgr->executeEvent( std::move( ctx ) ); }
811  }
813  log << MSG::FATAL << "executeEvent: Invalid state \"" << FSMState() << "\"" << endmsg;
814  return StatusCode::FAILURE;
815 }

◆ executeRun()

StatusCode ApplicationMgr::executeRun ( int  evtmax)
override

implementation of IEventProcessor::executeRun(int)

Definition at line 841 of file ApplicationMgr.cpp.

841  {
844  if ( m_processingMgr ) { return m_processingMgr->executeRun( evtmax ); }
845  log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
846  return StatusCode::SUCCESS;
847  }
848  log << MSG::FATAL << "executeRun: Invalid state \"" << FSMState() << "\"" << endmsg;
849  return StatusCode::FAILURE;
850 }

◆ extSvcNameListHandler()

void ApplicationMgr::extSvcNameListHandler ( Gaudi::Details::PropertyBase theProp)

Definition at line 969 of file ApplicationMgr.cpp.

969  {
970  if ( !( decodeExtSvcNameList() ).isSuccess() ) {
971  throw GaudiException( "Failed to declare ext services", "MinimalEventLoopMgr::extSvcNameListHandler",
973  }
974 }

◆ finalize()

StatusCode ApplicationMgr::finalize ( )
override

Definition at line 587 of file ApplicationMgr.cpp.

587  {
590  log << MSG::INFO << "Already Finalized" << endmsg;
591  return StatusCode::SUCCESS;
592  }
594  log << MSG::FATAL << "finalize: Invalid state \"" << m_state << "\"" << endmsg;
595  return StatusCode::FAILURE;
596  }
598 
599  // disable message suppression in finalize
600  m_svcLocator->service<IProperty>( "MessageSvc" )
601  ->setProperty( Gaudi::Property<bool>( "enableSuppression", false ) )
602  .ignore();
603 
604  // Finalize independently managed Algorithms
605  StatusCode sc = algManager()->finalize();
606  if ( sc.isFailure() ) {
607  log << MSG::WARNING << "Failed to finalize an algorithm." << endmsg;
609  }
610 
611  // Finalize all Services
612  sc = svcManager()->finalize();
613  if ( sc.isFailure() ) {
614  log << MSG::WARNING << "Failed to finalize a service." << endmsg;
616  }
617 
618  // svcManager()->removeService( (IService*) m_processingMgr.get() );
619  // svcManager()->removeService( (IService*) m_runable.get() );
620 
621  if ( sc.isSuccess() ) {
622  log << MSG::INFO << "Application Manager Finalized successfully" << endmsg;
623  } else {
624  log << MSG::ERROR << "Application Manager failed to finalize" << endmsg;
625  }
626 
628  return sc;
629 }

◆ FSMState()

Gaudi::StateMachine::State ApplicationMgr::FSMState ( ) const
override

Definition at line 869 of file ApplicationMgr.cpp.

869 { return m_state; }

◆ getManager()

template<class I >
SmartIF<IComponentManager>& ApplicationMgr::getManager ( )
inline

Definition at line 132 of file ApplicationMgr.h.

132  {
133  return m_managers[I::interfaceID().id()];
134  }

◆ GoToState()

StatusCode ApplicationMgr::GoToState ( Gaudi::StateMachine::State  state,
bool  ignoreFailures = false 
)
protected

Reach a state from current state (whichever it is) going through the correct transitions.

By default, if a transition fails, the chain is interrupted, but the behavior can be changed with the parameter "gnoreFailures"

Definition at line 696 of file ApplicationMgr.cpp.

696  {
698 
699  switch ( state ) {
700 
702  switch ( m_state ) {
704  return StatusCode::SUCCESS;
705  break;
707  return terminate();
708  break;
709  default: // Gaudi::StateMachine::INITIALIZED or Gaudi::StateMachine::RUNNING
711  if ( sc.isSuccess() ) { return terminate(); }
712  break;
713  }
714  break;
715 
717  switch ( m_state ) {
719  return StatusCode::SUCCESS;
720  break;
722  return configure();
723  break;
725  return finalize();
726  break;
727  default: // Gaudi::StateMachine::RUNNING
729  if ( sc.isSuccess() ) { return finalize(); }
730  break;
731  }
732  break;
733 
735  switch ( m_state ) {
737  return StatusCode::SUCCESS;
738  break;
740  return initialize();
741  break;
743  return stop();
744  break;
745  default: // Gaudi::StateMachine::OFFLINE
747  if ( sc.isSuccess() ) { return initialize(); }
748  break;
749  }
750  break;
751 
753  switch ( m_state ) {
755  return StatusCode::SUCCESS;
756  break;
758  return start();
759  break;
760  default: // Gaudi::StateMachine::OFFLINE or Gaudi::StateMachine::CONFIGURED
762  if ( sc.isSuccess() ) { return start(); }
763  break;
764  }
765  break;
766  }
767 
768  // If I get here, there has been a problem in the recursion
769 
770  if ( ignoreFailures ) {
771  // force the new state
772  m_state = state;
773  return StatusCode::SUCCESS;
774  }
775 
776  return sc;
777 }

◆ i_delegateToEvtProc()

template<typename SELF , typename PIMPL , typename METHOD , typename... ARGS>
static auto ApplicationMgr::i_delegateToEvtProc ( SELF *  self,
PIMPL &  member,
std::string_view  method_name,
METHOD &&  method,
ARGS &&...  args 
)
inlinestaticprivate

Helper to delegate calls to event processor implementation.

Definition at line 324 of file ApplicationMgr.h.

325  {
326  if ( self->m_state == Gaudi::StateMachine::RUNNING ) {
327  if ( bool( member ) ) {
328  return std::invoke( method, *member.get(), std::forward<ARGS>( args )... );
329  } else {
331  s << method_name << ": event processor is not a \""
332  << System::typeinfoName( typeid( decltype( *member.get() ) ) ) << '"';
333  throw GaudiException{ s.str(), self->name(), StatusCode::FAILURE };
334  }
335  }
337  s << method_name << ": Invalid state \"" << self->FSMState() << '"';
338  throw GaudiException{ s.str(), self->name(), StatusCode::FAILURE };
339  }

◆ i_startup()

StatusCode ApplicationMgr::i_startup ( )
protected

Internal startup routine.

Definition at line 150 of file ApplicationMgr.cpp.

150  {
151 
152  StatusCode sc;
153 
154  // declare factories in current module
155  m_classManager->loadModule( "" ).ignore();
156 
157  // Note: we cannot use CommonMessaging methods here because MessageSvc is not there yet
158  MsgStream log( nullptr, name() );
159 
160  // Create the Message service
161  auto msgsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "MessageSvc", m_messageSvcType ) );
162  if ( !msgsvc ) {
163  log << MSG::FATAL << "Error creating MessageSvc of type " << m_messageSvcType << endmsg;
164  return StatusCode::FAILURE;
165  }
166  // Get the useful interface from Message services
167  m_messageSvc = m_svcLocator->service( "MessageSvc" );
168  if ( !m_messageSvc ) {
169  log << MSG::FATAL << "Error retrieving MessageSvc." << endmsg;
170  return StatusCode::FAILURE;
171  }
172  sc = m_messageSvc.as<IProperty>()->setProperty( "OutputLevel", m_outputLevel );
173  if ( !sc ) {
174  log << MSG::FATAL << "Error setting OutputLevel option of MessageSvc" << endmsg;
175  return sc;
176  }
178  if ( gROOT ) {
179  // if ROOT is already initialized (usually it is the case) we redirect messages to MessageSvc.
180  s_messageSvcInstance = m_messageSvc.get();
181  s_originalRootErrorHandler = SetErrorHandler( ROOTErrorHandlerAdapter );
182  } else {
183  log << MSG::WARNING
184  << "ROOT not yet initialized, we cannot override the error handler are requested "
185  "(UseMessageSvcForROOTMessages==true)"
186  << endmsg;
187  }
188  }
189 
190  auto jobsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "JobOptionsSvc", m_jobOptionsSvcType ) );
191  // Create the Job Options service
192  if ( !jobsvc ) {
193  log << MSG::FATAL << "Error creating JobOptionsSvc" << endmsg;
194  return StatusCode::FAILURE;
195  }
196 
197  auto jobOptsIProp = jobsvc.as<IProperty>();
198  if ( !jobOptsIProp ) {
199  log << MSG::FATAL << "Error locating JobOptionsSvc" << endmsg;
200  return StatusCode::FAILURE;
201  }
202  sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "TYPE", m_jobOptionsType ) );
203  if ( !sc.isSuccess() ) {
204  log << MSG::FATAL << "Error setting TYPE option in JobOptionsSvc" << endmsg;
205  return sc;
206  }
207 
208  if ( !m_jobOptionsPreAction.empty() ) {
209  sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONPARAMS", m_jobOptionsPreAction ) );
210  if ( !sc.isSuccess() ) {
211  log << MSG::FATAL << "Error setting JobOptionsPreAction option in JobOptionsSvc" << endmsg;
212  return sc;
213  }
214  }
215 
216  if ( !m_jobOptionsPostAction.empty() ) {
217  sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONACTION", m_jobOptionsPostAction ) );
218  if ( !sc.isSuccess() ) {
219  log << MSG::FATAL << "Error setting JobOptionsPostAction option in JobOptionsSvc" << endmsg;
220  return sc;
221  }
222  }
223 
224  if ( !m_jobOptionsPath.empty() ) { // The command line takes precedence
225  sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", m_jobOptionsPath ) );
226  if ( !sc.isSuccess() ) {
227  log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc" << endmsg;
228  return sc;
229  }
230  } else if ( isEnvSet( "JOBOPTPATH" ) ) { // Otherwise the Environment JOBOPTPATH
231  sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", getEnv( "JOBOPTPATH" ) ) );
232  if ( !sc.isSuccess() ) {
233  log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc from env" << endmsg;
234  return sc;
235  }
236  } else { // Otherwise the default
237  sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", "../options/job.opts" ) );
238  if ( !sc.isSuccess() ) {
239  log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc to default" << endmsg;
240  return sc;
241  }
242  }
243  jobOptsIProp.reset();
244 
245  // Sets my default the Output Level of the Message service to be
246  // the same as this
247  auto msgSvcIProp = msgsvc.as<IProperty>();
248  msgSvcIProp->setProperty( Gaudi::Property<int>( "OutputLevel", m_outputLevel ) ).ignore();
249  msgSvcIProp.reset();
250 
251  sc = jobsvc->sysInitialize();
252  if ( !sc.isSuccess() ) {
253  log << MSG::FATAL << "Error initializing JobOptionsSvc" << endmsg;
254  return sc;
255  }
256  sc = msgsvc->sysInitialize();
257  if ( !sc.isSuccess() ) {
258  log << MSG::FATAL << "Error initializing MessageSvc" << endmsg;
259  return sc;
260  }
261 
262  // Make sure output level caches are up to date.
264 
265  return sc;
266 }

◆ initialize()

StatusCode ApplicationMgr::initialize ( )
override

Definition at line 440 of file ApplicationMgr.cpp.

440  {
441  StatusCode sc;
442 
444 
445  // Make sure output level caches are up to date.
447 
448  // I cannot add these services in configure() because they are coming from GaudiUtils
449  // and it messes up genconf when rebuilding it.
450  if ( m_stopOnSignal ) {
451  // Instantiate the service that schedules a stop when a signal is received
452  std::string svcname( "Gaudi::Utils::StopSignalHandler" );
453  sc = svcManager()->addService( svcname );
454  if ( sc.isFailure() ) {
455  log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
456  }
457  }
458 
459  if ( m_stalledEventMonitoring ) {
460  // Instantiate the service that schedules a stop when a signal is received
461  std::string svcname( "StalledEventMonitor" );
462  sc = svcManager()->addService( svcname );
463  if ( sc.isFailure() ) {
464  log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
465  }
466  }
467 
469  log << MSG::INFO << "Already Initialized!" << endmsg;
470  return StatusCode::SUCCESS;
471  }
473  log << MSG::FATAL << "initialize: Invalid state \"" << m_state << "\"" << endmsg;
474  return StatusCode::FAILURE;
475  }
477 
478  //--------------------------------------------------------------------------
479  // Initialize the list of top Services
480  //--------------------------------------------------------------------------
481  sc = svcManager()->initialize();
482  if ( !sc.isSuccess() ) return sc;
483 
484  sc = algManager()->initialize();
485  if ( !sc.isSuccess() ) return sc;
486 
487  //--------------------------------------------------------------------------
488  // Final steps: Inform user and change internal state
489  //--------------------------------------------------------------------------
490  log << MSG::INFO << "Application Manager Initialized successfully" << endmsg;
492 
494 
495  return sc;
496 }

◆ monitoringHub()

Gaudi::Monitoring::Hub& ApplicationMgr::monitoringHub ( )
inlineoverride

Definition at line 154 of file ApplicationMgr.h.

154 { return m_monitoringHub; }

◆ name()

const std::string & ApplicationMgr::name ( ) const
override

Definition at line 866 of file ApplicationMgr.cpp.

866 { return m_name; }

◆ nextEvent()

StatusCode ApplicationMgr::nextEvent ( int  maxevt)
override

Definition at line 535 of file ApplicationMgr.cpp.

535  {
538  log << MSG::FATAL << "nextEvent: Invalid state \"" << m_state << "\"" << endmsg;
539  return StatusCode::FAILURE;
540  }
541  if ( !m_processingMgr ) {
543  log << MSG::FATAL << "No event processing manager specified. Check option: " << m_eventLoopMgr.name() << endmsg;
544  return StatusCode::FAILURE;
545  }
546  return m_processingMgr->nextEvent( maxevt );
547 }

◆ outputLevelUpdate()

void ApplicationMgr::outputLevelUpdate ( )
override

Function to call to update the outputLevel of the components (after a change in MessageSvc).

Definition at line 1091 of file ApplicationMgr.cpp.

1091  {
1092  resetMessaging();
1093  for ( auto& mgrItem : m_managers ) { mgrItem.second->outputLevelUpdate(); }
1094 }

◆ pluginDebugPropertyHandler()

void ApplicationMgr::pluginDebugPropertyHandler ( Gaudi::Details::PropertyBase theProp)

◆ pop()

std::optional< Gaudi::Interfaces::IQueueingEventProcessor::ResultType > ApplicationMgr::pop ( )
override

Definition at line 826 of file ApplicationMgr.cpp.

◆ printAlgsSequences()

void ApplicationMgr::printAlgsSequences ( )

Print the sequence of algorithms that have been loaded.

Definition at line 1117 of file ApplicationMgr.cpp.

1117  {
1119  log << MSG::ALWAYS << "****************************** Algorithm Sequence ****************************" << endmsg;
1120  for ( auto& algname : m_topAlgNameList ) { printAlgsSequencesHelper( algManager(), algname, log, 0 ); }
1121  log << MSG::ALWAYS << "******************************************************************************" << endmsg;
1122 }

◆ push()

void ApplicationMgr::push ( EventContext &&  ctx)
override

Definition at line 817 of file ApplicationMgr.cpp.

◆ queryInterface()

StatusCode ApplicationMgr::queryInterface ( const InterfaceID iid,
void **  pinterface 
)
override

Definition at line 124 of file ApplicationMgr.cpp.

124  {
125  if ( !ppvi ) { return StatusCode::FAILURE; }
126 
127  // try to find own/direct interfaces:
128  StatusCode sc = base_class::queryInterface( iid, ppvi );
129  if ( sc.isSuccess() ) return sc;
130 
131  // find indirect interfaces :
132  if ( ISvcLocator::interfaceID().versionMatch( iid ) ) { return serviceLocator()->queryInterface( iid, ppvi ); }
133  if ( ISvcManager::interfaceID().versionMatch( iid ) ) { return svcManager()->queryInterface( iid, ppvi ); }
134  if ( IAlgManager::interfaceID().versionMatch( iid ) ) { return algManager()->queryInterface( iid, ppvi ); }
135  if ( IClassManager::interfaceID().versionMatch( iid ) ) { return m_classManager->queryInterface( iid, ppvi ); }
136  if ( IMessageSvc::interfaceID().versionMatch( iid ) ) {
137  *ppvi = m_messageSvc.get();
138  if ( m_messageSvc ) m_messageSvc->addRef();
139  // Note that 0 can be a valid IMessageSvc pointer value (when used for
140  // MsgStream).
141  return StatusCode::SUCCESS;
142  }
143  *ppvi = nullptr;
144  return StatusCode::FAILURE;
145 }

◆ reinitialize()

StatusCode ApplicationMgr::reinitialize ( )
override

Definition at line 876 of file ApplicationMgr.cpp.

876  {
879  StatusCode sc;
881  throw GaudiException( "Cannot reinitialize application if not INITIALIZED or RUNNING",
882  "ApplicationMgr::reinitialize", StatusCode::FAILURE );
883  }
885  sc = svcManager()->reinitialize();
886  if ( sc.isFailure() ) retval = sc;
887  sc = algManager()->reinitialize();
888  if ( sc.isFailure() ) retval = sc;
889 
891  if ( sc.isFailure() ) retval = sc;
892  sc = m_svcLocator->service( "JobOptionsSvc" )->sysReinitialize();
893  if ( sc.isFailure() ) retval = sc;
894 
895  log << MSG::INFO << "Application Manager Reinitialized successfully" << endmsg;
896 
897  return retval;
898 }

◆ restart()

StatusCode ApplicationMgr::restart ( )
override

Definition at line 903 of file ApplicationMgr.cpp.

903  {
905  StatusCode sc;
907  throw GaudiException( "Cannot restart application if not RUNNING", "ApplicationMgr::restart", StatusCode::FAILURE );
908  }
909 
910  sc = svcManager()->restart();
911  if ( sc.isFailure() ) retval = sc;
912  sc = algManager()->restart();
913  if ( sc.isFailure() ) retval = sc;
914 
915  sc = m_messageSvc.as<IService>()->sysRestart();
916  if ( sc.isFailure() ) retval = sc;
917  sc = m_svcLocator->service( "JobOptionsSvc" )->sysRestart();
918  if ( sc.isFailure() ) retval = sc;
919 
920  return retval;
921 }

◆ run()

StatusCode ApplicationMgr::run ( )
override

Definition at line 782 of file ApplicationMgr.cpp.

782  {
784 
786  if ( sc.isSuccess() ) {
788  if ( m_runable != 0 ) { // loop over the events
789  sc = m_runable->run();
790  if ( !sc.isSuccess() ) { log << MSG::FATAL << "Application execution failed. Ending the job." << endmsg; }
791  } else {
792  log << MSG::FATAL << "Application has no runable object. Check option:" << m_runableType.name() << endmsg;
793  }
794  }
795  if ( sc.isSuccess() ) { // try to close cleanly
797  }
798  // either the runable failed of the stut-down
799  if ( sc.isFailure() ) { // try to close anyway (but keep the StatusCode unchanged)
801  }
802  return sc;
803 }

◆ serviceLocator()

SmartIF<ISvcLocator>& ApplicationMgr::serviceLocator ( ) const
inlineoverride

Needed to locate the message service.

Definition at line 149 of file ApplicationMgr.h.

149 { return m_svcLocator; }

◆ setServiceManager()

void ApplicationMgr::setServiceManager ( ISvcManager )
inlineoverrideprotected

Definition at line 161 of file ApplicationMgr.h.

161 {}

◆ start()

StatusCode ApplicationMgr::start ( )
override

Definition at line 501 of file ApplicationMgr.cpp.

501  {
502 
504 
506  log << MSG::INFO << "Already Initialized!" << endmsg;
507  return StatusCode::SUCCESS;
508  }
510  log << MSG::FATAL << "start: Invalid state \"" << m_state << "\"" << endmsg;
511  return StatusCode::FAILURE;
512  }
514 
515  //--------------------------------------------------------------------------
516  // Initialize the list of top Services
517  //--------------------------------------------------------------------------
518  return m_svcLocator->service( "JobOptionsSvc" )
519  ->sysStart()
520  .andThen( [&]() { return m_messageSvc.as<IService>()->sysStart(); } )
521  .andThen( [&]() { return svcManager()->start(); } )
522  .andThen( [&]() { return algManager()->start(); } )
523  .andThen( [&]() {
524  //--------------------------------------------------------------------------
525  // Final steps: Inform user and change internal state
526  //--------------------------------------------------------------------------
527  log << MSG::INFO << "Application Manager Started successfully" << endmsg;
529  } );
530 }

◆ stop()

StatusCode ApplicationMgr::stop ( )
override

Definition at line 552 of file ApplicationMgr.cpp.

552  {
553 
555 
557  log << MSG::INFO << "Already Initialized!" << endmsg;
558  return StatusCode::SUCCESS;
559  }
561  log << MSG::FATAL << "stop: Invalid state \"" << m_state << "\"" << endmsg;
562  return StatusCode::FAILURE;
563  }
565 
566  // Stop independently managed Algorithms
567  return algManager()
568  ->stop()
569  //--------------------------------------------------------------------------
570  // Stop the list of top Services
571  //--------------------------------------------------------------------------
572  .andThen( [&]() { return svcManager()->stop(); } )
573  .andThen( [&]() { return m_messageSvc.as<IService>()->sysStop(); } )
574  .andThen( [&]() { return m_svcLocator->service( "JobOptionsSvc" )->sysStop(); } )
575  //--------------------------------------------------------------------------
576  // Final steps: Inform user and change internal state
577  //--------------------------------------------------------------------------
578  .andThen( [&]() {
579  log << MSG::INFO << "Application Manager Stopped successfully" << endmsg;
581  } );
582 }

◆ stopRun()

StatusCode ApplicationMgr::stopRun ( )
override

implementation of IEventProcessor::stopRun()

Definition at line 855 of file ApplicationMgr.cpp.

855  {
858  if ( m_processingMgr ) { return m_processingMgr->stopRun(); }
859  log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
860  return StatusCode::SUCCESS;
861  }
862  log << MSG::FATAL << "stopRun: Invalid state \"" << FSMState() << "\"" << endmsg;
863  return StatusCode::FAILURE;
864 }

◆ svcManager()

SmartIF<ISvcManager>& ApplicationMgr::svcManager ( )
inline

Definition at line 136 of file ApplicationMgr.h.

136  {
137  // Cache the casted pointer to ISvcManager
138  if ( !m_svcManager ) { m_svcManager = getManager<IService>(); }
139  return m_svcManager;
140  }

◆ sysFinalize()

StatusCode ApplicationMgr::sysFinalize ( )
inlineoverride

Definition at line 107 of file ApplicationMgr.h.

107 { return StatusCode::SUCCESS; }

◆ sysInitialize()

StatusCode ApplicationMgr::sysInitialize ( )
inlineoverride

Definition at line 101 of file ApplicationMgr.h.

101 { return StatusCode::SUCCESS; }

◆ sysReinitialize()

StatusCode ApplicationMgr::sysReinitialize ( )
inlineoverride

Definition at line 109 of file ApplicationMgr.h.

109 { return StatusCode::SUCCESS; }

◆ sysRestart()

StatusCode ApplicationMgr::sysRestart ( )
inlineoverride

Definition at line 111 of file ApplicationMgr.h.

111 { return StatusCode::SUCCESS; }

◆ sysStart()

StatusCode ApplicationMgr::sysStart ( )
inlineoverride

Definition at line 103 of file ApplicationMgr.h.

103 { return StatusCode::SUCCESS; }

◆ sysStop()

StatusCode ApplicationMgr::sysStop ( )
inlineoverride

Definition at line 105 of file ApplicationMgr.h.

105 { return StatusCode::SUCCESS; }

◆ targetFSMState()

Gaudi::StateMachine::State ApplicationMgr::targetFSMState ( ) const
override

Definition at line 871 of file ApplicationMgr.cpp.

871 { return m_targetState; }

◆ terminate()

StatusCode ApplicationMgr::terminate ( )
override

Definition at line 634 of file ApplicationMgr.cpp.

634  {
636 
638  log << MSG::INFO << "Already Offline" << endmsg;
639  return StatusCode::SUCCESS;
640  }
642  log << MSG::FATAL << "terminate: Invalid state \"" << m_state << "\"" << endmsg;
643  return StatusCode::FAILURE;
644  }
645  // release all Services
647 
649  log << MSG::INFO << "Application Manager Terminated successfully" << endmsg;
651  log << MSG::INFO << "Application Manager Terminated successfully with a user requested ScheduledStop" << endmsg;
652  } else {
653  log << MSG::ERROR << "Application Manager Terminated with error code " << m_returnCode.value() << endmsg;
654  }
655 
656  {
657  auto& opts = m_svcLocator->getOptsSvc();
658  // Force a disable the auditing of finalize for MessageSvc
659  opts.set( "MessageSvc.AuditFinalize", "false" );
660  // Force a disable the auditing of finalize for JobOptionsSvc
661  opts.set( "JobOptionsSvc.AuditFinalize", "false" );
662  }
663 
664  // if we have overriden it, restore the original ROOT error handler
665  if ( s_originalRootErrorHandler ) {
666  SetErrorHandler( s_originalRootErrorHandler );
667  s_originalRootErrorHandler = nullptr;
668  }
669  // make sure ROOTErrorHandlerAdapter (if in use) does not try to use the MessageSvc we are about to delete
670  s_messageSvcInstance = nullptr;
671  // finalize MessageSvc
672  auto svc = m_messageSvc.as<IService>();
673  if ( !svc ) {
674  log << MSG::ERROR << "Could not get the IService interface of the MessageSvc" << endmsg;
675  } else {
676  svc->sysFinalize().ignore();
677  svcManager()->removeService( svc ).ignore();
678  }
679 
680  // finalize JobOptionsSvc
681  svc = m_svcLocator->service( "JobOptionsSvc" );
682  if ( !svc ) {
683  log << MSG::ERROR << "Could not get the IService interface of the JobOptionsSvc" << endmsg;
684  } else {
685  svc->sysFinalize().ignore();
686  svcManager()->removeService( svc ).ignore();
687  }
688 
690  return StatusCode::SUCCESS;
691 }

Member Data Documentation

◆ m_actHistory

Gaudi::Property<bool> ApplicationMgr::m_actHistory { this, "ActivateHistory", false, "Activate HistorySvc" }
protected

Definition at line 264 of file ApplicationMgr.h.

◆ m_algManager

SmartIF<IAlgManager> ApplicationMgr::m_algManager
protected

Cached pointer to the manager of algorithms.

Definition at line 186 of file ApplicationMgr.h.

◆ m_appName

Gaudi::Property<std::string> ApplicationMgr::m_appName { this, "AppName", "ApplicationMgr", "The name of the application" }
protected

Definition at line 262 of file ApplicationMgr.h.

◆ m_appVersion

Gaudi::Property<std::string> ApplicationMgr::m_appVersion { this, "AppVersion", {}, "The version of the application" }
protected

Definition at line 263 of file ApplicationMgr.h.

◆ m_auditAlgs

Gaudi::Property<bool> ApplicationMgr::m_auditAlgs { this, "AuditAlgorithms", false }
protected

Definition at line 284 of file ApplicationMgr.h.

◆ m_auditSvcs

Gaudi::Property<bool> ApplicationMgr::m_auditSvcs { this, "AuditServices", false }
protected

Definition at line 283 of file ApplicationMgr.h.

◆ m_auditTools

Gaudi::Property<bool> ApplicationMgr::m_auditTools { this, "AuditTools", false }
protected

Defaults for auditors.

Definition at line 282 of file ApplicationMgr.h.

◆ m_classManager

SmartIF<DLLClassManager> ApplicationMgr::m_classManager
protected

Reference to the class manager.

Definition at line 191 of file ApplicationMgr.h.

◆ m_createSvcNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_createSvcNameList
protected
Initial value:
{
this, "CreateSvc", {}, "List of extra services to be created" }

Definition at line 278 of file ApplicationMgr.h.

◆ m_declaredManagers

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_declaredManagers
protected

Property to declare the list of known managers.

Definition at line 180 of file ApplicationMgr.h.

◆ m_dllNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_dllNameList { this, "Dlls", {}, "List of DDL's names" }
protected

Definition at line 250 of file ApplicationMgr.h.

◆ m_environment

Gaudi::Property<std::map<std::string, std::string> > ApplicationMgr::m_environment
protected
Initial value:
{
this, "Environment", {}, "Environment variables to set" }

Definition at line 286 of file ApplicationMgr.h.

◆ m_eventLoopMgr

Gaudi::Property<std::string> ApplicationMgr::m_eventLoopMgr { this, "EventLoop", "EventLoopMgr", "Processing manager type" }
protected

Definition at line 258 of file ApplicationMgr.h.

◆ m_evtMax

Gaudi::Property<int> ApplicationMgr::m_evtMax { this, "EvtMax", -1, "Number of events to be processed (-1 means all events)" }
protected

Definition at line 244 of file ApplicationMgr.h.

◆ m_evtsel

Gaudi::Property<std::string> ApplicationMgr::m_evtsel { this, "EvtSel", {}, "Event selection" }
protected

Definition at line 259 of file ApplicationMgr.h.

◆ m_extSvcCreates

Gaudi::Property<bool> ApplicationMgr::m_extSvcCreates
protected
Initial value:
{ this, "ExtSvcCreates", true,
"LHCb (default) or ATLAS definition of \"ExtSvc\"" }

Definition at line 247 of file ApplicationMgr.h.

◆ m_extSvcNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_extSvcNameList
protected
Initial value:
{
this, "ExtSvc", {}, "List of external services names", "vector<Service>" }

Definition at line 245 of file ApplicationMgr.h.

◆ m_histPersName

Gaudi::Property<std::string> ApplicationMgr::m_histPersName { this, "HistogramPersistency", "NONE", "Name of the Hist Pers Svc" }
protected

Definition at line 260 of file ApplicationMgr.h.

◆ m_jobOptionsPath

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPath { this, "JobOptionsPath", {}, "The \"file\" to look for properties" }
protected

Definition at line 252 of file ApplicationMgr.h.

◆ m_jobOptionsPostAction

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPostAction
protected
Initial value:
{
this, "JobOptionsPreAction", {}, "additional command to run on config" }

Definition at line 255 of file ApplicationMgr.h.

◆ m_jobOptionsPreAction

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPreAction
protected
Initial value:
{
this, "JobOptionsPostAction", {}, "additional command to run on config" }

Definition at line 253 of file ApplicationMgr.h.

◆ m_jobOptionsSvcType

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsSvcType
protected
Initial value:
{ this, "JobOptionsSvcType", "JobOptionsSvc", "JobOptionsSvc type",
"Service:Gaudi::Interfaces::IOptionsSvc" }

Definition at line 221 of file ApplicationMgr.h.

◆ m_jobOptionsType

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsType { this, "JobOptionsType", "FILE", "Source type (e.g. dbase, file...)" }
protected

Definition at line 251 of file ApplicationMgr.h.

◆ m_loopCheck

Gaudi::Property<bool> ApplicationMgr::m_loopCheck
protected
Initial value:
{ this, "InitializationLoopCheck", true,
[this]( auto& ) { this->svcManager()->setLoopCheckEnabled( m_loopCheck ); },
"For ServiceMgr initialization loop checking" }

Definition at line 289 of file ApplicationMgr.h.

◆ m_managers

ManagersMap ApplicationMgr::m_managers
protected

Map of known component managers.

It contains (at least) the managers for IService and IAlgorithm. IAlgTool and IAuditor are not mandatory (but a missing manager for IAlgTool will probably not allow any job to run).

Definition at line 178 of file ApplicationMgr.h.

◆ m_messageSvc

SmartIF<IMessageSvc> ApplicationMgr::m_messageSvc
protected

Reference to the message service.

Definition at line 232 of file ApplicationMgr.h.

◆ m_messageSvcType

Gaudi::Property<std::string> ApplicationMgr::m_messageSvcType
protected
Initial value:
{ this, "MessageSvcType", "MessageSvc", "MessageSvc type",
"Service:IMessageSvc" }

Definition at line 219 of file ApplicationMgr.h.

◆ m_monitoringHub

Gaudi::Monitoring::Hub ApplicationMgr::m_monitoringHub
protected

Definition at line 238 of file ApplicationMgr.h.

◆ m_name

std::string ApplicationMgr::m_name = "ApplicationMgr"
protected

Name.

Definition at line 224 of file ApplicationMgr.h.

◆ m_okDlls

std::vector<std::string> ApplicationMgr::m_okDlls
private

names of successfully loaded dlls

Definition at line 320 of file ApplicationMgr.h.

◆ m_outputLevel

Gaudi::Property<int> ApplicationMgr::m_outputLevel { this, "OutputLevel", MSG::INFO, "Message output level" }
protected

Definition at line 261 of file ApplicationMgr.h.

◆ m_outStreamNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_outStreamNameList
protected
Initial value:
{
this, "OutStream", {}, &ApplicationMgr::evtLoopPropertyHandler, "List of output stream names" }

Definition at line 214 of file ApplicationMgr.h.

◆ m_outStreamType

Gaudi::Property<std::string> ApplicationMgr::m_outStreamType
protected
Initial value:
{ this, "OutStreamType", "OutputStream",
"[[deprecated]] Output stream type" }

Definition at line 216 of file ApplicationMgr.h.

◆ m_pluginDebugLevel

Gaudi::Property<int> ApplicationMgr::m_pluginDebugLevel
protected
Initial value:
{ this, "PluginDebugLevel", 0,
[this]( auto& ) {
<< "Updating Gaudi::PluginService::SetDebug(level) to level="
}
},
"Debug level for the plugin system" }

Definition at line 265 of file ApplicationMgr.h.

◆ m_printAlgsSequence

Gaudi::Property<bool> ApplicationMgr::m_printAlgsSequence
protected
Initial value:
{ this, "PrintAlgsSequence", false,
"Print the sequence of algorithms that have been loaded." }

Definition at line 310 of file ApplicationMgr.h.

◆ m_processingMgr

SmartIF<IEventProcessor> ApplicationMgr::m_processingMgr
protected

Reference to processing manager object.

Definition at line 234 of file ApplicationMgr.h.

◆ m_propertiesPrint

Gaudi::Property<bool> ApplicationMgr::m_propertiesPrint
protected
Initial value:
{ this, "PropertiesPrint", false,
"Flag to activate the printout of properties" }

Definition at line 303 of file ApplicationMgr.h.

◆ m_queueingProcessor

SmartIF<IQueueingEventProcessor> ApplicationMgr::m_queueingProcessor
protected

Reference to a queueing processing manager object.

Definition at line 236 of file ApplicationMgr.h.

◆ m_returnCode

Gaudi::Property<int> ApplicationMgr::m_returnCode
protected
Initial value:
{ this, "ReturnCode", Gaudi::ReturnCode::Success,
"Return code of the application. Set internally in case of error conditions." }

Property to record the error conditions occurring during the running.

Definition at line 307 of file ApplicationMgr.h.

◆ m_runable

SmartIF<IRunable> ApplicationMgr::m_runable
protected

Reference to the runable object.

Definition at line 233 of file ApplicationMgr.h.

◆ m_runableType

Gaudi::Property<std::string> ApplicationMgr::m_runableType { this, "Runable", "AppMgrRunable", "Runable type" }
protected

Definition at line 257 of file ApplicationMgr.h.

◆ m_SIExit

Gaudi::Property<int> ApplicationMgr::m_SIExit
protected
Initial value:
{ this, "Exit", 0,
[this]( auto& ) {
::exit( 0 );
},
"For SI's \"Exit\" command via callback" }

Definition at line 201 of file ApplicationMgr.h.

◆ m_SIGo

Gaudi::Property<int> ApplicationMgr::m_SIGo
protected
Initial value:
{ this, "Go", 0,
[this]( auto& ) {
this->reinitialize().ignore();
},
"For SI's \"Go\" command via callback" }

Definition at line 193 of file ApplicationMgr.h.

◆ m_stalledEventMonitoring

Gaudi::Property<bool> ApplicationMgr::m_stalledEventMonitoring
protected
Initial value:
{
this, "StalledEventMonitoring", false, "Flag to enable/disable the monitoring and reporting of stalled events" }

Property to enable/disable the monitoring and reporting of stalled events.

See also
StalledEventMonitor

Definition at line 300 of file ApplicationMgr.h.

◆ m_state

Gaudi::StateMachine::State ApplicationMgr::m_state = Gaudi::StateMachine::OFFLINE
protected

Internal State.

Definition at line 225 of file ApplicationMgr.h.

◆ m_stopOnSignal

Gaudi::Property<bool> ApplicationMgr::m_stopOnSignal
protected
Initial value:
{
this, "StopOnSignal", false, "Flag to enable/disable the signal handler that schedule a stop of the event loop" }

Property to enable/disable the "stop on signal" service.

See also
Gaudi::Utils::StopSignalHandler

Definition at line 295 of file ApplicationMgr.h.

◆ m_svcLocator

SmartIF<ISvcLocator> ApplicationMgr::m_svcLocator
mutableprotected

Reference to its own service locator (must be instantiated prior to any service!)

Definition at line 189 of file ApplicationMgr.h.

◆ m_svcManager

SmartIF<ISvcManager> ApplicationMgr::m_svcManager
protected

Cached pointer to the manager of services.

Definition at line 183 of file ApplicationMgr.h.

◆ m_svcMapping

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_svcMapping { this, "SvcMapping", {}, "Default mapping of services" }
protected

Definition at line 228 of file ApplicationMgr.h.

◆ m_svcOptMapping

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_svcOptMapping
protected
Initial value:
{
this, "SvcOptMapping", {}, "Default mapping of optional services" }

Definition at line 229 of file ApplicationMgr.h.

◆ m_targetState

Gaudi::StateMachine::State ApplicationMgr::m_targetState = Gaudi::StateMachine::OFFLINE
protected

Internal State.

Definition at line 226 of file ApplicationMgr.h.

◆ m_topAlgNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_topAlgNameList
protected
Initial value:
{ this,
"TopAlg",
{},
"List of top level algorithms names",
"vector<Algorithm>" }

Definition at line 208 of file ApplicationMgr.h.

◆ m_useHiveAlgorithmManager

bool ApplicationMgr::m_useHiveAlgorithmManager
protected

Definition at line 317 of file ApplicationMgr.h.

◆ m_useMessageSvcForROOTMessages

Gaudi::Property<bool> ApplicationMgr::m_useMessageSvcForROOTMessages
protected
Initial value:
{ this, "UseMessageSvcForROOTMessages", true,
"Replace ROOT error handler with MessageSvc." }

Definition at line 313 of file ApplicationMgr.h.


The documentation for this class was generated from the following files:
ApplicationMgr::printAlgsSequences
void printAlgsSequences()
Print the sequence of algorithms that have been loaded.
Definition: ApplicationMgr.cpp:1117
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:26
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:25
IService
Definition: IService.h:28
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: PropertyBase.h:39
ApplicationMgr::m_algManager
SmartIF< IAlgManager > m_algManager
Cached pointer to the manager of algorithms.
Definition: ApplicationMgr.h:186
Gaudi::Interfaces::IQueueingEventProcessor::pop
virtual std::optional< ResultType > pop()=0
Get the next available result.
Gaudi::ReturnCode::FinalizationFailure
constexpr int FinalizationFailure
Error codes for operation failures.
Definition: AppReturnCode.h:42
std::string
STL class.
ApplicationMgr::m_propertiesPrint
Gaudi::Property< bool > m_propertiesPrint
Definition: ApplicationMgr.h:303
Gaudi.Configuration.log
log
Definition: Configuration.py:30
std::move
T move(T... args)
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:1017
CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >::resetMessaging
MSG::Level resetMessaging()
Reinitialize internal states.
Definition: CommonMessaging.h:179
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
MSG::INFO
@ INFO
Definition: IMessageSvc.h:25
ApplicationMgr::outputLevelUpdate
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
Definition: ApplicationMgr.cpp:1091
ApplicationMgr::m_runable
SmartIF< IRunable > m_runable
Reference to the runable object.
Definition: ApplicationMgr.h:233
ApplicationMgr::i_startup
StatusCode i_startup()
Internal startup routine.
Definition: ApplicationMgr.cpp:150
ApplicationMgr::stop
StatusCode stop() override
Definition: ApplicationMgr.cpp:552
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:224
gaudirun.s
string s
Definition: gaudirun.py:348
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:388
ApplicationMgr::m_messageSvcType
Gaudi::Property< std::string > m_messageSvcType
Definition: ApplicationMgr.h:219
std::vector< std::string >
std::find
T find(T... args)
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
Definition: IProperty.h:39
GAUDI_MINOR_VERSION
#define GAUDI_MINOR_VERSION
Definition: GAUDI_VERSION.h:9
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:866
GaudiException
Definition: GaudiException.h:31
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:869
ApplicationMgr::sysStop
StatusCode sysStop() override
Definition: ApplicationMgr.h:105
ApplicationMgr::m_stopOnSignal
Gaudi::Property< bool > m_stopOnSignal
Property to enable/disable the "stop on signal" service.
Definition: ApplicationMgr.h:295
ServiceManager
Definition: ServiceManager.h:46
ApplicationMgr::m_stalledEventMonitoring
Gaudi::Property< bool > m_stalledEventMonitoring
Property to enable/disable the monitoring and reporting of stalled events.
Definition: ApplicationMgr.h:300
System::setEnv
GAUDI_API int setEnv(const std::string &name, const std::string &value, int overwrite=1)
Set an environment variables.
Definition: System.cpp:501
std::stringstream
STL class.
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
ApplicationMgr::m_okDlls
std::vector< std::string > m_okDlls
names of successfully loaded dlls
Definition: ApplicationMgr.h:320
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:313
ApplicationMgr::i_delegateToEvtProc
static auto i_delegateToEvtProc(SELF *self, PIMPL &member, std::string_view method_name, METHOD &&method, ARGS &&... args)
Helper to delegate calls to event processor implementation.
Definition: ApplicationMgr.h:324
ApplicationMgr::terminate
StatusCode terminate() override
Definition: ApplicationMgr.cpp:634
ApplicationMgr::executeRun
StatusCode executeRun(int evtmax) override
implementation of IEventProcessor::executeRun(int)
Definition: ApplicationMgr.cpp:841
ApplicationMgr::finalize
StatusCode finalize() override
Definition: ApplicationMgr.cpp:587
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::bindPropertiesTo
void bindPropertiesTo(Gaudi::Interfaces::IOptionsSvc &optsSvc)
Definition: PropertyHolder.h:252
ApplicationMgr::m_jobOptionsSvcType
Gaudi::Property< std::string > m_jobOptionsSvcType
Definition: ApplicationMgr.h:221
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::property
Gaudi::Details::PropertyBase * property(std::string_view name) const
\fixme property and bindPropertiesTo should be protected
Definition: PropertyHolder.h:238
ApplicationMgr::createSvcNameListHandler
void createSvcNameListHandler(Gaudi::Details::PropertyBase &)
Definition: ApplicationMgr.cpp:936
AlgorithmManager
Definition: AlgorithmManager.h:41
std::vector::push_back
T push_back(T... args)
DLLClassManager
Definition: DLLClassManager.h:38
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::getProperties
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
Definition: PropertyHolder.h:222
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:136
ApplicationMgr::m_dllNameList
Gaudi::Property< std::vector< std::string > > m_dllNameList
Definition: ApplicationMgr.h:250
IProperty
Definition: IProperty.h:33
ApplicationMgr::dllNameListHandler
void dllNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:1008
GaudiPython.Pythonizations.self
self
Definition: Pythonizations.py:588
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:20
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:307
Gaudi::Time::format
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:262
Gaudi::StateMachine::CONFIGURED
@ CONFIGURED
Definition: StateMachine.h:24
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:588
StatusCode
Definition: StatusCode.h:65
gaudirun.opts
opts
Definition: gaudirun.py:338
ApplicationMgr::configure
StatusCode configure() override
Definition: ApplicationMgr.cpp:271
IInterface::interfaceID
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:246
ProduceConsume.j
j
Definition: ProduceConsume.py:101
ApplicationMgr::m_jobOptionsPostAction
Gaudi::Property< std::string > m_jobOptionsPostAction
Definition: ApplicationMgr.h:255
Gaudi::StateMachine::OFFLINE
@ OFFLINE
Definition: StateMachine.h:23
std::string::c_str
T c_str(T... args)
Gaudi::Interfaces::IQueueingEventProcessor::push
virtual void push(EventContext &&ctx)=0
Schedule the processing of an event.
Gaudi::Property::declareUpdateHandler
Details::PropertyBase & declareUpdateHandler(std::function< void(Details::PropertyBase &)> fun) override
set new callback for update
Definition: Property.h:146
ApplicationMgr::m_jobOptionsPreAction
Gaudi::Property< std::string > m_jobOptionsPreAction
Definition: ApplicationMgr.h:253
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:239
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:35
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
Definition: ApplicationMgr.h:189
ApplicationMgr::m_appVersion
Gaudi::Property< std::string > m_appVersion
Definition: ApplicationMgr.h:263
ApplicationMgr::sysReinitialize
StatusCode sysReinitialize() override
Definition: ApplicationMgr.h:109
ApplicationMgr::m_jobOptionsType
Gaudi::Property< std::string > m_jobOptionsType
Definition: ApplicationMgr.h:251
ApplicationMgr::sysRestart
StatusCode sysRestart() override
Definition: ApplicationMgr.h:111
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:40
ApplicationMgr::m_svcManager
SmartIF< ISvcManager > m_svcManager
Cached pointer to the manager of services.
Definition: ApplicationMgr.h:183
ApplicationMgr::m_runableType
Gaudi::Property< std::string > m_runableType
Definition: ApplicationMgr.h:257
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
System::isEnvSet
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
Definition: System.cpp:408
std::map< std::string, unsigned int >
ApplicationMgr::m_topAlgNameList
Gaudi::Property< std::vector< std::string > > m_topAlgNameList
Definition: ApplicationMgr.h:208
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:234
Gaudi::StateMachine::RUNNING
@ RUNNING
Definition: StateMachine.h:26
MsgStream
Definition: MsgStream.h:34
ApplicationMgr::m_svcMapping
Gaudi::Property< std::vector< std::string > > m_svcMapping
Definition: ApplicationMgr.h:228
MSG::FATAL
@ FATAL
Definition: IMessageSvc.h:25
Gaudi::PluginService::v1::SetDebug
GAUDIPS_API void SetDebug(int debugLevel)
Backward compatibility with Reflex.
Definition: PluginServiceV1.cpp:323
ApplicationMgr::m_svcOptMapping
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
Definition: ApplicationMgr.h:229
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:979
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:69
ApplicationMgr::m_extSvcNameList
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
Definition: ApplicationMgr.h:245
ApplicationMgr::m_eventLoopMgr
Gaudi::Property< std::string > m_eventLoopMgr
Definition: ApplicationMgr.h:258
std::vector::rend
T rend(T... args)
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:117
ApplicationMgr::m_extSvcCreates
Gaudi::Property< bool > m_extSvcCreates
Definition: ApplicationMgr.h:247
ApplicationMgr::m_useMessageSvcForROOTMessages
Gaudi::Property< bool > m_useMessageSvcForROOTMessages
Definition: ApplicationMgr.h:313
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
ApplicationMgr::m_createSvcNameList
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
Definition: ApplicationMgr.h:278
ApplicationMgr::m_actHistory
Gaudi::Property< bool > m_actHistory
Definition: ApplicationMgr.h:264
MSG::Level
Level
Definition: IMessageSvc.h:25
ApplicationMgr::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Needed to locate the message service.
Definition: ApplicationMgr.h:149
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Declare a property.
Definition: PropertyHolder.h:106
ApplicationMgr::m_monitoringHub
Gaudi::Monitoring::Hub m_monitoringHub
Definition: ApplicationMgr.h:238
MSG::VERBOSE
@ VERBOSE
Definition: IMessageSvc.h:25
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::endl
T endl(T... args)
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:945
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
ApplicationMgr::m_appName
Gaudi::Property< std::string > m_appName
Definition: ApplicationMgr.h:262
gaudirun.args
args
Definition: gaudirun.py:338
ProduceConsume.props
props
Definition: ProduceConsume.py:84
MSG::ALWAYS
@ ALWAYS
Definition: IMessageSvc.h:25
std::map::begin
T begin(T... args)
MSG::NIL
@ NIL
Definition: IMessageSvc.h:25
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:25
MSG::ERROR
@ ERROR
Definition: IMessageSvc.h:25
Gaudi::Time::current
static Time current()
Returns the current time.
Definition: Time.cpp:119
ApplicationMgr::evtLoopPropertyHandler
void evtLoopPropertyHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:926
compareRootHistos.retval
retval
Definition: compareRootHistos.py:500
ApplicationMgr::m_queueingProcessor
SmartIF< IQueueingEventProcessor > m_queueingProcessor
Reference to a queueing processing manager object.
Definition: ApplicationMgr.h:236
ApplicationMgr::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: ApplicationMgr.h:261
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:232
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:178
std::string::empty
T empty(T... args)
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:225
ApplicationMgr::sysStart
StatusCode sysStart() override
Definition: ApplicationMgr.h:103
ApplicationMgr::m_jobOptionsPath
Gaudi::Property< std::string > m_jobOptionsPath
Definition: ApplicationMgr.h:252
ApplicationMgr::m_printAlgsSequence
Gaudi::Property< bool > m_printAlgsSequence
Definition: ApplicationMgr.h:310
std::stringstream::str
T str(T... args)
System::hostName
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:318
ApplicationMgr::extSvcNameListHandler
void extSvcNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:969
std::map::end
T end(T... args)
ApplicationMgr::GoToState
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
Definition: ApplicationMgr.cpp:696
GAUDI_MAJOR_VERSION
#define GAUDI_MAJOR_VERSION
Definition: GAUDI_VERSION.h:8
ApplicationMgr::reinitialize
StatusCode reinitialize() override
Definition: ApplicationMgr.cpp:876
ApplicationMgr::m_loopCheck
Gaudi::Property< bool > m_loopCheck
Definition: ApplicationMgr.h:289
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::Interfaces::IQueueingEventProcessor::empty
virtual bool empty() const =0
Tell if the processor has events in the queues.
ApplicationMgr::m_environment
Gaudi::Property< std::map< std::string, std::string > > m_environment
Definition: ApplicationMgr.h:286
compareRootHistos.state
state
Definition: compareRootHistos.py:497
AlgorithmManager::typeAliases
AlgTypeAliasesMap & typeAliases()
Definition: AlgorithmManager.h:92
ApplicationMgr::m_pluginDebugLevel
Gaudi::Property< int > m_pluginDebugLevel
Definition: ApplicationMgr.h:265
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:142
std::numeric_limits
Gaudi::Property< bool >
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:191
ApplicationMgr::start
StatusCode start() override
Definition: ApplicationMgr.cpp:501
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:41
std::vector::rbegin
T rbegin(T... args)
ApplicationMgr::m_evtMax
Gaudi::Property< int > m_evtMax
Definition: ApplicationMgr.h:244
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:226
ApplicationMgr::initialize
StatusCode initialize() override
Definition: ApplicationMgr.cpp:440
IProperty::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
Definition: IProperty.h:39
GAUDI_PATCH_VERSION
#define GAUDI_PATCH_VERSION
Definition: GAUDI_VERSION.h:10