The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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)
 
void const * i_cast (const InterfaceID &iid) const override
 
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::string & name () 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, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
 requires (!Gaudi::Details::is_gaudi_property_v< TYPE >) Gaudi
 Helper to wrap a regular data member and use it as a regular property. 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 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::string > m_messageSvcType
 
Gaudi::Property< std::string > m_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::string > m_jobOptionsType { this, "JobOptionsType", "FILE", "Source type (e.g. dbase, file...)" }
 
Gaudi::Property< std::string > m_jobOptionsPath { this, "JobOptionsPath", {}, "The \"file\" to look for properties" }
 
Gaudi::Property< std::string > m_jobOptionsPreAction
 
Gaudi::Property< std::string > m_jobOptionsPostAction
 
Gaudi::Property< std::string > m_runableType { this, "Runable", "AppMgrRunable", "Runable type", "Service:IRunable" }
 
Gaudi::Property< std::string > m_eventLoopMgr
 
Gaudi::Property< std::string > m_evtsel { this, "EvtSel", {}, "Event selection" }
 
Gaudi::Property< std::string > m_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::string > m_appName { this, "AppName", "ApplicationMgr", "The name of the application" }
 
Gaudi::Property< std::string > m_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_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::string > m_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 52 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 172 of file ApplicationMgr.h.

Constructor & Destructor Documentation

◆ ApplicationMgr()

ApplicationMgr::ApplicationMgr ( IInterface = nullptr)

Definition at line 83 of file ApplicationMgr.cpp.

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

Member Function Documentation

◆ algManager()

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

Definition at line 140 of file ApplicationMgr.h.

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

◆ configure()

StatusCode ApplicationMgr::configure ( )
override

Definition at line 278 of file ApplicationMgr.cpp.

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

◆ createEventContext()

EventContext ApplicationMgr::createEventContext ( )
override

implementation of IEventProcessor::createEventContext()

Definition at line 804 of file ApplicationMgr.cpp.

804  {
806  if ( m_processingMgr ) { return m_processingMgr->createEventContext(); }
807  }
808  std::stringstream ss;
809  ss << "createEventContext: Invalid state \"" << FSMState() << '"';
810  throw GaudiException( ss.str(), name(), StatusCode::FAILURE );
811 }

◆ createSvcNameListHandler()

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

Definition at line 890 of file ApplicationMgr.cpp.

890  {
891  if ( !( decodeCreateSvcNameList() ).isSuccess() ) {
892  throw GaudiException( "Failed to create ext services", "MinimalEventLoopMgr::createSvcNameListHandler",
894  }
895 }

◆ decodeCreateSvcNameList()

StatusCode ApplicationMgr::decodeCreateSvcNameList ( )

Definition at line 896 of file ApplicationMgr.cpp.

896  {
898  const auto& theNames = m_createSvcNameList.value();
899  auto it = theNames.begin();
900  auto et = theNames.end();
901  while ( result.isSuccess() && it != et ) {
902  Gaudi::Utils::TypeNameString item( *it++ );
903  if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
905  log << MSG::ERROR << "decodeCreateSvcNameList: Cannot create service " << item.type() << "/" << item.name()
906  << endmsg;
907  } else {
908  ON_DEBUG {
910  log << MSG::DEBUG << "decodeCreateSvcNameList: Created service " << item.type() << "/" << item.name() << endmsg;
911  }
912  }
913  }
914  return result;
915 }

◆ decodeDllNameList()

StatusCode ApplicationMgr::decodeDllNameList ( )

Definition at line 956 of file ApplicationMgr.cpp.

956  {
957 
960 
961  // Clean up multiple entries from DLL list
962  std::vector<std::string> newList;
963  std::map<std::string, unsigned int> dllInList, duplicateList;
964  {
965  for ( const auto& it : m_dllNameList ) {
966  if ( 0 == dllInList[it] ) {
967  newList.push_back( it ); // first instance of this module
968  } else {
969  ++duplicateList[it];
970  } // module listed multiple times
971  ++dllInList[it]; // increment count for this module
972  }
973  }
974  // m_dllNameList = newList; // update primary list to new, filtered list (do not use the
975  // property itself otherwise we get called again infinitely)
976  // List modules that were in there twice..
977  ON_DEBUG if ( !duplicateList.empty() ) {
978  log << MSG::DEBUG << "Removed duplicate entries for modules : ";
979  for ( auto it = duplicateList.begin(); it != duplicateList.end(); ++it ) {
980  log << it->first << "(" << 1 + it->second << ")";
981  if ( it != --duplicateList.end() ) log << ", ";
982  }
983  log << endmsg;
984  }
985 
986  const std::vector<std::string>& theNames = newList;
987 
988  // only load the new dlls or previously failed dlls
989  ON_DEBUG log << MSG::DEBUG << "Loading declared DLL's" << endmsg;
990 
991  std::vector<std::string> successNames, failNames;
992  for ( const auto& it : theNames ) {
993  if ( std::find( m_okDlls.rbegin(), m_okDlls.rend(), it ) == m_okDlls.rend() ) {
994  // found a new module name
995  StatusCode status = m_classManager->loadModule( it );
996  if ( status.isFailure() ) {
997  failNames.push_back( it );
998  result = StatusCode::FAILURE;
999  } else {
1000  successNames.push_back( it );
1001  }
1002  }
1003  }
1004 
1005  // report back to the user and store the names of the succesfully loaded dlls
1006  if ( !successNames.empty() ) {
1007  log << MSG::INFO << "Successfully loaded modules : ";
1008  for ( auto it = successNames.begin(); it != successNames.end(); it++ ) {
1009  log << ( *it );
1010  if ( ( it + 1 ) != successNames.end() ) log << ", ";
1011  // save name
1012  m_okDlls.push_back( *it );
1013  }
1014  log << endmsg;
1015  }
1016 
1017  if ( result == StatusCode::FAILURE ) {
1018  log << MSG::WARNING << "Failed to load modules: ";
1019  for ( auto it = failNames.begin(); it != failNames.end(); it++ ) {
1020  log << ( *it );
1021  if ( ( it + 1 ) != failNames.end() ) log << ", ";
1022  }
1023  log << endmsg;
1024  }
1025  return result;
1026 }

◆ decodeExtSvcNameList()

StatusCode ApplicationMgr::decodeExtSvcNameList ( )

Definition at line 924 of file ApplicationMgr.cpp.

924  {
926 
927  const auto& theNames = m_extSvcNameList.value();
928 
929  auto it = theNames.begin();
930  auto et = theNames.end();
931  while ( result.isSuccess() && it != et ) {
932  Gaudi::Utils::TypeNameString item( *it++ );
933  if ( m_extSvcCreates ) {
934  if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
936  log << MSG::ERROR << "decodeExtSvcNameList: Cannot create service " << item.type() << "/" << item.name()
937  << endmsg;
938  }
939  } else {
940  if ( ( result = svcManager()->declareSvcType( item.name(), item.type() ) ).isFailure() ) {
942  log << MSG::ERROR << "decodeExtSvcNameList: Cannot declare service " << item.type() << "/" << item.name()
943  << endmsg;
944  }
945  }
946  }
947  return result;
948 }

◆ dllNameListHandler()

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

Definition at line 950 of file ApplicationMgr.cpp.

950  {
951  if ( !( decodeDllNameList() ).isSuccess() ) {
952  throw GaudiException( "Failed to load DLLs.", "MinimalEventLoopMgr::dllNameListHandler", StatusCode::FAILURE );
953  }
954 }

◆ empty()

bool ApplicationMgr::empty ( ) const
override

Definition at line 796 of file ApplicationMgr.cpp.

◆ evtLoopPropertyHandler()

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

Definition at line 883 of file ApplicationMgr.cpp.

883  {
884  if ( m_processingMgr ) {
885  auto props = m_processingMgr.as<IProperty>();
886  if ( props ) props->setProperty( p ).ignore();
887  }
888 }

◆ executeEvent()

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

implementation of IEventProcessor::executeEvent(void*)

Definition at line 782 of file ApplicationMgr.cpp.

782  {
784  if ( m_processingMgr ) { return m_processingMgr->executeEvent( std::move( ctx ) ); }
785  }
787  log << MSG::FATAL << "executeEvent: Invalid state \"" << FSMState() << "\"" << endmsg;
788  return StatusCode::FAILURE;
789 }

◆ executeRun()

StatusCode ApplicationMgr::executeRun ( int  evtmax)
override

implementation of IEventProcessor::executeRun(int)

Definition at line 813 of file ApplicationMgr.cpp.

813  {
816  if ( m_processingMgr ) { return m_processingMgr->executeRun( evtmax ); }
817  log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
818  return StatusCode::SUCCESS;
819  }
820  log << MSG::FATAL << "executeRun: Invalid state \"" << FSMState() << "\"" << endmsg;
821  return StatusCode::FAILURE;
822 }

◆ extSvcNameListHandler()

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

Definition at line 917 of file ApplicationMgr.cpp.

917  {
918  if ( !( decodeExtSvcNameList() ).isSuccess() ) {
919  throw GaudiException( "Failed to declare ext services", "MinimalEventLoopMgr::extSvcNameListHandler",
921  }
922 }

◆ finalize()

StatusCode ApplicationMgr::finalize ( )
override

Definition at line 573 of file ApplicationMgr.cpp.

573  {
576  log << MSG::INFO << "Already Finalized" << endmsg;
577  return StatusCode::SUCCESS;
578  }
580  log << MSG::FATAL << "finalize: Invalid state \"" << m_state << "\"" << endmsg;
581  return StatusCode::FAILURE;
582  }
584 
585  // disable message suppression in finalize
586  m_svcLocator->service<IProperty>( "MessageSvc" )
587  ->setProperty( Gaudi::Property<bool>( "enableSuppression", false ) )
588  .ignore();
589 
590  // Finalize independently managed Algorithms
591  StatusCode sc = algManager()->finalize();
592  if ( sc.isFailure() ) {
593  log << MSG::WARNING << "Failed to finalize an algorithm." << endmsg;
595  }
596 
597  // Finalize all Services
598  sc = svcManager()->finalize();
599  if ( sc.isFailure() ) {
600  log << MSG::WARNING << "Failed to finalize a service." << endmsg;
602  }
603 
604  // svcManager()->removeService( (IService*) m_processingMgr.get() );
605  // svcManager()->removeService( (IService*) m_runable.get() );
606 
607  if ( sc.isSuccess() ) {
608  log << MSG::INFO << "Application Manager Finalized successfully" << endmsg;
609  } else {
610  log << MSG::ERROR << "Application Manager failed to finalize" << endmsg;
611  }
612 
614  return sc;
615 }

◆ FSMState()

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

Definition at line 836 of file ApplicationMgr.cpp.

836 { return m_state; }

◆ getManager()

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

Definition at line 130 of file ApplicationMgr.h.

130  {
131  return m_managers[I::interfaceID().id()];
132  }

◆ 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 676 of file ApplicationMgr.cpp.

676  {
678 
679  switch ( state ) {
680 
682  switch ( m_state ) {
684  return StatusCode::SUCCESS;
685  break;
687  return terminate();
688  break;
689  default: // Gaudi::StateMachine::INITIALIZED or Gaudi::StateMachine::RUNNING
691  if ( sc.isSuccess() ) { return terminate(); }
692  break;
693  }
694  break;
695 
697  switch ( m_state ) {
699  return StatusCode::SUCCESS;
700  break;
702  return configure();
703  break;
705  return finalize();
706  break;
707  default: // Gaudi::StateMachine::RUNNING
709  if ( sc.isSuccess() ) { return finalize(); }
710  break;
711  }
712  break;
713 
715  switch ( m_state ) {
717  return StatusCode::SUCCESS;
718  break;
720  return initialize();
721  break;
723  return stop();
724  break;
725  default: // Gaudi::StateMachine::OFFLINE
727  if ( sc.isSuccess() ) { return initialize(); }
728  break;
729  }
730  break;
731 
733  switch ( m_state ) {
735  return StatusCode::SUCCESS;
736  break;
738  return start();
739  break;
740  default: // Gaudi::StateMachine::OFFLINE or Gaudi::StateMachine::CONFIGURED
742  if ( sc.isSuccess() ) { return start(); }
743  break;
744  }
745  break;
746  }
747 
748  // If I get here, there has been a problem in the recursion
749 
750  if ( ignoreFailures ) {
751  // force the new state
752  m_state = state;
753  return StatusCode::SUCCESS;
754  }
755 
756  return sc;
757 }

◆ i_cast()

void const * ApplicationMgr::i_cast ( const InterfaceID iid) const
override

Definition at line 117 of file ApplicationMgr.cpp.

117  {
118  // try our own interfaces
119  if ( auto output = base_class::i_cast( iid ) ) { return output; }
120  // delegate to other instances
121  if ( ISvcLocator::interfaceID().versionMatch( iid ) ) { return serviceLocator().get(); }
122  if ( ISvcManager::interfaceID().versionMatch( iid ) ) {
123  return const_cast<ApplicationMgr*>( this )->svcManager().get();
124  }
125  if ( IAlgManager::interfaceID().versionMatch( iid ) ) {
126  return const_cast<ApplicationMgr*>( this )->algManager().get();
127  }
128  if ( IClassManager::interfaceID().versionMatch( iid ) ) { return m_classManager.get(); }
129  if ( IMessageSvc::interfaceID().versionMatch( iid ) ) {
130  // Note that 0 can be a valid IMessageSvc pointer value (when used for
131  // MsgStream).
132  return m_messageSvc.get();
133  }
134  return nullptr;
135 }

◆ 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 315 of file ApplicationMgr.h.

316  {
317  if ( self->m_state == Gaudi::StateMachine::RUNNING ) {
318  if ( bool( member ) ) {
319  return std::invoke( method, *member.get(), std::forward<ARGS>( args )... );
320  } else {
321  std::stringstream s;
322  s << method_name << ": event processor is not a \""
323  << System::typeinfoName( typeid( decltype( *member.get() ) ) ) << '"';
324  throw GaudiException{ s.str(), self->name(), StatusCode::FAILURE };
325  }
326  }
327  std::stringstream s;
328  s << method_name << ": Invalid state \"" << self->FSMState() << '"';
329  throw GaudiException{ s.str(), self->name(), StatusCode::FAILURE };
330  }

◆ i_startup()

StatusCode ApplicationMgr::i_startup ( )
protected

Internal startup routine.

Definition at line 160 of file ApplicationMgr.cpp.

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

◆ initialize()

StatusCode ApplicationMgr::initialize ( )
override

Definition at line 444 of file ApplicationMgr.cpp.

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

◆ monitoringHub()

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

Definition at line 152 of file ApplicationMgr.h.

152 { return m_monitoringHub; }

◆ name()

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

Definition at line 834 of file ApplicationMgr.cpp.

834 { return m_name; }

◆ nextEvent()

StatusCode ApplicationMgr::nextEvent ( int  maxevt)
override

Definition at line 524 of file ApplicationMgr.cpp.

524  {
527  log << MSG::FATAL << "nextEvent: Invalid state \"" << m_state << "\"" << endmsg;
528  return StatusCode::FAILURE;
529  }
530  if ( !m_processingMgr ) {
532  log << MSG::FATAL << "No event processing manager specified. Check option: " << m_eventLoopMgr.name() << endmsg;
533  return StatusCode::FAILURE;
534  }
535  return m_processingMgr->nextEvent( maxevt );
536 }

◆ outputLevelUpdate()

void ApplicationMgr::outputLevelUpdate ( )
override

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

Definition at line 1028 of file ApplicationMgr.cpp.

1028  {
1029  resetMessaging();
1030  for ( auto& mgrItem : m_managers ) { mgrItem.second->outputLevelUpdate(); }
1031 }

◆ pluginDebugPropertyHandler()

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

◆ pop()

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

Definition at line 800 of file ApplicationMgr.cpp.

◆ printAlgsSequences()

void ApplicationMgr::printAlgsSequences ( )

Print the sequence of algorithms that have been loaded.

Definition at line 1054 of file ApplicationMgr.cpp.

1054  {
1056  log << MSG::ALWAYS << "****************************** Algorithm Sequence ****************************" << endmsg;
1057  for ( auto& algname : m_topAlgNameList ) { printAlgsSequencesHelper( algManager(), algname, log, 0 ); }
1058  log << MSG::ALWAYS << "******************************************************************************" << endmsg;
1059 }

◆ push()

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

Definition at line 791 of file ApplicationMgr.cpp.

791  {
793  std::move( ctx ) );
794 }

◆ queryInterface()

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

Definition at line 137 of file ApplicationMgr.cpp.

137  {
138  if ( !ppvi ) { return StatusCode::FAILURE; }
139 
140  // try to find own/direct interfaces:
141  StatusCode sc = base_class::queryInterface( iid, ppvi );
142  if ( sc.isSuccess() ) return sc;
143 
144  // find indirect interfaces :
145  if ( ISvcLocator::interfaceID().versionMatch( iid ) ) { return serviceLocator()->queryInterface( iid, ppvi ); }
146  if ( ISvcManager::interfaceID().versionMatch( iid ) ) { return svcManager()->queryInterface( iid, ppvi ); }
147  if ( IAlgManager::interfaceID().versionMatch( iid ) ) { return algManager()->queryInterface( iid, ppvi ); }
148  if ( IClassManager::interfaceID().versionMatch( iid ) ) { return m_classManager->queryInterface( iid, ppvi ); }
149  if ( IMessageSvc::interfaceID().versionMatch( iid ) ) {
150  *ppvi = m_messageSvc.get();
151  if ( m_messageSvc ) m_messageSvc->addRef();
152  // Note that 0 can be a valid IMessageSvc pointer value (when used for
153  // MsgStream).
154  return StatusCode::SUCCESS;
155  }
156  *ppvi = nullptr;
157  return StatusCode::FAILURE;
158 }

◆ reinitialize()

StatusCode ApplicationMgr::reinitialize ( )
override

Definition at line 839 of file ApplicationMgr.cpp.

839  {
842  StatusCode sc;
844  throw GaudiException( "Cannot reinitialize application if not INITIALIZED or RUNNING",
845  "ApplicationMgr::reinitialize", StatusCode::FAILURE );
846  }
848  sc = svcManager()->reinitialize();
849  if ( sc.isFailure() ) retval = sc;
850  sc = algManager()->reinitialize();
851  if ( sc.isFailure() ) retval = sc;
852 
854  if ( sc.isFailure() ) retval = sc;
855  sc = m_svcLocator->service( "JobOptionsSvc" )->sysReinitialize();
856  if ( sc.isFailure() ) retval = sc;
857 
858  log << MSG::INFO << "Application Manager Reinitialized successfully" << endmsg;
859 
860  return retval;
861 }

◆ restart()

StatusCode ApplicationMgr::restart ( )
override

Definition at line 863 of file ApplicationMgr.cpp.

863  {
865  StatusCode sc;
867  throw GaudiException( "Cannot restart application if not RUNNING", "ApplicationMgr::restart", StatusCode::FAILURE );
868  }
869 
870  sc = svcManager()->restart();
871  if ( sc.isFailure() ) retval = sc;
872  sc = algManager()->restart();
873  if ( sc.isFailure() ) retval = sc;
874 
875  sc = m_messageSvc.as<IService>()->sysRestart();
876  if ( sc.isFailure() ) retval = sc;
877  sc = m_svcLocator->service( "JobOptionsSvc" )->sysRestart();
878  if ( sc.isFailure() ) retval = sc;
879 
880  return retval;
881 }

◆ run()

StatusCode ApplicationMgr::run ( )
override

Definition at line 759 of file ApplicationMgr.cpp.

759  {
761 
763  if ( sc.isSuccess() ) {
765  if ( m_runable != 0 ) { // loop over the events
766  sc = m_runable->run();
767  if ( !sc.isSuccess() ) { log << MSG::FATAL << "Application execution failed. Ending the job." << endmsg; }
768  } else {
769  log << MSG::FATAL << "Application has no runable object. Check option:" << m_runableType.name() << endmsg;
770  }
771  }
772  if ( sc.isSuccess() ) { // try to close cleanly
774  }
775  // either the runable failed of the stut-down
776  if ( sc.isFailure() ) { // try to close anyway (but keep the StatusCode unchanged)
778  }
779  return sc;
780 }

◆ serviceLocator()

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

Needed to locate the message service.

Definition at line 147 of file ApplicationMgr.h.

147 { return m_svcLocator; }

◆ setServiceManager()

void ApplicationMgr::setServiceManager ( ISvcManager )
inlineoverrideprotected

Definition at line 159 of file ApplicationMgr.h.

159 {}

◆ start()

StatusCode ApplicationMgr::start ( )
override

Definition at line 493 of file ApplicationMgr.cpp.

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

◆ stop()

StatusCode ApplicationMgr::stop ( )
override

Definition at line 538 of file ApplicationMgr.cpp.

538  {
539 
541 
543  log << MSG::INFO << "Already Initialized!" << endmsg;
544  return StatusCode::SUCCESS;
545  }
547  log << MSG::FATAL << "stop: Invalid state \"" << m_state << "\"" << endmsg;
548  return StatusCode::FAILURE;
549  }
551 
552  // Stop independently managed Algorithms
553  return algManager()
554  ->stop()
555  //--------------------------------------------------------------------------
556  // Stop the list of top Services
557  //--------------------------------------------------------------------------
558  .andThen( [&]() { return svcManager()->stop(); } )
559  .andThen( [&]() { return m_messageSvc.as<IService>()->sysStop(); } )
560  .andThen( [&]() { return m_svcLocator->service( "JobOptionsSvc" )->sysStop(); } )
561  //--------------------------------------------------------------------------
562  // Final steps: Inform user and change internal state
563  //--------------------------------------------------------------------------
564  .andThen( [&]() {
565  log << MSG::INFO << "Application Manager Stopped successfully" << endmsg;
567  } );
568 }

◆ stopRun()

StatusCode ApplicationMgr::stopRun ( )
override

implementation of IEventProcessor::stopRun()

Definition at line 824 of file ApplicationMgr.cpp.

824  {
827  if ( m_processingMgr ) { return m_processingMgr->stopRun(); }
828  log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
829  return StatusCode::SUCCESS;
830  }
831  log << MSG::FATAL << "stopRun: Invalid state \"" << FSMState() << "\"" << endmsg;
832  return StatusCode::FAILURE;
833 }

◆ svcManager()

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

Definition at line 134 of file ApplicationMgr.h.

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

◆ sysFinalize()

StatusCode ApplicationMgr::sysFinalize ( )
inlineoverride

Definition at line 105 of file ApplicationMgr.h.

105 { return StatusCode::SUCCESS; }

◆ sysInitialize()

StatusCode ApplicationMgr::sysInitialize ( )
inlineoverride

Definition at line 99 of file ApplicationMgr.h.

99 { return StatusCode::SUCCESS; }

◆ sysReinitialize()

StatusCode ApplicationMgr::sysReinitialize ( )
inlineoverride

Definition at line 107 of file ApplicationMgr.h.

107 { return StatusCode::SUCCESS; }

◆ sysRestart()

StatusCode ApplicationMgr::sysRestart ( )
inlineoverride

Definition at line 109 of file ApplicationMgr.h.

109 { return StatusCode::SUCCESS; }

◆ sysStart()

StatusCode ApplicationMgr::sysStart ( )
inlineoverride

Definition at line 101 of file ApplicationMgr.h.

101 { return StatusCode::SUCCESS; }

◆ sysStop()

StatusCode ApplicationMgr::sysStop ( )
inlineoverride

Definition at line 103 of file ApplicationMgr.h.

103 { return StatusCode::SUCCESS; }

◆ targetFSMState()

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

Definition at line 837 of file ApplicationMgr.cpp.

837 { return m_targetState; }

◆ terminate()

StatusCode ApplicationMgr::terminate ( )
override

Definition at line 617 of file ApplicationMgr.cpp.

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

Member Data Documentation

◆ m_actHistory

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

Definition at line 260 of file ApplicationMgr.h.

◆ m_algManager

SmartIF<IAlgManager> ApplicationMgr::m_algManager
protected

Cached pointer to the manager of algorithms.

Definition at line 184 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 258 of file ApplicationMgr.h.

◆ m_appVersion

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

Definition at line 259 of file ApplicationMgr.h.

◆ m_auditAlgs

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

Definition at line 280 of file ApplicationMgr.h.

◆ m_auditSvcs

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

Definition at line 279 of file ApplicationMgr.h.

◆ m_auditTools

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

Defaults for auditors.

Definition at line 278 of file ApplicationMgr.h.

◆ m_classManager

SmartIF<DLLClassManager> ApplicationMgr::m_classManager
protected

Reference to the class manager.

Definition at line 189 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 274 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 178 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 245 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 282 of file ApplicationMgr.h.

◆ m_eventLoopMgr

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

Definition at line 253 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 239 of file ApplicationMgr.h.

◆ m_evtsel

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

Definition at line 255 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 242 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 240 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 256 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 247 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 250 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 248 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 216 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 246 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 285 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 176 of file ApplicationMgr.h.

◆ m_messageSvc

SmartIF<IMessageSvc> ApplicationMgr::m_messageSvc
protected

Reference to the message service.

Definition at line 227 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 214 of file ApplicationMgr.h.

◆ m_monitoringHub

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

Definition at line 233 of file ApplicationMgr.h.

◆ m_name

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

Name.

Definition at line 219 of file ApplicationMgr.h.

◆ m_okDlls

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

names of successfully loaded dlls

Definition at line 311 of file ApplicationMgr.h.

◆ m_outputLevel

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

Definition at line 257 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 212 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 261 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 301 of file ApplicationMgr.h.

◆ m_processingMgr

SmartIF<IEventProcessor> ApplicationMgr::m_processingMgr
protected

Reference to processing manager object.

Definition at line 229 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 294 of file ApplicationMgr.h.

◆ m_queueingProcessor

SmartIF<IQueueingEventProcessor> ApplicationMgr::m_queueingProcessor
protected

Reference to a queueing processing manager object.

Definition at line 231 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 298 of file ApplicationMgr.h.

◆ m_runable

SmartIF<IRunable> ApplicationMgr::m_runable
protected

Reference to the runable object.

Definition at line 228 of file ApplicationMgr.h.

◆ m_runableType

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

Definition at line 252 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 199 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 191 of file ApplicationMgr.h.

◆ m_state

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

Internal State.

Definition at line 220 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 291 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 187 of file ApplicationMgr.h.

◆ m_svcManager

SmartIF<ISvcManager> ApplicationMgr::m_svcManager
protected

Cached pointer to the manager of services.

Definition at line 181 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 223 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 224 of file ApplicationMgr.h.

◆ m_targetState

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

Internal State.

Definition at line 221 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 206 of file ApplicationMgr.h.

◆ m_useHiveAlgorithmManager

bool ApplicationMgr::m_useHiveAlgorithmManager
protected

Definition at line 308 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 304 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:1054
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:25
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:22
IService
Definition: IService.h:26
ApplicationMgr::m_algManager
SmartIF< IAlgManager > m_algManager
Cached pointer to the manager of algorithms.
Definition: ApplicationMgr.h:184
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:41
ApplicationMgr::m_propertiesPrint
Gaudi::Property< bool > m_propertiesPrint
Definition: ApplicationMgr.h:294
Gaudi.Configuration.log
log
Definition: Configuration.py:28
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:956
CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >::resetMessaging
MSG::Level resetMessaging()
Reinitialize internal states.
Definition: CommonMessaging.h:178
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
MSG::INFO
@ INFO
Definition: IMessageSvc.h:22
ApplicationMgr::outputLevelUpdate
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
Definition: ApplicationMgr.cpp:1028
ApplicationMgr::m_runable
SmartIF< IRunable > m_runable
Reference to the runable object.
Definition: ApplicationMgr.h:228
ApplicationMgr::i_startup
StatusCode i_startup()
Internal startup routine.
Definition: ApplicationMgr.cpp:160
ApplicationMgr::stop
StatusCode stop() override
Definition: ApplicationMgr.cpp:538
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:219
gaudirun.s
string s
Definition: gaudirun.py:346
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:329
ApplicationMgr::m_messageSvcType
Gaudi::Property< std::string > m_messageSvcType
Definition: ApplicationMgr.h:214
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:38
check_ParticleID.props
props
Definition: check_ParticleID.py:21
GAUDI_MINOR_VERSION
#define GAUDI_MINOR_VERSION
Definition: GAUDI_VERSION.h:8
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:834
GaudiException
Definition: GaudiException.h:29
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:836
ApplicationMgr::sysStop
StatusCode sysStop() override
Definition: ApplicationMgr.h:103
ApplicationMgr::m_stopOnSignal
Gaudi::Property< bool > m_stopOnSignal
Property to enable/disable the "stop on signal" service.
Definition: ApplicationMgr.h:291
ServiceManager
Definition: ServiceManager.h:40
System::setEnv
GAUDI_API int setEnv(const std::string &name, const std::string &value, int overwrite=1)
Set an environment variables.
Definition: System.cpp:440
extend_interfaces< INamedInterface, IStateful >::interfaceID
static const InterfaceID & interfaceID()
Definition: extend_interfaces.h:29
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:22
ApplicationMgr::m_okDlls
std::vector< std::string > m_okDlls
names of successfully loaded dlls
Definition: ApplicationMgr.h:311
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:260
gaudirun.output
output
Definition: gaudirun.py:521
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:315
ApplicationMgr::terminate
StatusCode terminate() override
Definition: ApplicationMgr.cpp:617
ApplicationMgr::executeRun
StatusCode executeRun(int evtmax) override
implementation of IEventProcessor::executeRun(int)
Definition: ApplicationMgr.cpp:813
Gaudi::Property::name
std::string name
Definition: Property.h:60
ApplicationMgr::finalize
StatusCode finalize() override
Definition: ApplicationMgr.cpp:573
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::bindPropertiesTo
void bindPropertiesTo(Gaudi::Interfaces::IOptionsSvc &optsSvc)
Definition: PropertyHolder.h:238
ApplicationMgr::m_jobOptionsSvcType
Gaudi::Property< std::string > m_jobOptionsSvcType
Definition: ApplicationMgr.h:216
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:224
ApplicationMgr::createSvcNameListHandler
void createSvcNameListHandler(Gaudi::Details::PropertyBase &)
Definition: ApplicationMgr.cpp:890
AlgorithmManager
Definition: AlgorithmManager.h:39
InterfaceID::id
constexpr unsigned long id() const
get the interface identifier
Definition: IInterface.h:47
DLLClassManager
Definition: DLLClassManager.h:37
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:210
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:134
ApplicationMgr::m_dllNameList
Gaudi::Property< std::vector< std::string > > m_dllNameList
Definition: ApplicationMgr.h:245
IProperty
Definition: IProperty.h:32
ApplicationMgr::dllNameListHandler
void dllNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:950
GaudiPython.Pythonizations.self
self
Definition: Pythonizations.py:578
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:19
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:298
Gaudi::Time::format
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:157
Gaudi::StateMachine::CONFIGURED
@ CONFIGURED
Definition: StateMachine.h:23
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:578
StatusCode
Definition: StatusCode.h:64
gaudirun.opts
opts
Definition: gaudirun.py:336
ApplicationMgr::configure
StatusCode configure() override
Definition: ApplicationMgr.cpp:278
IInterface::interfaceID
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:234
ProduceConsume.j
j
Definition: ProduceConsume.py:104
ApplicationMgr::m_jobOptionsPostAction
Gaudi::Property< std::string > m_jobOptionsPostAction
Definition: ApplicationMgr.h:250
Gaudi::StateMachine::OFFLINE
@ OFFLINE
Definition: StateMachine.h:22
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:135
ApplicationMgr::m_jobOptionsPreAction
Gaudi::Property< std::string > m_jobOptionsPreAction
Definition: ApplicationMgr.h:248
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:229
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:34
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
Definition: ApplicationMgr.h:187
ApplicationMgr::m_appVersion
Gaudi::Property< std::string > m_appVersion
Definition: ApplicationMgr.h:259
ApplicationMgr::sysReinitialize
StatusCode sysReinitialize() override
Definition: ApplicationMgr.h:107
ApplicationMgr::m_jobOptionsType
Gaudi::Property< std::string > m_jobOptionsType
Definition: ApplicationMgr.h:246
ApplicationMgr::sysRestart
StatusCode sysRestart() override
Definition: ApplicationMgr.h:109
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:39
ApplicationMgr::m_svcManager
SmartIF< ISvcManager > m_svcManager
Cached pointer to the manager of services.
Definition: ApplicationMgr.h:181
ApplicationMgr::m_runableType
Gaudi::Property< std::string > m_runableType
Definition: ApplicationMgr.h:252
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:198
System::isEnvSet
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
Definition: System.cpp:349
ApplicationMgr::m_topAlgNameList
Gaudi::Property< std::vector< std::string > > m_topAlgNameList
Definition: ApplicationMgr.h:206
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:229
Gaudi::StateMachine::RUNNING
@ RUNNING
Definition: StateMachine.h:25
MsgStream
Definition: MsgStream.h:29
ApplicationMgr::m_svcMapping
Gaudi::Property< std::vector< std::string > > m_svcMapping
Definition: ApplicationMgr.h:223
MSG::FATAL
@ FATAL
Definition: IMessageSvc.h:22
Gaudi::PluginService::v1::SetDebug
GAUDIPS_API void SetDebug(int debugLevel)
Backward compatibility with Reflex.
Definition: PluginServiceV1.cpp:314
ApplicationMgr::m_svcOptMapping
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
Definition: ApplicationMgr.h:224
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:924
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:68
ApplicationMgr::m_extSvcNameList
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
Definition: ApplicationMgr.h:240
ApplicationMgr::m_eventLoopMgr
Gaudi::Property< std::string > m_eventLoopMgr
Definition: ApplicationMgr.h:253
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:110
ApplicationMgr::m_extSvcCreates
Gaudi::Property< bool > m_extSvcCreates
Definition: ApplicationMgr.h:242
ApplicationMgr::m_useMessageSvcForROOTMessages
Gaudi::Property< bool > m_useMessageSvcForROOTMessages
Definition: ApplicationMgr.h:304
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
ApplicationMgr::m_createSvcNameList
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
Definition: ApplicationMgr.h:274
ApplicationMgr::m_actHistory
Gaudi::Property< bool > m_actHistory
Definition: ApplicationMgr.h:260
MSG::Level
Level
Definition: IMessageSvc.h:22
ApplicationMgr::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Needed to locate the message service.
Definition: ApplicationMgr.h:147
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:92
ApplicationMgr::m_monitoringHub
Gaudi::Monitoring::Hub m_monitoringHub
Definition: ApplicationMgr.h:233
MSG::VERBOSE
@ VERBOSE
Definition: IMessageSvc.h:22
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:99
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:896
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
ApplicationMgr::m_appName
Gaudi::Property< std::string > m_appName
Definition: ApplicationMgr.h:258
gaudirun.args
args
Definition: gaudirun.py:336
MSG::ALWAYS
@ ALWAYS
Definition: IMessageSvc.h:22
ApplicationMgr
Definition: ApplicationMgr.h:54
MSG::NIL
@ NIL
Definition: IMessageSvc.h:22
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:24
MSG::ERROR
@ ERROR
Definition: IMessageSvc.h:22
Gaudi::Time::current
static Time current()
Returns the current time.
Definition: Time.cpp:43
InterfaceID::versionMatch
constexpr bool versionMatch(const InterfaceID &iid) const
check compatibility.
Definition: IInterface.h:55
ApplicationMgr::evtLoopPropertyHandler
void evtLoopPropertyHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:883
compareRootHistos.retval
retval
Definition: compareRootHistos.py:499
ApplicationMgr::m_queueingProcessor
SmartIF< IQueueingEventProcessor > m_queueingProcessor
Reference to a queueing processing manager object.
Definition: ApplicationMgr.h:231
ApplicationMgr::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: ApplicationMgr.h:257
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:227
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:176
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:220
ApplicationMgr::sysStart
StatusCode sysStart() override
Definition: ApplicationMgr.h:101
ApplicationMgr::m_jobOptionsPath
Gaudi::Property< std::string > m_jobOptionsPath
Definition: ApplicationMgr.h:247
ApplicationMgr::m_printAlgsSequence
Gaudi::Property< bool > m_printAlgsSequence
Definition: ApplicationMgr.h:301
System::hostName
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:265
ApplicationMgr::extSvcNameListHandler
void extSvcNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:917
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:676
GAUDI_MAJOR_VERSION
#define GAUDI_MAJOR_VERSION
Definition: GAUDI_VERSION.h:7
ApplicationMgr::reinitialize
StatusCode reinitialize() override
Definition: ApplicationMgr.cpp:839
ApplicationMgr::m_loopCheck
Gaudi::Property< bool > m_loopCheck
Definition: ApplicationMgr.h:285
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:100
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:282
compareRootHistos.state
state
Definition: compareRootHistos.py:496
AlgorithmManager::typeAliases
AlgTypeAliasesMap & typeAliases()
Definition: AlgorithmManager.h:89
ApplicationMgr::m_pluginDebugLevel
Gaudi::Property< int > m_pluginDebugLevel
Definition: ApplicationMgr.h:261
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:140
Gaudi::Property< bool >
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:189
ApplicationMgr::start
StatusCode start() override
Definition: ApplicationMgr.cpp:493
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:40
ApplicationMgr::m_evtMax
Gaudi::Property< int > m_evtMax
Definition: ApplicationMgr.h:239
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:221
ApplicationMgr::initialize
StatusCode initialize() override
Definition: ApplicationMgr.cpp:444
IProperty::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
Definition: IProperty.h:38
GAUDI_PATCH_VERSION
#define GAUDI_PATCH_VERSION
Definition: GAUDI_VERSION.h:9