| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
ApplicationMgr Class Reference

The Application Manager class. More...

`#include <src/ApplicationMgr/ApplicationMgr.h>`

Inheritance diagram for ApplicationMgr:
[legend]
Collaboration diagram for ApplicationMgr:
[legend]

## Public Member Functions
| ApplicationMgr (IInterface *=nullptr)
| ~ApplicationMgr () override=default
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
StatusCode | executeEvent (void *par) 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 | SIGoHandler (Gaudi::Details::PropertyBase &theProp)
void | SIExitHandler (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::Details::PropertyBase handlers
void | evtLoopPropertyHandler (Gaudi::Details::PropertyBase &theProp)
StatusCode | decodeExtSvcNameList ()
StatusCode | decodeCreateSvcNameList ()
void | createSvcNameListHandler (Gaudi::Details::PropertyBase &)
void | extSvcNameListHandler (Gaudi::Details::PropertyBase &theProp)
StatusCode | decodeMultiThreadSvcNameList ()
void | multiThreadSvcNameListHandler (Gaudi::Details::PropertyBase &theProp)
StatusCode | decodeDllNameList ()
void | dllNameListHandler (Gaudi::Details::PropertyBase &theProp)
void | pluginDebugPropertyHandler (Gaudi::Details::PropertyBase &theProp)
void | initLoopCheckHndlr (Gaudi::Details::PropertyBase &)
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
| PropertyHolder ()=default
| ~PropertyHolder () override=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (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::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
Gaudi::Details::PropertyBase * | declareProperty (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::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &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 (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...

## Protected Types
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...

## Protected Member Functions
StatusCode | declareMultiSvcType (const std::string &name, const std::string &type)
| declare one or more copies of svc type/name as determined by NoOfThreads More...
StatusCode | addMultiSvc (const Gaudi::Utils::TypeNameString &typeName, int prio)
| add one or more copies of svc type/name as determined by NoOfThreads 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...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > >
MSG::Level | setUpMessaging ()
| 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...

## Protected Attributes
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< ISvcManager > | m_svcManager
| Cached pointer to the manager of services. More...
SmartIF< IAlgManager > | m_algManager
| Cached pointer to the manager of algorithms. More...
SmartIF< ISvcLocator > | m_svcLocator
| Reference to its own service locator (must be instantiated prior to any service!) More...
SmartIF< DLLClassManager > | m_classManager
| Reference to the class manager. More...
Gaudi::Property< int > | m_SIGo {this, "Go", 0, "For SI's \"Go\" command via callback"}
Gaudi::Property< int > | m_SIExit {this, "Exit", 0, "For SI's \"Exit\" command via callback"}
Gaudi::Property< std::vector< std::string > > | m_topAlgNameList {this, "TopAlg", {}, "List of top level algorithms names"}
Gaudi::Property< std::vector< std::string > > | m_outStreamNameList {this, "OutStream", {}, "List of output stream names"}
Gaudi::Property< std::string > | m_outStreamType
Gaudi::Property< std::string > | m_messageSvcType {this, "MessageSvcType", "MessageSvc", "MessageSvc type"}
Gaudi::Property< std::string > | m_jobOptionsSvcType {this, "JobOptionsSvcType", "JobOptionsSvc", "JobOptionsSvc type"}
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< IMessageSvc > | m_messageSvc
| Reference to the message service. More...
SmartIF< IRunable > | m_runable
| Reference to the runable object. More...
SmartIF< IEventProcessor > | m_processingMgr
| Reference to processing manager object. More...
SmartIF< IJobOptionsSvc > | m_jobOptionsSvc
| Reference to JobOption service. More...
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 {this, "ExtSvc", {}, "List of external services names"}
Gaudi::Property< bool > | m_extSvcCreates
Gaudi::Property< std::vector< std::string > > | m_multiThreadSvcNameList {this, "MultiThreadExtSvc"}
| List of external services names for which we want a copy per evt thread. More...
Gaudi::Property< int > | m_noOfEvtThreads {this, "NoOfThreads", 0, "MultiThreadSvc copies"}
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"}
Gaudi::Property< std::string > | m_eventLoopMgr {this, "EventLoop", "EventLoopMgr", "Processing manager type"}
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< bool > | m_codeCheck {this, "StatusCodeCheck", false, "Activate StatusCode checking"}
Gaudi::Property< int > | m_pluginDebugLevel {this, "PluginDebugLevel", 0, "Debug level for the plugin system"}
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...
bool | m_useHiveAlgorithmManager

## Private Attributes
std::vector< std::string > | m_okDlls
| names of successfully loaded dlls More...

## Additional Inherited Members
Public Types inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > >
using | base_class = CommonMessaging

## 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 47 of file ApplicationMgr.h.

## Member Typedef Documentation

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

## Constructor & Destructor Documentation

ApplicationMgr::ApplicationMgr | ( | IInterface * | = `nullptr` | ) |

Definition at line 47 of file ApplicationMgr.cpp.

48 {
49 // IInterface initialization
50 addRef(); // Initial count set to 1
51
52 // Instantiate component managers
53 m_managers[IService::interfaceID().id()] = new ServiceManager( this );
54
55 m_svcLocator = svcManager();
56
57 // Instantiate internal services
58 // SvcLocator/Factory HAS to be already instantiated
59 m_classManager = new DLLClassManager( this );
60
61 AlgorithmManager* algMgr = new AlgorithmManager( this );
62 m_managers[IAlgorithm::interfaceID().id()] = algMgr;
63 // m_managers[IAlgorithm::interfaceID().id()] = new HiveAlgorithmManager(this);
64
65 // This property is not hosted in the ApplicationMgr instance
66 declareProperty( "AlgTypeAliases", algMgr->typeAliases(),
67 "Aliases of algorithm types, to replace an algorithm type for every instance" );
68
69 // Add action handlers to the appropriate properties
70 m_SIGo.declareUpdateHandler( &ApplicationMgr::SIGoHandler, this );
71 m_SIExit.declareUpdateHandler( &ApplicationMgr::SIExitHandler, this );
72 m_topAlgNameList.declareUpdateHandler( &ApplicationMgr::evtLoopPropertyHandler, this );
73 m_outStreamNameList.declareUpdateHandler( &ApplicationMgr::evtLoopPropertyHandler, this );
74 m_outStreamType.declareUpdateHandler( &ApplicationMgr::evtLoopPropertyHandler, this );
75 m_pluginDebugLevel.declareUpdateHandler( &ApplicationMgr::pluginDebugPropertyHandler, this );
76 // ServiceMgr Initialization loop checking
77 m_loopCheck.declareUpdateHandler( &ApplicationMgr::initLoopCheckHndlr, this );
78 svcManager()->setLoopCheckEnabled( m_loopCheck );
79
80 m_svcMapping = {"EvtDataSvc/EventDataSvc",
81 "DetDataSvc/DetectorDataSvc",
82 "HistogramSvc/HistogramDataSvc",
83 "HbookCnv::PersSvc/HbookHistSvc",
84 "RootHistCnv::PersSvc/RootHistSvc",
85 "EvtPersistencySvc/EventPersistencySvc",
86 "DetPersistencySvc/DetectorPersistencySvc",
87 "HistogramPersistencySvc/HistogramPersistencySvc"};
88 }
ServiceManager
The ServiceManager class is in charge of the creation of concrete instances of Services.
Definition: ServiceManager.h:36
AlgorithmManager
The AlgorithmManager class is in charge of the creation of concrete instances of Algorithms.
Definition: AlgorithmManager.h:31
ApplicationMgr::SIExitHandler
void SIExitHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:930
ApplicationMgr::SIGoHandler
void SIGoHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:913
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:180
ApplicationMgr::m_outStreamType
Gaudi::Property< std::string > m_outStreamType
Definition: ApplicationMgr.h:199
ApplicationMgr::m_SIGo
Gaudi::Property< int > m_SIGo
Definition: ApplicationMgr.h:195
PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Declare a property.
Definition: PropertyHolder.h:99
AlgorithmManager::typeAliases
AlgTypeAliasesMap & typeAliases()
Definition: AlgorithmManager.h:86
ApplicationMgr::m_outStreamNameList
Gaudi::Property< std::vector< std::string > > m_outStreamNameList
Definition: ApplicationMgr.h:198
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
ApplicationMgr::evtLoopPropertyHandler
void evtLoopPropertyHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:941
ApplicationMgr::m_topAlgNameList
Gaudi::Property< std::vector< std::string > > m_topAlgNameList
Definition: ApplicationMgr.h:197
ApplicationMgr::initLoopCheckHndlr
void initLoopCheckHndlr(Gaudi::Details::PropertyBase &)
Definition: ApplicationMgr.cpp:1230
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:191
DLLClassManager
Definition: DLLClassManager.h:27
ApplicationMgr::m_SIExit
Gaudi::Property< int > m_SIExit
Definition: ApplicationMgr.h:196
ApplicationMgr::m_svcMapping
Gaudi::Property< std::vector< std::string > > m_svcMapping
Definition: ApplicationMgr.h:208
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:193
ApplicationMgr::pluginDebugPropertyHandler
void pluginDebugPropertyHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:1219
ISvcManager::setLoopCheckEnabled
virtual void setLoopCheckEnabled(bool en=true)=0
Set the value of the initialization loop check flag.
ApplicationMgr::m_pluginDebugLevel
Gaudi::Property< int > m_pluginDebugLevel
Definition: ApplicationMgr.h:246
ApplicationMgr::m_loopCheck
Gaudi::Property< bool > m_loopCheck
Definition: ApplicationMgr.h:259

ApplicationMgr::~ApplicationMgr | ( |  | ) |
| override default

## Member Function Documentation

StatusCode ApplicationMgr::addMultiSvc | ( | const Gaudi::Utils::TypeNameString & | typeName,
|  | int | prio
| ) |  |
| protected

add one or more copies of svc type/name as determined by NoOfThreads

Definition at line 1097 of file ApplicationMgr.cpp.

1098 {
1099 using Gaudi::Utils::TypeNameString;
1100 StatusCode result = StatusCode::SUCCESS;
1101 MsgStream log( m_messageSvc, m_name );
1102 if ( 0 == m_noOfEvtThreads ) {
1103 result = svcManager()->addService( typeName, prio );
1104 // result = svcManager()->addService(name, type, prio); // CHECKME???
1105 if ( result.isFailure() ) {
1106 log << MSG::ERROR << "addMultiSvc: Cannot add service " << typeName.type() << "/" << typeName.name() << endmsg;
1107 } else {
1108 ON_VERBOSE
1109 log << MSG::VERBOSE << "addMultiSvc: added service " << typeName.type() << "/" << typeName.name() << endmsg;
1110 }
1111 } else {
1112 for ( int iCopy = 0; iCopy < m_noOfEvtThreads; ++iCopy ) {
1113 const std::string& type = typeName.type();
1114 std::string thrName( typeName.name() + getGaudiThreadIDfromID( iCopy ) );
1115 result = svcManager()->addService( TypeNameString( thrName, type ), prio );
1116 if ( result.isFailure() ) {
1117 log << MSG::ERROR << "addMultiSvc: Cannot add service " << type << "/" << thrName << endmsg;
1118 } else {
1119 ON_VERBOSE
1120 log << MSG::VERBOSE << "addMultiSvc: added service " << type << "/" << thrName << endmsg;
1121 }
1122 }
1123 }
1124 return result;
1125 }
ISvcManager::addService
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MSG::VERBOSE
Definition: IMessageSvc.h:16
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
std::string
STL class.
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
gaudirun.type
type
Definition: gaudirun.py:133
getGaudiThreadIDfromID
GAUDI_API std::string getGaudiThreadIDfromID(int iCopy)
helper function to extract Gaudi Thread ID from thread copy number
Definition: ThreadGaudi.cpp:16
Gaudi::Utils::TypeNameString::type
const std::string & type() const
Definition: TypeNameString.h:39
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:204
MSG::ERROR
Definition: IMessageSvc.h:16
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:35
Gaudi::Utils::TypeNameString::name
const std::string & name() const
Definition: TypeNameString.h:40
ApplicationMgr::m_noOfEvtThreads
Gaudi::Property< int > m_noOfEvtThreads
Definition: ApplicationMgr.h:228
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

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

Definition at line 141 of file ApplicationMgr.h.

142 {
143 // Cache the casted pointer to IAlgManager
144 if ( !m_algManager ) {
145 m_algManager = getManager<IAlgorithm>();
146 }
147 return m_algManager;
148 }
ApplicationMgr::m_algManager
SmartIF< IAlgManager > m_algManager
Cached pointer to the manager of algorithms.
Definition: ApplicationMgr.h:188

StatusCode ApplicationMgr::configure | ( |  | ) |
| override

Definition at line 241 of file ApplicationMgr.cpp.

242 {
243
244 // Check if the state is compatible with the transition
245 MsgStream tlog( m_messageSvc, name() );
246 if ( Gaudi::StateMachine::CONFIGURED == m_state ) {
247 tlog << MSG::INFO << "Already Configured" << endmsg;
248 return StatusCode::SUCCESS;
249 }
250 if ( Gaudi::StateMachine::OFFLINE != m_state ) {
251 tlog << MSG::FATAL << "configure: Invalid state \"" << m_state << "\"" << endmsg;
252 return StatusCode::FAILURE;
253 }
254 m_targetState = Gaudi::StateMachine::CONFIGURED;
255
256 // Reset application return code.
257 m_returnCode = Gaudi::ReturnCode::Success;
258
259 StatusCode sc;
260 sc = i_startup();
261 if ( !sc.isSuccess() ) {
262 return sc;
263 }
264
265 MsgStream log( m_messageSvc, name() );
266
267 // Get my own options using the Job options service
268 if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Getting my own properties" << endmsg;
269 sc = m_jobOptionsSvc->setMyProperties( name(), this );
270 if ( !sc.isSuccess() ) {
271 log << MSG::WARNING << "Problems getting my properties from JobOptionsSvc" << endmsg;
272 return sc;
273 }
274
275 // Check current outputLevel to eventually inform the MessageSvc
276 if ( m_outputLevel != MSG::NIL && !m_appName.empty() ) {
277 assert( m_messageSvc );
278 m_messageSvc->setOutputLevel( name(), m_outputLevel );
279 // Print a welcome message
280 log << MSG::ALWAYS << std::endl
281 << "=================================================================="
282 << "==================================================================" << std::endl
283 << " "
284 << " Welcome to " << m_appName.value();
285
286 if ( !m_appVersion.empty() ) {
287 log << MSG::ALWAYS << " version " << m_appVersion.value();
288 } else {
289 log << MSG::ALWAYS << " (GaudiCoreSvc "
290 << "v" << GAUDICORESVC_MAJOR_VERSION << "r" << GAUDICORESVC_MINOR_VERSION
291 #if GAUDICORESVC_PATCH_VERSION
292 << "p" << GAUDICORESVC_PATCH_VERSION
293 #endif
294 << ")";
295 }
296
297 // Add the host name and current time to the message
298 log << MSG::ALWAYS << std::endl
299 << " "
300 << " running on " << System::hostName() << " on " << Gaudi::Time::current().format( true ) << std::endl
301 << "=================================================================="
302 << "==================================================================" << endmsg;
303 }
304
305 // print all own properties if the options "PropertiesPrint" is set to true
306 if ( m_propertiesPrint ) {
307 const auto& properties = getProperties();
308 log << MSG::ALWAYS << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
309 << " #properties = " << properties.size() << endmsg;
310 for ( const auto& property : properties ) {
311 log << "Property ['Name': Value] = " << *property << endmsg;
312 }
313 }
314
315 // Check if StatusCode need to be checked
316 if ( m_codeCheck ) {
317 StatusCode::enableChecking();
318 sc = addMultiSvc( "StatusCodeSvc", -9999 );
319 if ( sc.isFailure() ) {
320 log << MSG::FATAL << "Error adding StatusCodeSvc for multiple threads" << endmsg;
321 return StatusCode::FAILURE;
322 }
323 } else {
324 StatusCode::disableChecking();
325 }
326
327 // set the requested environment variables
328 for ( auto& var : m_environment ) {
329 const std::string& name = var.first;
330 const std::string& value = var.second;
331 std::string old = System::getEnv( name.c_str() );
332 const MSG::Level lvl = ( !old.empty() && ( old != "UNKNOWN" ) ) ? MSG::WARNING : MSG::DEBUG;
333 if ( UNLIKELY( m_outputLevel <= lvl ) ) log << lvl << "Setting " << name << " = " << value << endmsg;
334 System::setEnv( name, value );
335 }
336
337 // Declare Service Types
338 for ( auto& j : m_svcMapping ) {
339 Gaudi::Utils::TypeNameString itm( j );
340 if ( declareMultiSvcType( itm.name(), itm.type() ).isFailure() ) {
341 log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
342 return StatusCode::FAILURE;
343 }
344 }
345 for ( auto& j : m_svcOptMapping ) {
346 Gaudi::Utils::TypeNameString itm( j );
347 if ( declareMultiSvcType( itm.name(), itm.type() ).isFailure() ) {
348 log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
349 return StatusCode::FAILURE;
350 }
351 }
352
353 //--------------------------------------------------------------------------
354 // Declare other Services and Algorithms by loading DLL's
355 sc = decodeDllNameList();
356 if ( sc.isFailure() ) {
357 log << MSG::ERROR << "Failure loading declared DLL's" << endmsg;
358 return sc;
359 }
360
361 //--------------------------------------------------------------------------
362 // Deal with the services explicitly declared by the user.
363 sc = decodeExtSvcNameList();
364 if ( sc.isFailure() ) {
365 log << MSG::ERROR << "Failure during external service association" << endmsg;
366 return sc;
367 }
368
369 sc = decodeMultiThreadSvcNameList();
370 if ( sc.isFailure() ) {
371 log << MSG::ERROR << "Failure during multi thread service creation" << endmsg;
372 return sc;
373 }
374
375 sc = decodeCreateSvcNameList();
376 if ( sc.isFailure() ) {
377 log << MSG::ERROR << "Failure during external service creation" << endmsg;
378 return sc;
379 }
380
381 //--------------------------------------------------------------------------
382 // Retrieve intrinsic services. If needed configure them.
383 //--------------------------------------------------------------------------
384 const Gaudi::Utils::TypeNameString evtloop_item( m_eventLoopMgr );
385 sc = addMultiSvc( evtloop_item, ServiceManager::DEFAULT_SVC_PRIORITY * 10 );
386 if ( !sc.isSuccess() ) {
387 log << MSG::FATAL << "Error adding :" << m_eventLoopMgr << endmsg;
388 return sc;
389 }
390
391 if ( m_noOfEvtThreads == 0 ) {
392 m_runable = m_svcLocator->service( m_runableType );
393 if ( !m_runable ) {
394 log << MSG::FATAL << "Error retrieving Runable: " << m_runableType.value() << "\n Check option ApplicationMgr."
395 << m_runableType.name() << endmsg;
396 return sc;
397 }
398 m_processingMgr = m_svcLocator->service( evtloop_item );
399 if ( !m_processingMgr ) {
400 log << MSG::FATAL << "Error retrieving Processing manager: " << m_eventLoopMgr.value()
401 << "\n Check option ApplicationMgr." << m_eventLoopMgr.name() << "\n No events will be processed." << endmsg;
402 return sc;
403 }
404 }
405
406 // Establish Update Handlers for ExtSvc and DLLs Properties
407 m_extSvcNameList.declareUpdateHandler( &ApplicationMgr::extSvcNameListHandler, this );
408 m_createSvcNameList.declareUpdateHandler( &ApplicationMgr::createSvcNameListHandler, this );
409 m_multiThreadSvcNameList.declareUpdateHandler( &ApplicationMgr::multiThreadSvcNameListHandler, this );
410 m_dllNameList.declareUpdateHandler( &ApplicationMgr::dllNameListHandler, this );
411
412 if ( m_actHistory ) {
413 // Create HistorySvc with a priority to ensure it's initialized last, finalized first
414 sc = svcManager()->addService( "HistorySvc", std::numeric_limits<int>::max() );
415 if ( sc.isFailure() ) {
416 log << MSG::FATAL << "Error adding HistorySvc" << endmsg;
417 return StatusCode::FAILURE;
418 }
419
420 if ( m_noOfEvtThreads > 0 ) {
421 sc = addMultiSvc( "HistorySvc", std::numeric_limits<int>::max() );
422 if ( sc.isFailure() ) {
423 log << MSG::FATAL << "Error adding HistorySvc for multiple threads" << endmsg;
424 return StatusCode::FAILURE;
425 }
426 }
427 }
428
429 log << MSG::INFO << "Application Manager Configured successfully" << endmsg;
430 m_state = m_targetState;
431 return StatusCode::SUCCESS;
432 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:206
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:415
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:128
ISvcManager::addService
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::m_propertiesPrint
Gaudi::Property< bool > m_propertiesPrint
Definition: ApplicationMgr.h:272
std::string::empty
T empty(T...args)
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:1140
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:276
System::setEnv
GAUDI_API int setEnv(const std::string &name, const std::string &value, int overwrite=1)
Set an environment variables.
Definition: System.cpp:538
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:16
ApplicationMgr::m_codeCheck
Gaudi::Property< bool > m_codeCheck
Definition: ApplicationMgr.h:245
ApplicationMgr::m_runable
SmartIF< IRunable > m_runable
Reference to the runable object.
Definition: ApplicationMgr.h:213
PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyHolder.h:343
PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::getProperties
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
Definition: PropertyHolder.h:329
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:336
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
MSG::DEBUG
Definition: IMessageSvc.h:16
std::endl
T endl(T...args)
ApplicationMgr::multiThreadSvcNameListHandler
void multiThreadSvcNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:1029
Gaudi::Time::current
static Time current()
Returns the current time.
Definition: Time.cpp:112
ApplicationMgr::m_environment
Gaudi::Property< std::map< std::string, std::string > > m_environment
Definition: ApplicationMgr.h:256
ApplicationMgr::m_multiThreadSvcNameList
Gaudi::Property< std::vector< std::string > > m_multiThreadSvcNameList
List of external services names for which we want a copy per evt thread.
Definition: ApplicationMgr.h:227
ApplicationMgr::m_appVersion
Gaudi::Property< std::string > m_appVersion
Definition: ApplicationMgr.h:243
StatusCode::enableChecking
static GAUDI_API void enableChecking()
Definition: StatusCode.cpp:18
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:215
ApplicationMgr::createSvcNameListHandler
void createSvcNameListHandler(Gaudi::Details::PropertyBase &)
Definition: ApplicationMgr.cpp:952
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:214
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
ApplicationMgr::m_eventLoopMgr
Gaudi::Property< std::string > m_eventLoopMgr
Definition: ApplicationMgr.h:238
std::string
STL class.
ApplicationMgr::addMultiSvc
StatusCode addMultiSvc(const Gaudi::Utils::TypeNameString &typeName, int prio)
add one or more copies of svc type/name as determined by NoOfThreads
Definition: ApplicationMgr.cpp:1097
MSG::FATAL
Definition: IMessageSvc.h:16
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:79
MSG::Level
Level
Definition: IMessageSvc.h:16
ApplicationMgr::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: ApplicationMgr.h:241
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
ApplicationMgr::extSvcNameListHandler
void extSvcNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:988
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:191
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IJobOptionsSvc::setMyProperties
virtual StatusCode setMyProperties(const std::string &client, IProperty *me)=0
Override default properties of the calling client.
ApplicationMgr::m_extSvcNameList
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
Definition: ApplicationMgr.h:222
ApplicationMgr::dllNameListHandler
void dllNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:1130
ApplicationMgr::m_runableType
Gaudi::Property< std::string > m_runableType
Definition: ApplicationMgr.h:237
MSG::NIL
Definition: IMessageSvc.h:16
ApplicationMgr::m_svcOptMapping
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
Definition: ApplicationMgr.h:209
ApplicationMgr::m_svcMapping
Gaudi::Property< std::vector< std::string > > m_svcMapping
Definition: ApplicationMgr.h:208
ApplicationMgr::m_dllNameList
Gaudi::Property< std::vector< std::string > > m_dllNameList
Definition: ApplicationMgr.h:230
ApplicationMgr::m_actHistory
Gaudi::Property< bool > m_actHistory
Definition: ApplicationMgr.h:244
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:999
System::hostName
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:341
ApplicationMgr::m_createSvcNameList
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
Definition: ApplicationMgr.h:248
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:41
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:962
std::string::c_str
T c_str(T...args)
ApplicationMgr::i_startup
StatusCode i_startup()
Internal startup routine.
Definition: ApplicationMgr.cpp:130
MSG::ERROR
Definition: IMessageSvc.h:16
StatusCode::disableChecking
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:20
MSG::WARNING
Definition: IMessageSvc.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::m_appName
Gaudi::Property< std::string > m_appName
Definition: ApplicationMgr.h:242
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:18
MSG::INFO
Definition: IMessageSvc.h:16
ApplicationMgr::decodeMultiThreadSvcNameList
StatusCode decodeMultiThreadSvcNameList()
Definition: ApplicationMgr.cpp:1040
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:15
ApplicationMgr::m_noOfEvtThreads
Gaudi::Property< int > m_noOfEvtThreads
Definition: ApplicationMgr.h:228
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
MSG::ALWAYS
Definition: IMessageSvc.h:16
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
IMessageSvc::setOutputLevel
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.
Gaudi::Time::format
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:260
Gaudi.Configuration.log
log
Definition: Configuration.py:13
std::numeric_limits
ApplicationMgr::declareMultiSvcType
StatusCode declareMultiSvcType(const std::string &name, const std::string &type)
declare one or more copies of svc type/name as determined by NoOfThreads
Definition: ApplicationMgr.cpp:1068

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

Definition at line 952 of file ApplicationMgr.cpp.

953 {
954 if ( !( decodeCreateSvcNameList() ).isSuccess() ) {
955 throw GaudiException( "Failed to create ext services", "MinimalEventLoopMgr::createSvcNameListHandler",
956 StatusCode::FAILURE );
957 }
958 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:962
StatusCode::FAILURE
Definition: StatusCode.h:29

StatusCode ApplicationMgr::declareMultiSvcType | ( | const std::string & | name,
|  | const std::string & | type
| ) |  |
| protected

declare one or more copies of svc type/name as determined by NoOfThreads

Definition at line 1068 of file ApplicationMgr.cpp.

1069 {
1070 StatusCode result = StatusCode::SUCCESS;
1071 MsgStream log( m_messageSvc, m_name );
1072 if ( 0 == m_noOfEvtThreads ) {
1073 result = svcManager()->declareSvcType( name, type );
1074 if ( result.isFailure() ) {
1075 log << MSG::ERROR << "declareMultiSvcType: Cannot declare service " << type << "/" << name << endmsg;
1076 } else {
1077 ON_VERBOSE
1078 log << MSG::VERBOSE << "declareMultiSvcType: declared service " << type << "/" << name << endmsg;
1079 }
1080 } else {
1081 for ( int iCopy = 0; iCopy < m_noOfEvtThreads; ++iCopy ) {
1082 std::string thrName( name + getGaudiThreadIDfromID( iCopy ) );
1083 result = svcManager()->declareSvcType( thrName, type );
1084 if ( result.isFailure() ) {
1085 log << MSG::ERROR << "declareMultiSvcType: Cannot declare service " << type << "/" << thrName << endmsg;
1086 } else {
1087 ON_VERBOSE
1088 log << MSG::VERBOSE << "declareMultiSvcType: declared service " << type << "/" << thrName << endmsg;
1089 }
1090 }
1091 }
1092 return result;
1093 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MSG::VERBOSE
Definition: IMessageSvc.h:16
ISvcManager::declareSvcType
virtual StatusCode declareSvcType(const std::string &svcname, const std::string &svctype)=0
Declare the type of the service to be used when crating a given service name.
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
getGaudiThreadIDfromID
GAUDI_API std::string getGaudiThreadIDfromID(int iCopy)
helper function to extract Gaudi Thread ID from thread copy number
Definition: ThreadGaudi.cpp:16
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:204
MSG::ERROR
Definition: IMessageSvc.h:16
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:35
ApplicationMgr::m_noOfEvtThreads
Gaudi::Property< int > m_noOfEvtThreads
Definition: ApplicationMgr.h:228
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::decodeCreateSvcNameList | ( |  | ) |

Definition at line 962 of file ApplicationMgr.cpp.

963 {
964 StatusCode result = StatusCode::SUCCESS;
965 const auto& theNames = m_createSvcNameList.value();
966 auto it = theNames.begin();
967 auto et = theNames.end();
968 while ( result.isSuccess() && it != et ) {
969 Gaudi::Utils::TypeNameString item( *it++ );
970 if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
971 MsgStream log( m_messageSvc, m_name );
972 log << MSG::ERROR << "decodeCreateSvcNameList: Cannot create service " << item.type() << "/" << item.name()
973 << endmsg;
974 } else {
975 ON_DEBUG
976 {
977 MsgStream log( m_messageSvc, m_name );
978 log << MSG::DEBUG << "decodeCreateSvcNameList: Created service " << item.type() << "/" << item.name() << endmsg;
979 }
980 }
981 }
982 return result;
983 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
MSG::DEBUG
Definition: IMessageSvc.h:16
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:34
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_createSvcNameList
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
Definition: ApplicationMgr.h:248
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:204
MSG::ERROR
Definition: IMessageSvc.h:16
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::decodeDllNameList | ( |  | ) |

Definition at line 1140 of file ApplicationMgr.cpp.

1141 {
1142
1143 MsgStream log( m_messageSvc, m_name );
1144 StatusCode result = StatusCode::SUCCESS;
1145
1146 // Clean up multiple entries from DLL list
1147 // -------------------------------------------------------------------------
1148 std::vector<std::string> newList;
1149 std::map<std::string, unsigned int> dllInList, duplicateList;
1150 {
1151 for ( const auto it : m_dllNameList ) {
1152 if ( 0 == dllInList[it] ) {
1153 newList.push_back( it ); // first instance of this module
1154 } else {
1155 ++duplicateList[it];
1156 } // module listed multiple times
1157 ++dllInList[it]; // increment count for this module
1158 }
1159 }
1160 // m_dllNameList = newList; // update primary list to new, filtered list (do not use the
1161 // property itself otherwise we get called again infinitely)
1162 // List modules that were in there twice..
1163 ON_DEBUG if ( !duplicateList.empty() )
1164 {
1165 log << MSG::DEBUG << "Removed duplicate entries for modules : ";
1166 for ( auto it = duplicateList.begin(); it != duplicateList.end(); ++it ) {
1167 log << it->first << "(" << 1 + it->second << ")";
1168 if ( it != --duplicateList.end() ) log << ", ";
1169 }
1170 log << endmsg;
1171 }
1172 // -------------------------------------------------------------------------
1173
1174 const std::vector<std::string>& theNames = newList;
1175
1176 // only load the new dlls or previously failed dlls
1177 ON_DEBUG log << MSG::DEBUG << "Loading declared DLL's" << endmsg;
1178
1179 std::vector<std::string> successNames, failNames;
1180 for ( const auto& it : theNames ) {
1181 if ( std::find( m_okDlls.rbegin(), m_okDlls.rend(), it ) == m_okDlls.rend() ) {
1182 // found a new module name
1183 StatusCode status = m_classManager->loadModule( it );
1184 if ( status.isFailure() ) {
1185 failNames.push_back( it );
1186 result = StatusCode::FAILURE;
1187 } else {
1188 successNames.push_back( it );
1189 }
1190 }
1191 }
1192
1193 // report back to the user and store the names of the succesfully loaded dlls
1194 if ( !successNames.empty() ) {
1195 log << MSG::INFO << "Successfully loaded modules : ";
1196 for ( auto it = successNames.begin(); it != successNames.end(); it++ ) {
1197 log << ( *it );
1198 if ( ( it + 1 ) != successNames.end() ) log << ", ";
1199 // save name
1200 m_okDlls.push_back( *it );
1201 }
1202 log << endmsg;
1203 }
1204
1205 if ( result == StatusCode::FAILURE ) {
1206 log << MSG::WARNING << "Failed to load modules: ";
1207 for ( auto it = failNames.begin(); it != failNames.end(); it++ ) {
1208 log << ( *it );
1209 if ( ( it + 1 ) != failNames.end() ) log << ", ";
1210 }
1211 log << endmsg;
1212 }
1213 return result;
1214 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
std::map::empty
T empty(T...args)
DLLClassManager::loadModule
StatusCode loadModule(const std::string &module, bool fireIncident=true) override
Definition: DLLClassManager.cpp:30
std::vector::rend
T rend(T...args)
MSG::DEBUG
Definition: IMessageSvc.h:16
std::map::end
T end(T...args)
ApplicationMgr::m_okDlls
std::vector< std::string > m_okDlls
names of successfully loaded dlls
Definition: ApplicationMgr.h:283
std::map< std::string, unsigned int >
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
std::vector::push_back
T push_back(T...args)
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:34
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_dllNameList
Gaudi::Property< std::vector< std::string > > m_dllNameList
Definition: ApplicationMgr.h:230
std::find
T find(T...args)
std::vector< std::string >
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:193
std::map::begin
T begin(T...args)
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:204
MSG::WARNING
Definition: IMessageSvc.h:16
StatusCode::FAILURE
Definition: StatusCode.h:29
MSG::INFO
Definition: IMessageSvc.h:16
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13
std::vector::rbegin
T rbegin(T...args)

StatusCode ApplicationMgr::decodeExtSvcNameList | ( |  | ) |

Definition at line 999 of file ApplicationMgr.cpp.

1000 {
1001 StatusCode result = StatusCode::SUCCESS;
1002
1003 const auto& theNames = m_extSvcNameList.value();
1004
1005 auto it = theNames.begin();
1006 auto et = theNames.end();
1007 while ( result.isSuccess() && it != et ) {
1008 Gaudi::Utils::TypeNameString item( *it++ );
1009 if ( m_extSvcCreates ) {
1010 if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
1011 MsgStream log( m_messageSvc, m_name );
1012 log << MSG::ERROR << "decodeExtSvcNameList: Cannot create service " << item.type() << "/" << item.name()
1013 << endmsg;
1014 }
1015 } else {
1016 if ( ( result = svcManager()->declareSvcType( item.name(), item.type() ) ).isFailure() ) {
1017 MsgStream log( m_messageSvc, m_name );
1018 log << MSG::ERROR << "decodeExtSvcNameList: Cannot declare service " << item.type() << "/" << item.name()
1019 << endmsg;
1020 }
1021 }
1022 }
1023 return result;
1024 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_extSvcNameList
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
Definition: ApplicationMgr.h:222
ApplicationMgr::m_extSvcCreates
Gaudi::Property< bool > m_extSvcCreates
Definition: ApplicationMgr.h:223
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:204
MSG::ERROR
Definition: IMessageSvc.h:16
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::decodeMultiThreadSvcNameList | ( |  | ) |

Definition at line 1040 of file ApplicationMgr.cpp.

1041 {
1042 StatusCode result = StatusCode::SUCCESS;
1043 const auto& theNames = m_multiThreadSvcNameList.value();
1044 for ( int iCopy = 0; iCopy < m_noOfEvtThreads; ++iCopy ) {
1045 for ( const auto& it : theNames ) {
1046 Gaudi::Utils::TypeNameString item( it );
1047 result = addMultiSvc( item, ServiceManager::DEFAULT_SVC_PRIORITY );
1048 // FIXME SHOULD CLONE?
1049 if ( result.isFailure() ) {
1050 MsgStream log( m_messageSvc, m_name );
1051 log << MSG::ERROR << "decodeMultiThreadSvcNameList: Cannot create service " << item.type() << "/" << item.name()
1052 << endmsg;
1053 } else {
1054 ON_VERBOSE
1055 {
1056 MsgStream log( m_messageSvc, m_name );
1057 log << MSG::VERBOSE << "decodeMultiThreadSvcNameList: created service " << item.type() << "/" << item.name()
1058 << endmsg;
1059 }
1060 }
1061 }
1062 }
1063 return result;
1064 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::m_multiThreadSvcNameList
Gaudi::Property< std::vector< std::string > > m_multiThreadSvcNameList
List of external services names for which we want a copy per evt thread.
Definition: ApplicationMgr.h:227
MSG::VERBOSE
Definition: IMessageSvc.h:16
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
ApplicationMgr::addMultiSvc
StatusCode addMultiSvc(const Gaudi::Utils::TypeNameString &typeName, int prio)
add one or more copies of svc type/name as determined by NoOfThreads
Definition: ApplicationMgr.cpp:1097
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:204
MSG::ERROR
Definition: IMessageSvc.h:16
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:35
ApplicationMgr::m_noOfEvtThreads
Gaudi::Property< int > m_noOfEvtThreads
Definition: ApplicationMgr.h:228
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

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

Definition at line 1130 of file ApplicationMgr.cpp.

1131 {
1132 if ( !( decodeDllNameList() ).isSuccess() ) {
1133 throw GaudiException( "Failed to load DLLs.", "MinimalEventLoopMgr::dllNameListHandler", StatusCode::FAILURE );
1134 }
1135 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:1140
StatusCode::FAILURE
Definition: StatusCode.h:29

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

Definition at line 941 of file ApplicationMgr.cpp.

942 {
943 if ( m_processingMgr ) {
944 auto props = m_processingMgr.as<IProperty>();
945 if ( props ) props->setProperty( p ).ignore();
946 }
947 }
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:214
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:115
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20

StatusCode ApplicationMgr::executeEvent | ( | void * | par | ) |
| override

implementation of IEventProcessor::executeEvent(void*)

Definition at line 819 of file ApplicationMgr.cpp.

820 {
821 MsgStream log( m_messageSvc, name() );
822 if ( m_state == Gaudi::StateMachine::RUNNING ) {
823 if ( m_processingMgr ) {
824 return m_processingMgr->executeEvent( par );
825 }
826 }
827 log << MSG::FATAL << "executeEvent: Invalid state \"" << FSMState() << "\"" << endmsg;
828 return StatusCode::FAILURE;
829 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
IEventProcessor::executeEvent
virtual StatusCode executeEvent(void *par=0)=0
Process single event.
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:214
MSG::FATAL
Definition: IMessageSvc.h:16
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:437
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:868
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::executeRun | ( | int | evtmax | ) |
| override

implementation of IEventProcessor::executeRun(int)

Definition at line 834 of file ApplicationMgr.cpp.

835 {
836 MsgStream log( m_messageSvc, name() );
837 if ( m_state == Gaudi::StateMachine::RUNNING ) {
838 if ( m_processingMgr ) {
839 return m_processingMgr->executeRun( evtmax );
840 }
841 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
842 return StatusCode::SUCCESS;
843 }
844 log << MSG::FATAL << "executeRun: Invalid state \"" << FSMState() << "\"" << endmsg;
845 return StatusCode::FAILURE;
846 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:214
MSG::FATAL
Definition: IMessageSvc.h:16
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
MSG::WARNING
Definition: IMessageSvc.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:868
IEventProcessor::executeRun
virtual StatusCode executeRun(int maxevt)=0
Process the maxevt events as a Run (beginRun() and endRun() called)
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

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

Definition at line 988 of file ApplicationMgr.cpp.

989 {
990 if ( !( decodeExtSvcNameList() ).isSuccess() ) {
991 throw GaudiException( "Failed to declare ext services", "MinimalEventLoopMgr::extSvcNameListHandler",
992 StatusCode::FAILURE );
993 }
994 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:999
StatusCode::FAILURE
Definition: StatusCode.h:29

StatusCode ApplicationMgr::finalize | ( |  | ) |
| override

Definition at line 584 of file ApplicationMgr.cpp.

585 {
586 MsgStream log( m_messageSvc, name() );
587 if ( m_state == Gaudi::StateMachine::CONFIGURED ) {
588 log << MSG::INFO << "Already Finalized" << endmsg;
589 return StatusCode::SUCCESS;
590 }
591 if ( m_state != Gaudi::StateMachine::INITIALIZED ) {
592 log << MSG::FATAL << "finalize: Invalid state \"" << m_state << "\"" << endmsg;
593 return StatusCode::FAILURE;
594 }
595 m_targetState = Gaudi::StateMachine::CONFIGURED;
596
597 // disable message suppression in finalize
598 m_svcLocator->service<IProperty>( "MessageSvc" )
599 ->setProperty( Gaudi::Property<bool>( "enableSuppression", false ) )
600 .ignore();
601
602 // Finalize independently managed Algorithms
603 StatusCode sc = algManager()->finalize();
604 if ( sc.isFailure() ) {
605 log << MSG::WARNING << "Failed to finalize an algorithm." << endmsg;
606 m_returnCode = Gaudi::ReturnCode::FinalizationFailure;
607 }
608
609 // Finalize all Services
610 sc = svcManager()->finalize();
611 if ( sc.isFailure() ) {
612 log << MSG::WARNING << "Failed to finalize a service." << endmsg;
613 m_returnCode = Gaudi::ReturnCode::FinalizationFailure;
614 }
615
616 // svcManager()->removeService( (IService*) m_processingMgr.get() );
617 // svcManager()->removeService( (IService*) m_runable.get() );
618
619 if ( m_codeCheck ) {
620 StatusCode::disableChecking();
621 }
622
623 if ( sc.isSuccess() ) {
624 log << MSG::INFO << "Application Manager Finalized successfully" << endmsg;
625 } else {
626 log << MSG::ERROR << "Application Manager failed to finalize" << endmsg;
627 }
628
629 m_state = m_targetState;
630 return sc;
631 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:206
Gaudi::ReturnCode::FinalizationFailure
constexpr int FinalizationFailure
Error codes for operation failures.
Definition: AppReturnCode.h:34
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:276
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:16
ApplicationMgr::m_codeCheck
Gaudi::Property< bool > m_codeCheck
Definition: ApplicationMgr.h:245
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
PropertyHolder< CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:208
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
MSG::FATAL
Definition: IMessageSvc.h:16
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:79
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:191
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IStateful::finalize
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).
MSG::ERROR
Definition: IMessageSvc.h:16
StatusCode::disableChecking
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:20
MSG::WARNING
Definition: IMessageSvc.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
MSG::INFO
Definition: IMessageSvc.h:16
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

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

Definition at line 868 of file ApplicationMgr.cpp.

868 { return m_state; }
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
template<class I >

SmartIF<IComponentManager>& ApplicationMgr::getManager | ( |  | ) |
| inline

Definition at line 127 of file ApplicationMgr.h.

128 {
129 return m_managers[I::interfaceID().id()];
130 }
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:180

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

696 {
697 StatusCode sc = StatusCode( StatusCode::SUCCESS, true );
698
699 switch ( state ) {
700
701 case Gaudi::StateMachine::OFFLINE:
702 switch ( m_state ) {
703 case Gaudi::StateMachine::OFFLINE:
704 return StatusCode::SUCCESS;
705 break;
706 case Gaudi::StateMachine::CONFIGURED:
707 return terminate();
708 break;
709 default: // Gaudi::StateMachine::INITIALIZED or Gaudi::StateMachine::RUNNING
710 sc = GoToState( Gaudi::StateMachine::CONFIGURED );
711 if ( sc.isSuccess() ) {
712 return terminate();
713 }
714 break;
715 }
716 break;
717
718 case Gaudi::StateMachine::CONFIGURED:
719 switch ( m_state ) {
720 case Gaudi::StateMachine::CONFIGURED:
721 return StatusCode::SUCCESS;
722 break;
723 case Gaudi::StateMachine::OFFLINE:
724 return configure();
725 break;
726 case Gaudi::StateMachine::INITIALIZED:
727 return finalize();
728 break;
729 default: // Gaudi::StateMachine::RUNNING
730 sc = GoToState( Gaudi::StateMachine::INITIALIZED );
731 if ( sc.isSuccess() ) {
732 return finalize();
733 }
734 break;
735 }
736 break;
737
738 case Gaudi::StateMachine::INITIALIZED:
739 switch ( m_state ) {
740 case Gaudi::StateMachine::INITIALIZED:
741 return StatusCode::SUCCESS;
742 break;
743 case Gaudi::StateMachine::CONFIGURED:
744 return initialize();
745 break;
746 case Gaudi::StateMachine::RUNNING:
747 return stop();
748 break;
749 default: // Gaudi::StateMachine::OFFLINE
750 sc = GoToState( Gaudi::StateMachine::CONFIGURED );
751 if ( sc.isSuccess() ) {
752 return initialize();
753 }
754 break;
755 }
756 break;
757
758 case Gaudi::StateMachine::RUNNING:
759 switch ( m_state ) {
760 case Gaudi::StateMachine::RUNNING:
761 return StatusCode::SUCCESS;
762 break;
763 case Gaudi::StateMachine::INITIALIZED:
764 return start();
765 break;
766 default: // Gaudi::StateMachine::OFFLINE or Gaudi::StateMachine::CONFIGURED
767 sc = GoToState( Gaudi::StateMachine::INITIALIZED );
768 if ( sc.isSuccess() ) {
769 return start();
770 }
771 break;
772 }
773 break;
774 }
775
776 // If I get here, there has been a problem in the recursion
777
778 if ( ignoreFailures ) {
779 // force the new state
780 m_state = state;
781 return StatusCode::SUCCESS;
782 }
783
784 return sc;
785 }
ApplicationMgr::initialize
StatusCode initialize() override
Definition: ApplicationMgr.cpp:437
StatusCode::SUCCESS
Definition: StatusCode.h:29
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:16
compareRootHistos.state
state
Definition: compareRootHistos.py:424
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::terminate
StatusCode terminate() override
Definition: ApplicationMgr.cpp:636
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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:695
ApplicationMgr::finalize
StatusCode finalize() override
Definition: ApplicationMgr.cpp:584
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
ApplicationMgr::start
StatusCode start() override
Definition: ApplicationMgr.cpp:494
ApplicationMgr::configure
StatusCode configure() override
Definition: ApplicationMgr.cpp:241
ApplicationMgr::stop
StatusCode stop() override
Definition: ApplicationMgr.cpp:546
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:15

StatusCode ApplicationMgr::i_startup | ( |  | ) |
| protected

Internal startup routine.

Definition at line 130 of file ApplicationMgr.cpp.

131 {
132
133 StatusCode sc;
134
135 // declare factories in current module
136 m_classManager->loadModule( "" ).ignore();
137
138 // Note: we cannot use CommonMessaging methods here because MessageSvc is not there yet
139 MsgStream log( nullptr, name() );
140
141 // Create the Message service
142 auto msgsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "MessageSvc", m_messageSvcType ) );
143 if ( !msgsvc ) {
144 log << MSG::FATAL << "Error creating MessageSvc of type " << m_messageSvcType << endmsg;
145 return StatusCode::FAILURE;
146 }
147 // Get the useful interface from Message services
148 m_messageSvc = m_svcLocator->service( "MessageSvc" );
149 if ( !m_messageSvc ) {
150 log << MSG::FATAL << "Error retrieving MessageSvc." << endmsg;
151 return StatusCode::FAILURE;
152 }
153
154 auto jobsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "JobOptionsSvc", m_jobOptionsSvcType ) );
155 // Create the Job Options service
156 if ( !jobsvc ) {
157 log << MSG::FATAL << "Error creating JobOptionsSvc" << endmsg;
158 return StatusCode::FAILURE;
159 }
160 // Get the useful interface from Message services
161 m_jobOptionsSvc = m_svcLocator->service( "JobOptionsSvc" );
162 if ( !m_jobOptionsSvc ) {
163 log << MSG::FATAL << "Error retrieving JobOptionsSvc." << endmsg;
164 return StatusCode::FAILURE;
165 }
166
167 auto jobOptsIProp = jobsvc.as<IProperty>();
168 if ( !jobOptsIProp ) {
169 log << MSG::FATAL << "Error locating JobOptionsSvc" << endmsg;
170 return StatusCode::FAILURE;
171 }
172 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "TYPE", m_jobOptionsType ) );
173 if ( !sc.isSuccess() ) {
174 log << MSG::FATAL << "Error setting TYPE option in JobOptionsSvc" << endmsg;
175 return sc;
176 }
177
178 if ( !m_jobOptionsPreAction.empty() ) {
179 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONPARAMS", m_jobOptionsPreAction ) );
180 if ( !sc.isSuccess() ) {
181 log << MSG::FATAL << "Error setting JobOptionsPreAction option in JobOptionsSvc" << endmsg;
182 return sc;
183 }
184 }
185
186 if ( !m_jobOptionsPostAction.empty() ) {
187 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONACTION", m_jobOptionsPostAction ) );
188 if ( !sc.isSuccess() ) {
189 log << MSG::FATAL << "Error setting JobOptionsPostAction option in JobOptionsSvc" << endmsg;
190 return sc;
191 }
192 }
193
194 if ( !m_jobOptionsPath.empty() ) { // The command line takes precedence
195 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", m_jobOptionsPath ) );
196 if ( !sc.isSuccess() ) {
197 log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc" << endmsg;
198 return sc;
199 }
200 } else if ( isEnvSet( "JOBOPTPATH" ) ) { // Otherwise the Environment JOBOPTPATH
201 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", getEnv( "JOBOPTPATH" ) ) );
202 if ( !sc.isSuccess() ) {
203 log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc from env" << endmsg;
204 return sc;
205 }
206 } else { // Otherwise the default
207 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", "../options/job.opts" ) );
208 if ( !sc.isSuccess() ) {
209 log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc to default" << endmsg;
210 return sc;
211 }
212 }
213 jobOptsIProp.reset();
214
215 // Sets my default the Output Level of the Message service to be
216 // the same as this
217 auto msgSvcIProp = msgsvc.as<IProperty>();
218 msgSvcIProp->setProperty( Gaudi::Property<int>( "OutputLevel", m_outputLevel ) ).ignore();
219 msgSvcIProp.reset();
220
221 sc = jobsvc->sysInitialize();
222 if ( !sc.isSuccess() ) {
223 log << MSG::FATAL << "Error initializing JobOptionsSvc" << endmsg;
224 return sc;
225 }
226 sc = msgsvc->sysInitialize();
227 if ( !sc.isSuccess() ) {
228 log << MSG::FATAL << "Error initializing MessageSvc" << endmsg;
229 return sc;
230 }
231
232 // Make sure output level caches are up to date.
233 outputLevelUpdate();
234
235 return sc;
236 }
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:415
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
DLLClassManager::loadModule
StatusCode loadModule(const std::string &module, bool fireIncident=true) override
Definition: DLLClassManager.cpp:30
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
ApplicationMgr::m_jobOptionsType
Gaudi::Property< std::string > m_jobOptionsType
Definition: ApplicationMgr.h:231
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::outputLevelUpdate
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
Definition: ApplicationMgr.cpp:1235
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:215
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
MSG::FATAL
Definition: IMessageSvc.h:16
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:79
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
ApplicationMgr::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: ApplicationMgr.h:241
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:191
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ISvcManager::createService
virtual SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype)=0
Creates and instance of a service type that has been declared beforehand and assigns it a name...
ApplicationMgr::m_jobOptionsPreAction
Gaudi::Property< std::string > m_jobOptionsPreAction
Definition: ApplicationMgr.h:233
System::isEnvSet
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
Definition: System.cpp:437
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:193
ApplicationMgr::m_jobOptionsSvcType
Gaudi::Property< std::string > m_jobOptionsSvcType
Definition: ApplicationMgr.h:202
ApplicationMgr::m_jobOptionsPostAction
Gaudi::Property< std::string > m_jobOptionsPostAction
Definition: ApplicationMgr.h:235
ApplicationMgr::m_messageSvcType
Gaudi::Property< std::string > m_messageSvcType
Definition: ApplicationMgr.h:201
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
ApplicationMgr::m_jobOptionsPath
Gaudi::Property< std::string > m_jobOptionsPath
Definition: ApplicationMgr.h:232
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::initialize | ( |  | ) |
| override

Definition at line 437 of file ApplicationMgr.cpp.

438 {
439 StatusCode sc;
440
441 MsgStream log( m_messageSvc, name() );
442
443 // Make sure output level caches are up to date.
444 outputLevelUpdate();
445
446 // I cannot add these services in configure() because they are coming from GaudiUtils
447 // and it messes up genconf when rebuilding it.
448 if ( m_stopOnSignal ) {
449 // Instantiate the service that schedules a stop when a signal is received
450 std::string svcname( "Gaudi::Utils::StopSignalHandler" );
451 sc = svcManager()->addService( svcname );
452 if ( sc.isFailure() ) {
453 log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
454 }
455 }
456
457 if ( m_stalledEventMonitoring ) {
458 // Instantiate the service that schedules a stop when a signal is received
459 std::string svcname( "StalledEventMonitor" );
460 sc = svcManager()->addService( svcname );
461 if ( sc.isFailure() ) {
462 log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
463 }
464 }
465
466 if ( m_state == Gaudi::StateMachine::INITIALIZED ) {
467 log << MSG::INFO << "Already Initialized!" << endmsg;
468 return StatusCode::SUCCESS;
469 }
470 if ( m_state != Gaudi::StateMachine::CONFIGURED ) {
471 log << MSG::FATAL << "initialize: Invalid state \"" << m_state << "\"" << endmsg;
472 return StatusCode::FAILURE;
473 }
474 m_targetState = Gaudi::StateMachine::INITIALIZED;
475
476 //--------------------------------------------------------------------------
477 // Initialize the list of top Services
478 //--------------------------------------------------------------------------
479 sc = svcManager()->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;
486 m_state = m_targetState;
487
488 return sc;
489 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:206
ISvcManager::addService
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
ApplicationMgr::m_stopOnSignal
Gaudi::Property< bool > m_stopOnSignal
Property to enable/disable the "stop on signal" service.
Definition: ApplicationMgr.h:264
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:16
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::outputLevelUpdate
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
Definition: ApplicationMgr.cpp:1235
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
std::string
STL class.
MSG::FATAL
Definition: IMessageSvc.h:16
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_stalledEventMonitoring
Gaudi::Property< bool > m_stalledEventMonitoring
Property to enable/disable the monitoring and reporting of stalled events.
Definition: ApplicationMgr.h:269
IStateful::initialize
virtual StatusCode initialize()=0
Initialization (from CONFIGURED to INITIALIZED).
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
MSG::INFO
Definition: IMessageSvc.h:16
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

void ApplicationMgr::initLoopCheckHndlr | ( | Gaudi::Details::PropertyBase & |  | ) |

Definition at line 1230 of file ApplicationMgr.cpp.

1231 {
1232 svcManager()->setLoopCheckEnabled( m_loopCheck );
1233 }
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
ISvcManager::setLoopCheckEnabled
virtual void setLoopCheckEnabled(bool en=true)=0
Set the value of the initialization loop check flag.
ApplicationMgr::m_loopCheck
Gaudi::Property< bool > m_loopCheck
Definition: ApplicationMgr.h:259

void ApplicationMgr::multiThreadSvcNameListHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 1029 of file ApplicationMgr.cpp.

1030 {
1031 if ( !( decodeMultiThreadSvcNameList() ).isSuccess() ) {
1032 throw GaudiException( "Failed to create copies of mt services",
1033 "MinimalEventLoopMgr::multiThreadSvcNameListHandler", StatusCode::FAILURE );
1034 }
1035 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::decodeMultiThreadSvcNameList
StatusCode decodeMultiThreadSvcNameList()
Definition: ApplicationMgr.cpp:1040

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

Definition at line 865 of file ApplicationMgr.cpp.

865 { return m_name; }
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:204

StatusCode ApplicationMgr::nextEvent | ( | int | maxevt | ) |
| override

Definition at line 528 of file ApplicationMgr.cpp.

529 {
530 if ( m_state != Gaudi::StateMachine::RUNNING ) {
531 MsgStream log( m_messageSvc, name() );
532 log << MSG::FATAL << "nextEvent: Invalid state \"" << m_state << "\"" << endmsg;
533 return StatusCode::FAILURE;
534 }
535 if ( !m_processingMgr ) {
536 MsgStream log( m_messageSvc, name() );
537 log << MSG::FATAL << "No event processing manager specified. Check option: " << m_eventLoopMgr.name() << endmsg;
538 return StatusCode::FAILURE;
539 }
540 return m_processingMgr->nextEvent( maxevt );
541 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:214
ApplicationMgr::m_eventLoopMgr
Gaudi::Property< std::string > m_eventLoopMgr
Definition: ApplicationMgr.h:238
IEventProcessor::nextEvent
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
MSG::FATAL
Definition: IMessageSvc.h:16
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
maxevt
int maxevt
Definition: Bootstrap.cpp:279
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

void ApplicationMgr::outputLevelUpdate | ( |  | ) |
| override

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

Definition at line 1235 of file ApplicationMgr.cpp.

1236 {
1237 resetMessaging();
1238 for ( auto& mgrItem : m_managers ) {
1239 mgrItem.second->outputLevelUpdate();
1240 }
1241 }
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:180
CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful, INamedInterface, IProperty > >::resetMessaging
MSG::Level resetMessaging()
Reinitialize internal states.
Definition: CommonMessaging.h:181

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

Definition at line 1219 of file ApplicationMgr.cpp.

1220 {
1221 // Setup debug level for the plugin system
1222 MsgStream log( m_messageSvc, name() );
1223 log << MSG::INFO << "Updating Gaudi::PluginService::SetDebug(level) to level=" << m_pluginDebugLevel << endmsg;
1224 Gaudi::PluginService::SetDebug( m_pluginDebugLevel );
1225 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
Gaudi::PluginService::SetDebug
GAUDIPS_API void SetDebug(int debugLevel)
Backward compatibility with Reflex.
Definition: PluginService.cpp:344
MSG::INFO
Definition: IMessageSvc.h:16
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
ApplicationMgr::m_pluginDebugLevel
Gaudi::Property< int > m_pluginDebugLevel
Definition: ApplicationMgr.h:246
Gaudi.Configuration.log
log
Definition: Configuration.py:13

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

Definition at line 93 of file ApplicationMgr.cpp.

94 {
95 if ( !ppvi ) {
96 return StatusCode::FAILURE;
97 }
98
99 // try to find own/direct interfaces:
100 StatusCode sc = base_class::queryInterface( iid, ppvi );
101 if ( sc.isSuccess() ) return sc;
102
103 // find indirect interfaces :
104 if ( ISvcLocator::interfaceID().versionMatch( iid ) ) {
105 return serviceLocator()->queryInterface( iid, ppvi );
106 }
107 if ( ISvcManager::interfaceID().versionMatch( iid ) ) {
108 return svcManager()->queryInterface( iid, ppvi );
109 }
110 if ( IAlgManager::interfaceID().versionMatch( iid ) ) {
111 return algManager()->queryInterface( iid, ppvi );
112 }
113 if ( IClassManager::interfaceID().versionMatch( iid ) ) {
114 return m_classManager->queryInterface( iid, ppvi );
115 }
116 if ( IMessageSvc::interfaceID().versionMatch( iid ) ) {
117 *ppvi = reinterpret_cast<void*>( m_messageSvc.get() );
118 if ( m_messageSvc ) m_messageSvc->addRef();
119 // Note that 0 can be a valid IMessageSvc pointer value (when used for
120 // MsgStream).
121 return StatusCode::SUCCESS;
122 }
123 *ppvi = nullptr;
124 return StatusCode::FAILURE;
125 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DLLClassManager::queryInterface
StatusCode queryInterface(const InterfaceID &iid, void **pinterface) override
implementation of IInterface::queryInterface
Definition: DLLClassManager.cpp:73
InterfaceID::versionMatch
constexpr bool versionMatch(const InterfaceID &iid) const
check compatibility.
Definition: IInterface.h:62
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:193
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Needed to locate the message service.
Definition: ApplicationMgr.h:151
queryInterface
StatusCode queryInterface(const InterfaceID &iid, void **pinterface) override
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141
IInterface::interfaceID
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:287
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
IInterface::queryInterface
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.

StatusCode ApplicationMgr::reinitialize | ( |  | ) |
| override

Definition at line 875 of file ApplicationMgr.cpp.

876 {
877 StatusCode retval = StatusCode::SUCCESS;
878 StatusCode sc;
879 if ( m_state < Gaudi::StateMachine::INITIALIZED ) {
880 throw GaudiException( "Cannot reinitialize application if not INITIALIZED or RUNNING",
881 "ApplicationMgr::reinitialize", StatusCode::FAILURE );
882 }
883 if ( m_state == Gaudi::StateMachine::RUNNING ) {
884 retval = GoToState( Gaudi::StateMachine::INITIALIZED );
885 }
886 sc = svcManager()->reinitialize();
887 if ( sc.isFailure() ) retval = sc;
888 sc = algManager()->reinitialize();
889 if ( sc.isFailure() ) retval = sc;
890 return retval;
891 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
compareRootHistos.retval
retval
Definition: compareRootHistos.py:427
IStateful::reinitialize
virtual StatusCode reinitialize()=0
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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:695
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141

StatusCode ApplicationMgr::restart | ( |  | ) |
| override

Definition at line 896 of file ApplicationMgr.cpp.

897 {
898 StatusCode retval = StatusCode::SUCCESS;
899 StatusCode sc;
900 if ( m_state != Gaudi::StateMachine::RUNNING ) {
901 throw GaudiException( "Cannot restart application if not RUNNING", "ApplicationMgr::restart", StatusCode::FAILURE );
902 }
903 sc = svcManager()->restart();
904 if ( sc.isFailure() ) retval = sc;
905 sc = algManager()->restart();
906 if ( sc.isFailure() ) retval = sc;
907 return retval;
908 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
compareRootHistos.retval
retval
Definition: compareRootHistos.py:427
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
IStateful::restart
virtual StatusCode restart()=0
Initialization (from RUNNING to RUNNING, via INITIALIZED).
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141

StatusCode ApplicationMgr::run | ( |  | ) |
| override

Definition at line 790 of file ApplicationMgr.cpp.

791 {
792 StatusCode sc = StatusCode::SUCCESS;
793
794 sc = GoToState( Gaudi::StateMachine::RUNNING );
795 if ( sc.isSuccess() ) {
796 MsgStream log( m_messageSvc, name() );
797 if ( m_runable != 0 ) { // loop over the events
798 sc = m_runable->run();
799 if ( !sc.isSuccess() ) {
800 log << MSG::FATAL << "Application execution failed. Ending the job." << endmsg;
801 }
802 } else {
803 log << MSG::FATAL << "Application has no runable object. Check option:" << m_runableType.name() << endmsg;
804 }
805 }
806 if ( sc.isSuccess() ) { // try to close cleanly
807 sc = GoToState( Gaudi::StateMachine::OFFLINE );
808 }
809 // either the runable failed of the stut-down
810 if ( sc.isFailure() ) { // try to close anyway (but keep the StatusCode unchanged)
811 GoToState( Gaudi::StateMachine::OFFLINE, true ).ignore();
812 }
813 return sc;
814 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
IRunable::run
virtual StatusCode run()=0
Run the class implementation.
ApplicationMgr::m_runable
SmartIF< IRunable > m_runable
Reference to the runable object.
Definition: ApplicationMgr.h:213
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
MSG::FATAL
Definition: IMessageSvc.h:16
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::m_runableType
Gaudi::Property< std::string > m_runableType
Definition: ApplicationMgr.h:237
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:695
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:15
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

SmartIF<ISvcLocator>& ApplicationMgr::serviceLocator | ( |  | ) | const
| inline override

Needed to locate the message service.

Definition at line 151 of file ApplicationMgr.h.

151 { return m_svcLocator; }
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:191

void ApplicationMgr::setServiceManager | ( | ISvcManager * |  | ) |
| inline override protected

Definition at line 163 of file ApplicationMgr.h.

163 {}

void ApplicationMgr::SIExitHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 930 of file ApplicationMgr.cpp.

931 {
932 StatusCode status;
933 status = finalize();
934 status = terminate();
935 ::exit( 0 );
936 }
ApplicationMgr::terminate
StatusCode terminate() override
Definition: ApplicationMgr.cpp:636
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::finalize
StatusCode finalize() override
Definition: ApplicationMgr.cpp:584

void ApplicationMgr::SIGoHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 913 of file ApplicationMgr.cpp.

914 {
915
916 MsgStream log( m_messageSvc, name() );
917 StatusCode sc;
918
919 // Re-initialize everything
920 sc = reinitialize();
921 // Execute a number of events
922 executeRun( m_evtMax );
923
924 return;
925 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::m_evtMax
Gaudi::Property< int > m_evtMax
Definition: ApplicationMgr.h:221
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::executeRun
StatusCode executeRun(int evtmax) override
implementation of IEventProcessor::executeRun(int)
Definition: ApplicationMgr.cpp:834
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::reinitialize
StatusCode reinitialize() override
Definition: ApplicationMgr.cpp:875
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::start | ( |  | ) |
| override

Definition at line 494 of file ApplicationMgr.cpp.

495 {
496
497 MsgStream log( m_messageSvc, name() );
498 StatusCode sc;
499
500 if ( m_state == Gaudi::StateMachine::RUNNING ) {
501 log << MSG::INFO << "Already Initialized!" << endmsg;
502 return StatusCode::SUCCESS;
503 }
504 if ( m_state != Gaudi::StateMachine::INITIALIZED ) {
505 log << MSG::FATAL << "start: Invalid state \"" << m_state << "\"" << endmsg;
506 return StatusCode::FAILURE;
507 }
508 m_targetState = Gaudi::StateMachine::RUNNING;
509
510 //--------------------------------------------------------------------------
511 // Initialize the list of top Services
512 //--------------------------------------------------------------------------
513 sc = svcManager()->start();
514 if ( !sc.isSuccess() ) return sc;
515
516 //--------------------------------------------------------------------------
517 // Final steps: Inform user and change internal state
518 //--------------------------------------------------------------------------
519 log << MSG::INFO << "Application Manager Started successfully" << endmsg;
520 m_state = m_targetState;
521
522 return sc;
523 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:206
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
IStateful::start
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
MSG::FATAL
Definition: IMessageSvc.h:16
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
MSG::INFO
Definition: IMessageSvc.h:16
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::stop | ( |  | ) |
| override

Definition at line 546 of file ApplicationMgr.cpp.

547 {
548
549 MsgStream log( m_messageSvc, name() );
550 StatusCode sc;
551
552 if ( m_state == Gaudi::StateMachine::INITIALIZED ) {
553 log << MSG::INFO << "Already Initialized!" << endmsg;
554 return StatusCode::SUCCESS;
555 }
556 if ( m_state != Gaudi::StateMachine::RUNNING ) {
557 log << MSG::FATAL << "stop: Invalid state \"" << m_state << "\"" << endmsg;
558 return StatusCode::FAILURE;
559 }
560 m_targetState = Gaudi::StateMachine::INITIALIZED;
561
562 // Stop independently managed Algorithms
563 sc = algManager()->stop();
564 if ( !sc.isSuccess() ) return sc;
565
566 //--------------------------------------------------------------------------
567 // Stop the list of top Services
568 //--------------------------------------------------------------------------
569 sc = svcManager()->stop();
570 if ( !sc.isSuccess() ) return sc;
571
572 //--------------------------------------------------------------------------
573 // Final steps: Inform user and change internal state
574 //--------------------------------------------------------------------------
575 log << MSG::INFO << "Application Manager Stopped successfully" << endmsg;
576 m_state = m_targetState;
577
578 return sc;
579 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:206
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:132
MSG::FATAL
Definition: IMessageSvc.h:16
IStateful::stop
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
MSG::INFO
Definition: IMessageSvc.h:16
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:141
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode ApplicationMgr::stopRun | ( |  | ) |
| override

implementation of IEventProcessor::stopRun()

Definition at line 851 of file ApplicationMgr.cpp.

852 {
853 MsgStream log( m_messageSvc, name() );
854 if ( m_state == Gaudi::StateMachine::RUNNING ) {
855 if ( m_processingMgr ) {
856 return m_processingMgr->stopRun();
857 }
858 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
859 return StatusCode::SUCCESS;
860 }
861 log << MSG::FATAL << "stopRun: Invalid state \"" << FSMState() << "\"" << endmsg;
862 return StatusCode::FAILURE;
863 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
IEventProcessor::stopRun
virtual StatusCode stopRun()=0
Schedule a stop of the current event processing.
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:214
MSG::FATAL
Definition: IMessageSvc.h:16
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
MSG::WARNING
Definition: IMessageSvc.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:868
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

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

Definition at line 132 of file ApplicationMgr.h.

133 {
134 // Cache the casted pointer to ISvcManager
135 if ( !m_svcManager ) {
136 m_svcManager = getManager<IService>();
137 }
138 return m_svcManager;
139 }
ApplicationMgr::m_svcManager
SmartIF< ISvcManager > m_svcManager
Cached pointer to the manager of services.
Definition: ApplicationMgr.h:185

StatusCode ApplicationMgr::sysFinalize | ( |  | ) |
| inline override

Definition at line 100 of file ApplicationMgr.h.

100 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:29

StatusCode ApplicationMgr::sysInitialize | ( |  | ) |
| inline override

Definition at line 94 of file ApplicationMgr.h.

94 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:29

StatusCode ApplicationMgr::sysReinitialize | ( |  | ) |
| inline override

Definition at line 102 of file ApplicationMgr.h.

102 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:29

StatusCode ApplicationMgr::sysRestart | ( |  | ) |
| inline override

Definition at line 104 of file ApplicationMgr.h.

104 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:29

StatusCode ApplicationMgr::sysStart | ( |  | ) |
| inline override

Definition at line 96 of file ApplicationMgr.h.

96 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:29

StatusCode ApplicationMgr::sysStop | ( |  | ) |
| inline override

Definition at line 98 of file ApplicationMgr.h.

98 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:29

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

Definition at line 870 of file ApplicationMgr.cpp.

870 { return m_targetState; }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:206

StatusCode ApplicationMgr::terminate | ( |  | ) |
| override

Definition at line 636 of file ApplicationMgr.cpp.

637 {
638 MsgStream log( m_messageSvc, name() );
639
640 if ( m_state == Gaudi::StateMachine::OFFLINE ) {
641 log << MSG::INFO << "Already Offline" << endmsg;
642 return StatusCode::SUCCESS;
643 }
644 if ( m_state != Gaudi::StateMachine::CONFIGURED ) {
645 log << MSG::FATAL << "terminate: Invalid state \"" << m_state << "\"" << endmsg;
646 return StatusCode::FAILURE;
647 }
648 // release all Services
649 m_targetState = Gaudi::StateMachine::OFFLINE;
650
651 if ( m_returnCode.value() == Gaudi::ReturnCode::Success ) {
652 log << MSG::INFO << "Application Manager Terminated successfully" << endmsg;
653 } else if ( m_returnCode.value() == Gaudi::ReturnCode::ScheduledStop ) {
654 log << MSG::INFO << "Application Manager Terminated successfully with a user requested ScheduledStop" << endmsg;
655 } else {
656 log << MSG::ERROR << "Application Manager Terminated with error code " << m_returnCode.value() << endmsg;
657 }
658
659 { // Force a disable the auditing of finalize for MessageSvc
660 auto prop = m_messageSvc.as<IProperty>();
661 if ( prop ) {
662 prop->setProperty( Gaudi::Property<bool>( "AuditFinalize", false ) ).ignore();
663 }
664 }
665 { // Force a disable the auditing of finalize for JobOptionsSvc
666 auto prop = m_jobOptionsSvc.as<IProperty>();
667 if ( prop ) {
668 prop->setProperty( Gaudi::Property<bool>( "AuditFinalize", false ) ).ignore();
669 }
670 }
671
672 // finalize MessageSvc
673 auto svc = m_messageSvc.as<IService>();
674 if ( !svc ) {
675 log << MSG::ERROR << "Could not get the IService interface of the MessageSvc" << endmsg;
676 } else {
677 svc->sysFinalize().ignore();
678 }
679
680 // finalize JobOptionsSvc
681 svc = m_jobOptionsSvc.as<IService>();
682 if ( !svc ) {
683 log << MSG::ERROR << "Could not get the IService interface of the JobOptionsSvc" << endmsg;
684 } else {
685 svc->sysFinalize().ignore();
686 }
687
688 m_state = m_targetState;
689 return StatusCode::SUCCESS;
690 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:206
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:276
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:16
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:865
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:215
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:27
MSG::FATAL
Definition: IMessageSvc.h:16
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:115
IService
General service interface definition.
Definition: IService.h:18
MSG::ERROR
Definition: IMessageSvc.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:205
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:18
MSG::INFO
Definition: IMessageSvc.h:16
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:15
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:212
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## Member Data Documentation

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

Definition at line 244 of file ApplicationMgr.h.

SmartIF<IAlgManager> ApplicationMgr::m_algManager
| protected

Cached pointer to the manager of algorithms.

Definition at line 188 of file ApplicationMgr.h.

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

Definition at line 242 of file ApplicationMgr.h.

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

Definition at line 243 of file ApplicationMgr.h.

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

Definition at line 254 of file ApplicationMgr.h.

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

Definition at line 253 of file ApplicationMgr.h.

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

Defaults for auditors.

Definition at line 252 of file ApplicationMgr.h.

SmartIF<DLLClassManager> ApplicationMgr::m_classManager
| protected

Reference to the class manager.

Definition at line 193 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_codeCheck {this, "StatusCodeCheck", false, "Activate StatusCode checking"}
| protected

Definition at line 245 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_createSvcNameList
| protected

Initial value:
{
this, "CreateSvc", {}, "List of extra services to be created"}

Definition at line 248 of file ApplicationMgr.h.

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

Property to declare the list of known managers.

Definition at line 182 of file ApplicationMgr.h.

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

Definition at line 230 of file ApplicationMgr.h.

Gaudi::Property<std::map<std::string, std::string> > ApplicationMgr::m_environment
| protected

Initial value:
{
this, "Environment", {}, "Environment variables to set"}

Definition at line 256 of file ApplicationMgr.h.

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

Definition at line 238 of file ApplicationMgr.h.

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

Definition at line 221 of file ApplicationMgr.h.

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

Definition at line 239 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_extSvcCreates
| protected

Initial value:
{this, "ExtSvcCreates", true,
"LHCb (default) or ATLAS definition of \"ExtSvc\""}

Definition at line 223 of file ApplicationMgr.h.

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

Definition at line 222 of file ApplicationMgr.h.

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

Definition at line 240 of file ApplicationMgr.h.

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

Definition at line 232 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPostAction
| protected

Initial value:
{
this, "JobOptionsPreAction", {}, "additional command to run on config"}

Definition at line 235 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPreAction
| protected

Initial value:
{
this, "JobOptionsPostAction", {}, "additional command to run on config"}

Definition at line 233 of file ApplicationMgr.h.

SmartIF<IJobOptionsSvc> ApplicationMgr::m_jobOptionsSvc
| protected

Reference to JobOption service.

Definition at line 215 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsSvcType {this, "JobOptionsSvcType", "JobOptionsSvc", "JobOptionsSvc type"}
| protected

Definition at line 202 of file ApplicationMgr.h.

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

Definition at line 231 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_loopCheck
| protected

Initial value:
{this, "InitializationLoopCheck", true,
"For ServiceMgr initialization loop checking"}

Definition at line 259 of file ApplicationMgr.h.

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

SmartIF<IMessageSvc> ApplicationMgr::m_messageSvc
| protected

Reference to the message service.

Definition at line 212 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_messageSvcType {this, "MessageSvcType", "MessageSvc", "MessageSvc type"}
| protected

Definition at line 201 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_multiThreadSvcNameList {this, "MultiThreadExtSvc"}
| protected

List of external services names for which we want a copy per evt thread.

Definition at line 227 of file ApplicationMgr.h.

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

Name.

Definition at line 204 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_noOfEvtThreads {this, "NoOfThreads", 0, "MultiThreadSvc copies"}
| protected

Definition at line 228 of file ApplicationMgr.h.

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

names of successfully loaded dlls

Definition at line 283 of file ApplicationMgr.h.

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

Definition at line 241 of file ApplicationMgr.h.

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

Definition at line 198 of file ApplicationMgr.h.

Gaudi::Property<std::string> ApplicationMgr::m_outStreamType
| protected

Initial value:
{this, "OutStreamType", "OutputStream",
"[[deprecated]] Output stream type"}

Definition at line 199 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_pluginDebugLevel {this, "PluginDebugLevel", 0, "Debug level for the plugin system"}
| protected

Definition at line 246 of file ApplicationMgr.h.

SmartIF<IEventProcessor> ApplicationMgr::m_processingMgr
| protected

Reference to processing manager object.

Definition at line 214 of file ApplicationMgr.h.

Gaudi::Property<bool> ApplicationMgr::m_propertiesPrint
| protected

Initial value:
{this, "PropertiesPrint", false,
"Flag to activate the printout of properties"}

Definition at line 272 of file ApplicationMgr.h.

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

SmartIF<IRunable> ApplicationMgr::m_runable
| protected

Reference to the runable object.

Definition at line 213 of file ApplicationMgr.h.

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

Definition at line 237 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_SIExit {this, "Exit", 0, "For SI's \"Exit\" command via callback"}
| protected

Definition at line 196 of file ApplicationMgr.h.

Gaudi::Property<int> ApplicationMgr::m_SIGo {this, "Go", 0, "For SI's \"Go\" command via callback"}
| protected

Definition at line 195 of file ApplicationMgr.h.

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

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

Internal State.

Definition at line 205 of file ApplicationMgr.h.

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

SmartIF<ISvcLocator> ApplicationMgr::m_svcLocator
| mutable protected

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

Definition at line 191 of file ApplicationMgr.h.

SmartIF<ISvcManager> ApplicationMgr::m_svcManager
| protected

Cached pointer to the manager of services.

Definition at line 185 of file ApplicationMgr.h.

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

Definition at line 208 of file ApplicationMgr.h.

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_svcOptMapping
| protected

Initial value:
{
this, "SvcOptMapping", {}, "Default mapping of optional services"}

Definition at line 209 of file ApplicationMgr.h.

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

Internal State.

Definition at line 206 of file ApplicationMgr.h.

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

Definition at line 197 of file ApplicationMgr.h.

bool ApplicationMgr::m_useHiveAlgorithmManager
| protected

Definition at line 280 of file ApplicationMgr.h.

The documentation for this class was generated from the following files:

- GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h
- GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp