| The Gaudi Framework v27r1

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

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

Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Types | 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 Types
typedef std::list< std::pair< IService *, int > > | ListSvc
typedef std::vector< std::string > | VectorName
Public Types inherited from CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful > >
using | base_class = CommonMessaging

## 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 (Property &theProp)
void | SIExitHandler (Property &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...
Property handlers
void | evtLoopPropertyHandler (Property &theProp)
StatusCode | decodeExtSvcNameList ()
StatusCode | decodeCreateSvcNameList ()
void | createSvcNameListHandler (Property &)
void | extSvcNameListHandler (Property &theProp)
StatusCode | decodeMultiThreadSvcNameList ()
void | multiThreadSvcNameListHandler (Property &theProp)
StatusCode | decodeDllNameList ()
void | dllNameListHandler (Property &theProp)
void | pluginDebugPropertyHandler (Property &theProp)
void | initLoopCheckHndlr (Property &)
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
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 output level 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 CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
ManagersMap | m_managers
| Map of known component managers. More...
StringArrayProperty | 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...
SmartIF< PropertyMgr > | m_propertyMgr
| Reference to Property Manager. More...
IntegerProperty | m_SIGo
| For SI's "Go" command via callback. More...
IntegerProperty | m_SIExit
| For SI's "Exit" command via callback. More...
StringArrayProperty | m_topAlgNameList
| List of top level algorithms names. More...
StringArrayProperty | m_outStreamNameList
| List of output stream names. More...
StringProperty | m_outStreamType
| Output stream type (obsolete?) More...
StringProperty | m_messageSvcType
| MessageSvc type. More...
StringProperty | m_jobOptionsSvcType
| JobOptionsSvc type. More...
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...
VectorName | m_defServices
| Vector default services names. More...
VectorName | m_svcMapping
| Default mapping of services. More...
VectorName | m_svcOptMapping
| Default mapping of services. More...
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...
int | m_evtMax
| Number of events to be processed. More...
StringArrayProperty | m_extSvcNameList
| List of external services names. More...
BooleanProperty | m_extSvcCreates
| LHCb or ATLAS defn of "ExtSvc". More...
StringArrayProperty | m_multiThreadSvcNameList
| List of external services names for which we want a copy per evt thread. More...
int | m_noOfEvtThreads
| no of multiThreadSvc copies More...
StringArrayProperty | m_dllNameList
| List of DDL's names. More...
std::string | m_jobOptionsType
| Source type (e.g. dbase, file...) More...
std::string | m_jobOptionsPath
| The "file" to look for properties. More...
std::string | m_jobOptionsPreAction
| additional command to run on config More...
std::string | m_jobOptionsPostAction
| additional command to run on config More...
std::string | m_runableType
| Runable type. More...
std::string | m_eventLoopMgr
| Processing manager type. More...
std::string | m_evtsel
| Event selection. More...
std::string | m_histPersName
| CGL: Name of the Hist Pers Svc. More...
int | m_outputLevel
| Message output level. More...
std::string | m_appName
| The name of the application. More...
std::string | m_appVersion
| The version of the application. More...
bool | m_actHistory
| Activate HistorySvc. More...
bool | m_codeCheck
| Activate StatusCode checking. More...
IntegerProperty | m_pluginDebugLevel
| Debug level for the plugin system. More...
StringArrayProperty | m_createSvcNameList
BooleanProperty | m_auditTools
| Defaults for auditors. More...
BooleanProperty | m_auditSvcs
BooleanProperty | m_auditAlgs
std::map< std::string, std::string > | m_environment
| Environment variables to set. More...
BooleanProperty | m_loopCheck
| For ServiceMgr initialization loop checking. More...
BooleanProperty | m_stopOnSignal
| Property to enable/disable the "stop on signal" service (enabled by default). More...
BooleanProperty | m_stalledEventMonitoring
| Property to enable/disable the monitoring and reporting of stalled events (enabled by default). More...
bool | m_propertiesPrint
| flag to activate the printout of properties More...
IntegerProperty | m_returnCode
| Property to record the error conditions occurring during the running. More...
bool | m_useHiveAlgorithmManager

## Private Types
typedef CommonMessaging< implements< IAppMgrUI, IEventProcessor, IService, IStateful > > | base_class

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

## Detailed Description

The Application Manager class.

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

Author
  Pere Mato

Definition at line 46 of file ApplicationMgr.h.

## Member Typedef Documentation

typedef CommonMessaging<implements<IAppMgrUI, IEventProcessor, IService, IStateful> > ApplicationMgr::base_class
| private

Definition at line 53 of file ApplicationMgr.h.

typedef std::list<std::pair<IService*,int> > ApplicationMgr::ListSvc

Definition at line 55 of file ApplicationMgr.h.

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

typedef std::vector<std::string> ApplicationMgr::VectorName

Definition at line 56 of file ApplicationMgr.h.

## Constructor & Destructor Documentation

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

Definition at line 53 of file ApplicationMgr.cpp.

54 {
55 // IInterface initialization
56 addRef(); // Initial count set to 1
57
58 // Instantiate component managers
59 m_managers[IService::interfaceID().id()] = new ServiceManager(this);
60
61 m_propertyMgr = new PropertyMgr(this);
62 m_svcLocator = svcManager();
63
64 // Instantiate internal services
65 // SvcLocator/Factory HAS to be already instantiated
66 m_classManager = new DLLClassManager(this);
67
68 AlgorithmManager *algMgr = new AlgorithmManager(this);
69 m_managers[IAlgorithm::interfaceID().id()] = algMgr;
70 // m_managers[IAlgorithm::interfaceID().id()] = new HiveAlgorithmManager(this);
71
72 m_propertyMgr->declareProperty("Go", m_SIGo = 0 );
73 m_propertyMgr->declareProperty("Exit", m_SIExit = 0 );
74 m_propertyMgr->declareProperty("Dlls", m_dllNameList );
75 m_propertyMgr->declareProperty("ExtSvc", m_extSvcNameList );
76 m_propertyMgr->declareProperty("CreateSvc", m_createSvcNameList );
77 m_propertyMgr->declareProperty("ExtSvcCreates", m_extSvcCreates=true );
78
79 m_propertyMgr->declareProperty("SvcMapping", m_svcMapping );
80 m_propertyMgr->declareProperty("SvcOptMapping", m_svcOptMapping );
81
82 m_propertyMgr->declareProperty("TopAlg", m_topAlgNameList );
83 m_propertyMgr->declareProperty("OutStream", m_outStreamNameList );
84 m_propertyMgr->declareProperty("OutStreamType", m_outStreamType = "OutputStream" );
85 m_propertyMgr->declareProperty("MessageSvcType",m_messageSvcType= "MessageSvc" );
86 m_propertyMgr->declareProperty("JobOptionsSvcType",
87 m_jobOptionsSvcType = "JobOptionsSvc" );
88 m_propertyMgr->declareProperty( s_runable, m_runableType = "AppMgrRunable");
89 m_propertyMgr->declareProperty( s_eventloop, m_eventLoopMgr = "EventLoopMgr");
90
91 m_propertyMgr->declareProperty("HistogramPersistency", m_histPersName="NONE");
92
93 // Declare Job Options Service properties and set default
94 m_propertyMgr->declareProperty("JobOptionsType", m_jobOptionsType = "FILE");
95 m_propertyMgr->declareProperty("JobOptionsPath", m_jobOptionsPath = "");
96 m_propertyMgr->declareProperty("JobOptionsPostAction", m_jobOptionsPostAction = "");
97 m_propertyMgr->declareProperty("JobOptionsPreAction", m_jobOptionsPreAction = "");
98 m_propertyMgr->declareProperty("EvtMax", m_evtMax = -1);
99 m_propertyMgr->declareProperty("EvtSel", m_evtsel );
100 m_propertyMgr->declareProperty("OutputLevel", m_outputLevel = MSG::INFO);
101
102 m_propertyMgr->declareProperty("MultiThreadExtSvc", m_multiThreadSvcNameList);
103 m_propertyMgr->declareProperty("NoOfThreads", m_noOfEvtThreads = 0);
104 m_propertyMgr->declareProperty("AppName", m_appName = "ApplicationMgr");
105 m_propertyMgr->declareProperty("AppVersion", m_appVersion = "");
106
107 m_propertyMgr->declareProperty("AuditTools", m_auditTools = false);
108 m_propertyMgr->declareProperty("AuditServices", m_auditSvcs = false);
109 m_propertyMgr->declareProperty("AuditAlgorithms", m_auditAlgs = false);
110
111 m_propertyMgr->declareProperty("ActivateHistory", m_actHistory = false);
112 m_propertyMgr->declareProperty("StatusCodeCheck", m_codeCheck = false);
113
114 m_propertyMgr->declareProperty("Environment", m_environment);
115
116 // ServiceMgr Initialization loop checking
117 m_propertyMgr->declareProperty("InitializationLoopCheck", m_loopCheck = true)
118 ->declareUpdateHandler(&ApplicationMgr::initLoopCheckHndlr, this);
119 svcManager()->setLoopCheckEnabled(m_loopCheck);
120
121 // Flag to activate the printout of properties
122 m_propertyMgr->declareProperty
123 ( "PropertiesPrint",
124 m_propertiesPrint = false,
125 "Flag to activate the printout of properties" );
126
127 m_propertyMgr->declareProperty("PluginDebugLevel", m_pluginDebugLevel = 0 );
128
129 m_propertyMgr->declareProperty("StopOnSignal", m_stopOnSignal = false,
130 "Flag to enable/disable the signal handler that schedule a stop of the event loop");
131
132 m_propertyMgr->declareProperty("StalledEventMonitoring", m_stalledEventMonitoring = false,
133 "Flag to enable/disable the monitoring and reporting of stalled events");
134
135 m_propertyMgr->declareProperty("ReturnCode", m_returnCode = Gaudi::ReturnCode::Success,
136 "Return code of the application. Set internally in case of error conditions.");
137
138 m_propertyMgr->declareProperty("AlgTypeAliases", algMgr->typeAliases(),
139 "Aliases of algorithm types, to replace an algorithm type for every instance");
140
141 // Add action handlers to the appropriate properties
142 m_SIGo.declareUpdateHandler ( &ApplicationMgr::SIGoHandler , this );
143 m_SIExit.declareUpdateHandler( &ApplicationMgr::SIExitHandler , this );
144 m_topAlgNameList.declareUpdateHandler(&ApplicationMgr::evtLoopPropertyHandler, this);
145 m_outStreamNameList.declareUpdateHandler(&ApplicationMgr::evtLoopPropertyHandler, this);
146 m_outStreamType.declareUpdateHandler(&ApplicationMgr::evtLoopPropertyHandler, this);
147 m_pluginDebugLevel.declareUpdateHandler(&ApplicationMgr::pluginDebugPropertyHandler, this);
148
149 m_svcMapping.insert( std::end(m_svcMapping),
150 { "EvtDataSvc/EventDataSvc",
151 "DetDataSvc/DetectorDataSvc",
152 "HistogramSvc/HistogramDataSvc",
153 "HbookCnv::PersSvc/HbookHistSvc",
154 "RootHistCnv::PersSvc/RootHistSvc",
155 "EvtPersistencySvc/EventPersistencySvc",
156 "DetPersistencySvc/DetectorPersistencySvc",
157 "HistogramPersistencySvc/HistogramPersistencySvc" } );
158 }
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::m_jobOptionsType
std::string m_jobOptionsType
Source type (e.g. dbase, file...)
Definition: ApplicationMgr.h:236
ApplicationMgr::m_createSvcNameList
StringArrayProperty m_createSvcNameList
Definition: ApplicationMgr.h:251
ApplicationMgr::m_outStreamNameList
StringArrayProperty m_outStreamNameList
List of output stream names.
Definition: ApplicationMgr.h:205
ApplicationMgr::m_messageSvcType
StringProperty m_messageSvcType
MessageSvc type.
Definition: ApplicationMgr.h:207
Property::declareUpdateHandler
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
ApplicationMgr::m_noOfEvtThreads
int m_noOfEvtThreads
no of multiThreadSvc copies
Definition: ApplicationMgr.h:233
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:186
ApplicationMgr::m_histPersName
std::string m_histPersName
CGL: Name of the Hist Pers Svc.
Definition: ApplicationMgr.h:243
ApplicationMgr::m_codeCheck
bool m_codeCheck
Activate StatusCode checking.
Definition: ApplicationMgr.h:248
ApplicationMgr::m_jobOptionsPreAction
std::string m_jobOptionsPreAction
additional command to run on config
Definition: ApplicationMgr.h:238
ApplicationMgr::m_outStreamType
StringProperty m_outStreamType
Output stream type (obsolete?)
Definition: ApplicationMgr.h:206
ApplicationMgr::m_appName
std::string m_appName
The name of the application.
Definition: ApplicationMgr.h:245
ApplicationMgr::m_pluginDebugLevel
IntegerProperty m_pluginDebugLevel
Debug level for the plugin system.
Definition: ApplicationMgr.h:249
std::end
T end(T...args)
ApplicationMgr::m_environment
std::map< std::string, std::string > m_environment
Environment variables to set.
Definition: ApplicationMgr.h:258
ApplicationMgr::m_dllNameList
StringArrayProperty m_dllNameList
List of DDL's names.
Definition: ApplicationMgr.h:235
AlgorithmManager::typeAliases
AlgTypeAliasesMap & typeAliases()
Definition: AlgorithmManager.h:91
PropertyMgr
Property manager helper class.
Definition: PropertyMgr.h:37
ApplicationMgr::m_jobOptionsPostAction
std::string m_jobOptionsPostAction
additional command to run on config
Definition: ApplicationMgr.h:239
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
ApplicationMgr::m_outputLevel
int m_outputLevel
Message output level.
Definition: ApplicationMgr.h:244
ApplicationMgr::m_evtMax
int m_evtMax
Number of events to be processed.
Definition: ApplicationMgr.h:227
ApplicationMgr::m_returnCode
IntegerProperty m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:275
ApplicationMgr::m_jobOptionsPath
std::string m_jobOptionsPath
The "file" to look for properties.
Definition: ApplicationMgr.h:237
PropertyMgr::declareProperty
Property * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
Definition: PropertyMgr.h:186
ApplicationMgr::m_extSvcCreates
BooleanProperty m_extSvcCreates
LHCb or ATLAS defn of "ExtSvc".
Definition: ApplicationMgr.h:229
ApplicationMgr::m_svcMapping
VectorName m_svcMapping
Default mapping of services.
Definition: ApplicationMgr.h:215
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:198
ApplicationMgr::m_actHistory
bool m_actHistory
Activate HistorySvc.
Definition: ApplicationMgr.h:247
ApplicationMgr::m_loopCheck
BooleanProperty m_loopCheck
For ServiceMgr initialization loop checking.
Definition: ApplicationMgr.h:261
DLLClassManager
Definition: DLLClassManager.h:26
ApplicationMgr::m_topAlgNameList
StringArrayProperty m_topAlgNameList
List of top level algorithms names.
Definition: ApplicationMgr.h:204
ApplicationMgr::m_evtsel
std::string m_evtsel
Event selection.
Definition: ApplicationMgr.h:242
ApplicationMgr::m_multiThreadSvcNameList
StringArrayProperty m_multiThreadSvcNameList
List of external services names for which we want a copy per evt thread.
Definition: ApplicationMgr.h:232
ApplicationMgr::m_svcOptMapping
VectorName m_svcOptMapping
Default mapping of services.
Definition: ApplicationMgr.h:216
std::vector::insert
T insert(T...args)
ApplicationMgr::m_runableType
std::string m_runableType
Runable type.
Definition: ApplicationMgr.h:240
ApplicationMgr::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Reference to Property Manager.
Definition: ApplicationMgr.h:200
ApplicationMgr::initLoopCheckHndlr
void initLoopCheckHndlr(Property &)
Definition: ApplicationMgr.cpp:1304
ApplicationMgr::m_propertiesPrint
bool m_propertiesPrint
flag to activate the printout of properties
Definition: ApplicationMgr.h:272
ApplicationMgr::SIGoHandler
void SIGoHandler(Property &theProp)
Definition: ApplicationMgr.cpp:983
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:199
ApplicationMgr::m_extSvcNameList
StringArrayProperty m_extSvcNameList
List of external services names.
Definition: ApplicationMgr.h:228
ApplicationMgr::m_jobOptionsSvcType
StringProperty m_jobOptionsSvcType
JobOptionsSvc type.
Definition: ApplicationMgr.h:208
ApplicationMgr::evtLoopPropertyHandler
void evtLoopPropertyHandler(Property &theProp)
Definition: ApplicationMgr.cpp:1009
ApplicationMgr::m_stalledEventMonitoring
BooleanProperty m_stalledEventMonitoring
Property to enable/disable the monitoring and reporting of stalled events (enabled by default)...
Definition: ApplicationMgr.h:269
ApplicationMgr::m_eventLoopMgr
std::string m_eventLoopMgr
Processing manager type.
Definition: ApplicationMgr.h:241
ApplicationMgr::SIExitHandler
void SIExitHandler(Property &theProp)
Definition: ApplicationMgr.cpp:999
ApplicationMgr::m_SIGo
IntegerProperty m_SIGo
For SI's "Go" command via callback.
Definition: ApplicationMgr.h:202
ApplicationMgr::m_auditTools
BooleanProperty m_auditTools
Defaults for auditors.
Definition: ApplicationMgr.h:254
ApplicationMgr::m_auditAlgs
BooleanProperty m_auditAlgs
Definition: ApplicationMgr.h:256
ISvcManager::setLoopCheckEnabled
virtual void setLoopCheckEnabled(bool en=true)=0
Set the value of the initialization loop check flag.
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:16
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::pluginDebugPropertyHandler
void pluginDebugPropertyHandler(Property &theProp)
Definition: ApplicationMgr.cpp:1290
ApplicationMgr::m_stopOnSignal
BooleanProperty m_stopOnSignal
Property to enable/disable the "stop on signal" service (enabled by default).
Definition: ApplicationMgr.h:265
ApplicationMgr::m_appVersion
std::string m_appVersion
The version of the application.
Definition: ApplicationMgr.h:246
ApplicationMgr::m_auditSvcs
BooleanProperty m_auditSvcs
Definition: ApplicationMgr.h:255
ApplicationMgr::m_SIExit
IntegerProperty m_SIExit
For SI's "Exit" command via callback.
Definition: ApplicationMgr.h:203

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

1169 {
1170 using Gaudi::Utils::TypeNameString;
1171 StatusCode result = StatusCode::SUCCESS;
1172 MsgStream log( m_messageSvc, m_name );
1173 if (0 == m_noOfEvtThreads) {
1174 result = svcManager()->addService(typeName, prio);
1175 // result = svcManager()->addService(name, type, prio); // CHECKME???
1176 if( result.isFailure() ) {
1177 log << MSG::ERROR << "addMultiSvc: Cannot add service "
1178 << typeName.type() << "/" << typeName.name() << endmsg;
1179 } else {
1180 ON_VERBOSE
1181 log << MSG::VERBOSE << "addMultiSvc: added service "
1182 << typeName.type() << "/" << typeName.name() << endmsg;
1183 }
1184 } else {
1185 for(int iCopy=0; iCopy<m_noOfEvtThreads; ++iCopy) {
1186 const std::string &type = typeName.type();
1187 std::string thrName(typeName.name() + getGaudiThreadIDfromID(iCopy));
1188 result = svcManager()->addService(TypeNameString(thrName, type), prio);
1189 if( result.isFailure() ) {
1190 log << MSG::ERROR << "addMultiSvc: Cannot add service "
1191 << type << "/" << thrName << endmsg;
1192 } else {
1193 ON_VERBOSE
1194 log << MSG::VERBOSE << "addMultiSvc: added service "
1195 << type << "/" << thrName << endmsg;
1196 }
1197 }
1198 }
1199 return result;
1200 }
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.
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
ApplicationMgr::m_noOfEvtThreads
int m_noOfEvtThreads
no of multiThreadSvc copies
Definition: ApplicationMgr.h:233
MSG::VERBOSE
Definition: IMessageSvc.h:17
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
std::string
STL class.
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
gaudirun.type
string type
Definition: gaudirun.py:151
StatusCode::SUCCESS
Definition: StatusCode.h:30
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
Gaudi::Utils::TypeNameString::type
const std::string & type() const
Definition: TypeNameString.h:22
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:210
MSG::ERROR
Definition: IMessageSvc.h:21
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:41
Gaudi::Utils::TypeNameString::name
const std::string & name() const
Definition: TypeNameString.h:23
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Definition at line 147 of file ApplicationMgr.h.

147 {
148 // Cache the casted pointer to IAlgManager
149 if (!m_algManager) {
150 m_algManager = getManager<IAlgorithm>();
151 }
152 return m_algManager;
153 }
ApplicationMgr::m_algManager
SmartIF< IAlgManager > m_algManager
Cached pointer to the manager of algorithms.
Definition: ApplicationMgr.h:194

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

Definition at line 311 of file ApplicationMgr.cpp.

311 {
312
313 // Check if the state is compatible with the transition
314 MsgStream tlog( m_messageSvc, name() );
315 if( Gaudi::StateMachine::CONFIGURED == m_state ) {
316 tlog << MSG::INFO << "Already Configured" << endmsg;
317 return StatusCode::SUCCESS;
318 }
319 if( Gaudi::StateMachine::OFFLINE != m_state ) {
320 tlog << MSG::FATAL
321 << "configure: Invalid state \"" << m_state << "\"" << endmsg;
322 return StatusCode::FAILURE;
323 }
324 m_targetState = Gaudi::StateMachine::CONFIGURED;
325
326 // Reset application return code.
327 m_returnCode = Gaudi::ReturnCode::Success;
328
329 StatusCode sc;
330 sc = i_startup();
331 if ( !sc.isSuccess() ) {
332 return sc;
333 }
334
335 MsgStream log( m_messageSvc, name() );
336
337 // Get my own options using the Job options service
338 if (log.level() <= MSG::DEBUG)
339 log << MSG::DEBUG << "Getting my own properties" << endmsg;
340 sc = m_jobOptionsSvc->setMyProperties( name(), m_propertyMgr );
341 if( !sc.isSuccess() ) {
342 log << MSG::WARNING << "Problems getting my properties from JobOptionsSvc"
343 << endmsg;
344 return sc;
345 }
346
347 // Check current outputLevel to eventually inform the MessageSvc
348 if( m_outputLevel != MSG::NIL && !m_appName.empty() ) {
349 assert(m_messageSvc);
350 m_messageSvc->setOutputLevel( name(), m_outputLevel );
351 // Print a welcome message
352 log << MSG::ALWAYS
353 << std::endl
354 << "=================================================================="
355 << "=================================================================="
356 << std::endl
357 << " "
358 << " Welcome to " << m_appName;
359
360 if( "" != m_appVersion ) {
361 log << MSG::ALWAYS << " version " << m_appVersion;
362 }
363 else {
364 log << MSG::ALWAYS
365 << " (GaudiCoreSvc "
366 << "v" << GAUDICORESVC_MAJOR_VERSION
367 << "r" << GAUDICORESVC_MINOR_VERSION
368 #if GAUDICORESVC_PATCH_VERSION
369 << "p" << GAUDICORESVC_PATCH_VERSION
370 #endif
371 << ")";
372 }
373
374 // Add the host name and current time to the message
375 log << MSG::ALWAYS
376 << std::endl
377 << " "
378 << " running on " << System::hostName()
379 << " on " << Gaudi::Time::current().format(true) << std::endl
380 << "=================================================================="
381 << "=================================================================="
382 << endmsg;
383 }
384
385 // print all own properties if the options "PropertiesPrint" is set to true
386 if ( m_propertiesPrint )
387 {
388 const auto& properties = m_propertyMgr->getProperties() ;
389 log << MSG::ALWAYS
390 << "List of ALL properties of "
391 << System::typeinfoName ( typeid( *this ) ) << "/" << this->name()
392 << " #properties = " << properties.size() << endmsg ;
393 for ( const auto& property : properties )
394 { log << "Property ['Name': Value] = " << *property << endmsg ; }
395 }
396
397 // Check if StatusCode need to be checked
398 if (m_codeCheck) {
399 StatusCode::enableChecking();
400 sc = addMultiSvc("StatusCodeSvc", -9999);
401 if ( sc.isFailure() ) {
402 log << MSG::FATAL << "Error adding StatusCodeSvc for multiple threads" << endmsg;
403 return StatusCode::FAILURE;
404 }
405 } else {
406 StatusCode::disableChecking();
407 }
408
409 // set the requested environment variables
410 for ( auto& var : m_environment ) {
411 const std::string &name = var.first;
412 const std::string &value = var.second;
413 std::string old = System::getEnv(name.c_str());
414 const MSG::Level lvl = (!old.empty() && (old != "UNKNOWN" ))
415 ? MSG::WARNING
416 : MSG::DEBUG;
417 if (UNLIKELY(m_outputLevel <= lvl))
418 log << lvl << "Setting " << name << " = " << value << endmsg;
419 System::setEnv(name,value);
420 }
421
422 //Declare Service Types
423 for(auto& j : m_svcMapping) {
424 Gaudi::Utils::TypeNameString itm(j);
425 if ( declareMultiSvcType(itm.name(), itm.type()).isFailure() ) {
426 log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
427 return StatusCode::FAILURE;
428 }
429 }
430 for(auto& j : m_svcOptMapping) {
431 Gaudi::Utils::TypeNameString itm(j);
432 if ( declareMultiSvcType(itm.name(), itm.type()).isFailure() ) {
433 log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
434 return StatusCode::FAILURE;
435 }
436 }
437
438 //--------------------------------------------------------------------------
439 // Declare other Services and Algorithms by loading DLL's
440 sc = decodeDllNameList( );
441 if ( sc.isFailure( ) ) {
442 log << MSG::ERROR << "Failure loading declared DLL's" << endmsg;
443 return sc;
444 }
445
446 //--------------------------------------------------------------------------
447 // Deal with the services explicitly declared by the user.
448 sc = decodeExtSvcNameList();
449 if ( sc.isFailure( ) ) {
450 log << MSG::ERROR << "Failure during external service association" << endmsg;
451 return sc;
452 }
453
454 sc = decodeMultiThreadSvcNameList( );
455 if ( sc.isFailure( ) ) {
456 log << MSG::ERROR << "Failure during multi thread service creation"
457 << endmsg;
458 return sc;
459 }
460
461 sc = decodeCreateSvcNameList();
462 if ( sc.isFailure( ) ) {
463 log << MSG::ERROR << "Failure during external service creation" << endmsg;
464 return sc;
465 }
466
467
468 //--------------------------------------------------------------------------
469 // Retrieve intrinsic services. If needed configure them.
470 //--------------------------------------------------------------------------
471 Gaudi::Utils::TypeNameString evtloop_item(m_eventLoopMgr);
472 sc = addMultiSvc(evtloop_item, ServiceManager::DEFAULT_SVC_PRIORITY*10);
473 if( !sc.isSuccess() ) {
474 log << MSG::FATAL << "Error adding :" << m_eventLoopMgr << endmsg;
475 return sc;
476 }
477
478 if (m_noOfEvtThreads == 0) {
479 m_runable = m_svcLocator->service(m_runableType);
480 if( !m_runable ) {
481 log << MSG::FATAL
482 << "Error retrieving Runable:" << m_runableType
483 << "\n Check option ApplicationMgr." << s_runable << endmsg;
484 return sc;
485 }
486 m_processingMgr = m_svcLocator->service(evtloop_item);
487 if( !m_processingMgr ) {
488 log << MSG::FATAL
489 << "Error retrieving Processing manager:" << m_eventLoopMgr
490 << "\n Check option ApplicationMgr." << s_eventloop
491 << "\n No events will be processed." << endmsg;
492 return sc;
493 }
494 }
495
496 // Establish Update Handlers for ExtSvc and DLLs Properties
497 m_extSvcNameList.declareUpdateHandler (&ApplicationMgr::extSvcNameListHandler,
498 this);
499 m_createSvcNameList.declareUpdateHandler (&ApplicationMgr::createSvcNameListHandler,
500 this);
501 m_multiThreadSvcNameList.declareUpdateHandler
502 (&ApplicationMgr::multiThreadSvcNameListHandler, this);
503 m_dllNameList.declareUpdateHandler (&ApplicationMgr::dllNameListHandler,
504 this );
505
506 if (m_actHistory) {
507 // Create HistorySvc with a priority to ensure it's initialized last, finalized first
508 sc = svcManager()->addService("HistorySvc",std::numeric_limits<int>::max());
509 if ( sc.isFailure() ) {
510 log << MSG::FATAL << "Error adding HistorySvc" << endmsg;
511 return StatusCode::FAILURE;
512 }
513
514 if (m_noOfEvtThreads > 0) {
515 sc = addMultiSvc("HistorySvc",std::numeric_limits<int>::max());
516 if ( sc.isFailure() ) {
517 log << MSG::FATAL << "Error adding HistorySvc for multiple threads"
518 << endmsg;
519 return StatusCode::FAILURE;
520 }
521 }
522 }
523
524 log << MSG::INFO << "Application Manager Configured successfully" << endmsg;
525 m_state = m_targetState;
526 return StatusCode::SUCCESS;
527 }
ApplicationMgr::dllNameListHandler
void dllNameListHandler(Property &theProp)
Definition: ApplicationMgr.cpp:1205
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:212
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:617
ApplicationMgr::m_createSvcNameList
StringArrayProperty m_createSvcNameList
Definition: ApplicationMgr.h:251
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
ApplicationMgr::createSvcNameListHandler
void createSvcNameListHandler(Property &)
Definition: ApplicationMgr.cpp:1019
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.
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
std::string::empty
T empty(T...args)
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:1216
System::setEnv
GAUDI_API int setEnv(const std::string &name, const std::string &value, int overwrite=1)
Set an environment variables.
Definition: System.cpp:745
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
ApplicationMgr::m_runable
SmartIF< IRunable > m_runable
Reference to the runable object.
Definition: ApplicationMgr.h:219
ana.itm
tuple itm
Definition: ana.py:57
Property::declareUpdateHandler
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
ApplicationMgr::m_noOfEvtThreads
int m_noOfEvtThreads
no of multiThreadSvc copies
Definition: ApplicationMgr.h:233
ApplicationMgr::m_codeCheck
bool m_codeCheck
Activate StatusCode checking.
Definition: ApplicationMgr.h:248
Gaudi::Time::current
static Time current(void)
Returns the current time.
Definition: Time.cpp:113
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MSG::DEBUG
Definition: IMessageSvc.h:18
std::endl
T endl(T...args)
ApplicationMgr::m_appName
std::string m_appName
The name of the application.
Definition: ApplicationMgr.h:245
StatusCode::enableChecking
static GAUDI_API void enableChecking()
Definition: StatusCode.cpp:19
ApplicationMgr::m_environment
std::map< std::string, std::string > m_environment
Environment variables to set.
Definition: ApplicationMgr.h:258
ApplicationMgr::m_dllNameList
StringArrayProperty m_dllNameList
List of DDL's names.
Definition: ApplicationMgr.h:235
merge_files.sc
int sc
Definition: merge_files.py:167
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:221
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:220
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
ApplicationMgr::m_outputLevel
int m_outputLevel
Message output level.
Definition: ApplicationMgr.h:244
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:1168
MSG::FATAL
Definition: IMessageSvc.h:22
ApplicationMgr::m_returnCode
IntegerProperty m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:275
ApplicationMgr::multiThreadSvcNameListHandler
void multiThreadSvcNameListHandler(Property &theProp)
Definition: ApplicationMgr.cpp:1095
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:78
MSG::Level
Level
Definition: IMessageSvc.h:15
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::m_svcMapping
VectorName m_svcMapping
Default mapping of services.
Definition: ApplicationMgr.h:215
StatusCode::SUCCESS
Definition: StatusCode.h:30
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:198
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_actHistory
bool m_actHistory
Activate HistorySvc.
Definition: ApplicationMgr.h:247
PropertyMgr::getProperties
const std::vector< Property * > & getProperties() const override
get all properties
Definition: PropertyMgr.cpp:186
MSG::NIL
Definition: IMessageSvc.h:16
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
ApplicationMgr::m_multiThreadSvcNameList
StringArrayProperty m_multiThreadSvcNameList
List of external services names for which we want a copy per evt thread.
Definition: ApplicationMgr.h:232
ApplicationMgr::m_svcOptMapping
VectorName m_svcOptMapping
Default mapping of services.
Definition: ApplicationMgr.h:216
ApplicationMgr::m_runableType
std::string m_runableType
Runable type.
Definition: ApplicationMgr.h:240
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:1065
ApplicationMgr::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Reference to Property Manager.
Definition: ApplicationMgr.h:200
System::hostName
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:438
ApplicationMgr::m_propertiesPrint
bool m_propertiesPrint
flag to activate the printout of properties
Definition: ApplicationMgr.h:272
ApplicationMgr::m_extSvcNameList
StringArrayProperty m_extSvcNameList
List of external services names.
Definition: ApplicationMgr.h:228
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:1029
std::string::c_str
T c_str(T...args)
ApplicationMgr::m_eventLoopMgr
std::string m_eventLoopMgr
Processing manager type.
Definition: ApplicationMgr.h:241
ApplicationMgr::i_startup
StatusCode i_startup()
Internal startup routine.
Definition: ApplicationMgr.cpp:200
MSG::ERROR
Definition: IMessageSvc.h:21
StatusCode::disableChecking
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:23
gaudiComponentHelp.properties
tuple properties
Definition: gaudiComponentHelp.py:37
MSG::WARNING
Definition: IMessageSvc.h:20
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:16
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::decodeMultiThreadSvcNameList
StatusCode decodeMultiThreadSvcNameList()
Definition: ApplicationMgr.cpp:1107
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
ApplicationMgr::extSvcNameListHandler
void extSvcNameListHandler(Property &theProp)
Definition: ApplicationMgr.cpp:1054
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_appVersion
std::string m_appVersion
The version of the application.
Definition: ApplicationMgr.h:246
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
MSG::ALWAYS
Definition: IMessageSvc.h:23
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
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:279
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:1135

void ApplicationMgr::createSvcNameListHandler | ( | Property & |  | ) |

Definition at line 1019 of file ApplicationMgr.cpp.

1019 {
1020 if ( !(decodeCreateSvcNameList()).isSuccess() ) {
1021 throw GaudiException("Failed to create ext services",
1022 "MinimalEventLoopMgr::createSvcNameListHandler",
1023 StatusCode::FAILURE);
1024 }
1025 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:1029

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

1136 {
1137 StatusCode result = StatusCode::SUCCESS;
1138 MsgStream log( m_messageSvc, m_name );
1139 if (0 == m_noOfEvtThreads) {
1140 result = svcManager()->declareSvcType(name, type);
1141 if( result.isFailure() ) {
1142 log << MSG::ERROR << "declareMultiSvcType: Cannot declare service "
1143 << type << "/" << name << endmsg;
1144 } else {
1145 ON_VERBOSE
1146 log << MSG::VERBOSE << "declareMultiSvcType: declared service "
1147 << type << "/" << name << endmsg;
1148 }
1149 } else {
1150 for(int iCopy=0; iCopy<m_noOfEvtThreads; ++iCopy) {
1151 std::string thrName(name + getGaudiThreadIDfromID(iCopy));
1152 result = svcManager()->declareSvcType(thrName, type);
1153 if( result.isFailure() ) {
1154 log << MSG::ERROR << "declareMultiSvcType: Cannot declare service "
1155 << type << "/" << thrName << endmsg;
1156 } else {
1157 ON_VERBOSE
1158 log << MSG::VERBOSE << "declareMultiSvcType: declared service "
1159 << type << "/" << thrName << endmsg;
1160 }
1161 }
1162 }
1163 return result;
1164 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
ApplicationMgr::m_noOfEvtThreads
int m_noOfEvtThreads
no of multiThreadSvc copies
Definition: ApplicationMgr.h:233
MSG::VERBOSE
Definition: IMessageSvc.h:17
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:86
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
std::string
STL class.
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:210
MSG::ERROR
Definition: IMessageSvc.h:21
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:41
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode ApplicationMgr::decodeCreateSvcNameList | ( |  | ) |

Definition at line 1029 of file ApplicationMgr.cpp.

1029 {
1030 StatusCode result = StatusCode::SUCCESS;
1031 const auto& theNames = m_createSvcNameList.value( );
1032 auto it = theNames.begin();
1033 auto et = theNames.end();
1034 while(result.isSuccess() && it != et) {
1035 Gaudi::Utils::TypeNameString item(*it++);
1036 if( (result = svcManager()->addService(item, ServiceManager::DEFAULT_SVC_PRIORITY) ).isFailure()) {
1037 MsgStream log( m_messageSvc, m_name );
1038 log << MSG::ERROR << "decodeCreateSvcNameList: Cannot create service "
1039 << item.type() << "/" << item.name() << endmsg;
1040 } else {
1041 ON_DEBUG {
1042 MsgStream log( m_messageSvc, m_name );
1043 log << MSG::DEBUG << "decodeCreateSvcNameList: Created service "
1044 << item.type() << "/" << item.name() << endmsg;
1045 }
1046 }
1047 }
1048 return result;
1049 }
ApplicationMgr::m_createSvcNameList
StringArrayProperty m_createSvcNameList
Definition: ApplicationMgr.h:251
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MSG::DEBUG
Definition: IMessageSvc.h:18
std::string::end
T end(T...args)
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
StatusCode::SUCCESS
Definition: StatusCode.h:30
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:40
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
std::vector::begin
T begin(T...args)
ana.item
tuple item
print s1,s2
Definition: ana.py:146
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:210
MSG::ERROR
Definition: IMessageSvc.h:21
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode ApplicationMgr::decodeDllNameList | ( |  | ) |

Definition at line 1216 of file ApplicationMgr.cpp.

1216 {
1217
1218 MsgStream log( m_messageSvc, m_name );
1219 StatusCode result = StatusCode::SUCCESS;
1220
1221 // Clean up multiple entries from DLL list
1222 // -------------------------------------------------------------------------
1223 std::vector<std::string> newList;
1224 std::map<std::string,unsigned int> dllInList, duplicateList;
1225 {for ( const auto it : m_dllNameList.value()) {
1226 if ( 0 == dllInList[it] ) {
1227 newList.push_back(it); // first instance of this module
1228 } else { ++duplicateList[it]; } // module listed multiple times
1229 ++dllInList[it]; // increment count for this module
1230 }}
1231 //m_dllNameList = newList; // update primary list to new, filtered list (do not use the
1232 // property itself otherwise we get called again infinitely)
1233 // List modules that were in there twice..
1234 ON_DEBUG if ( !duplicateList.empty() ) {
1235 log << MSG::DEBUG << "Removed duplicate entries for modules : ";
1236 for ( auto it = duplicateList.begin(); it != duplicateList.end(); ++it ) {
1237 log << it->first << "(" << 1+it->second << ")";
1238 if ( it != --duplicateList.end() ) log << ", ";
1239 }
1240 log << endmsg;
1241 }
1242 // -------------------------------------------------------------------------
1243
1244 const std::vector<std::string>& theNames = newList;
1245
1246 // only load the new dlls or previously failed dlls
1247 ON_DEBUG log << MSG::DEBUG << "Loading declared DLL's" << endmsg;
1248
1249 std::vector<std::string> successNames, failNames;
1250 for (const auto& it : theNames) {
1251 if (std::find (m_okDlls.rbegin(), m_okDlls.rend(), it) == m_okDlls.rend()){
1252 // found a new module name
1253 StatusCode status = m_classManager->loadModule( it );
1254 if( status.isFailure() ) {
1255 failNames.push_back(it);
1256 result = StatusCode::FAILURE;
1257 }
1258 else {
1259 successNames.push_back(it);
1260 }
1261 }
1262 }
1263
1264 // report back to the user and store the names of the succesfully loaded dlls
1265 if ( !successNames.empty() ) {
1266 log << MSG::INFO << "Successfully loaded modules : ";
1267 for (auto it = successNames.begin(); it != successNames.end(); it++) {
1268 log<< (*it);
1269 if( (it+1) != successNames.end()) log << ", ";
1270 // save name
1271 m_okDlls.push_back( *it );
1272 }
1273 log << endmsg;
1274 }
1275
1276 if ( result == StatusCode::FAILURE ) {
1277 log << MSG::WARNING << "Failed to load modules: ";
1278 for (auto it = failNames.begin(); it != failNames.end(); it++) {
1279 log<< (*it);
1280 if( (it+1) != failNames.end()) log << ", ";
1281 }
1282 log << endmsg;
1283 }
1284 return result;
1285 }
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:29
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
std::vector::rend
T rend(T...args)
MSG::DEBUG
Definition: IMessageSvc.h:18
std::map::end
T end(T...args)
ApplicationMgr::m_okDlls
std::vector< std::string > m_okDlls
names of successfully loaded dlls
Definition: ApplicationMgr.h:281
ApplicationMgr::m_dllNameList
StringArrayProperty m_dllNameList
List of DDL's names.
Definition: ApplicationMgr.h:235
std::map< std::string, unsigned int >
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
std::vector::push_back
T push_back(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:40
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
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:199
std::map::begin
T begin(T...args)
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:210
MSG::WARNING
Definition: IMessageSvc.h:20
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector::rbegin
T rbegin(T...args)

StatusCode ApplicationMgr::decodeExtSvcNameList | ( |  | ) |

Definition at line 1065 of file ApplicationMgr.cpp.

1065 {
1066 StatusCode result = StatusCode::SUCCESS;
1067
1068 const auto& theNames = m_extSvcNameList.value( );
1069
1070 auto it = theNames.begin();
1071 auto et = theNames.end();
1072 while(result.isSuccess() && it != et) {
1073 Gaudi::Utils::TypeNameString item(*it++);
1074 if (m_extSvcCreates) {
1075 if ( (result = svcManager()->addService(item, ServiceManager::DEFAULT_SVC_PRIORITY)).isFailure()) {
1076 MsgStream log( m_messageSvc, m_name );
1077 log << MSG::ERROR << "decodeExtSvcNameList: Cannot create service "
1078 << item.type() << "/" << item.name() << endmsg;
1079 }
1080 } else {
1081 if( ( result = svcManager()->declareSvcType(item.name(),
1082 item.type()) ).isFailure()) {
1083 MsgStream log( m_messageSvc, m_name );
1084 log << MSG::ERROR << "decodeExtSvcNameList: Cannot declare service "
1085 << item.type() << "/" << item.name() << endmsg;
1086 }
1087 }
1088 }
1089 return result;
1090 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string::end
T end(T...args)
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
ApplicationMgr::m_extSvcCreates
BooleanProperty m_extSvcCreates
LHCb or ATLAS defn of "ExtSvc".
Definition: ApplicationMgr.h:229
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
ApplicationMgr::m_extSvcNameList
StringArrayProperty m_extSvcNameList
List of external services names.
Definition: ApplicationMgr.h:228
std::vector::begin
T begin(T...args)
ana.item
tuple item
print s1,s2
Definition: ana.py:146
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:210
MSG::ERROR
Definition: IMessageSvc.h:21
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode ApplicationMgr::decodeMultiThreadSvcNameList | ( |  | ) |

Definition at line 1107 of file ApplicationMgr.cpp.

1107 {
1108 StatusCode result = StatusCode::SUCCESS;
1109 const auto& theNames = m_multiThreadSvcNameList.value( );
1110 for(int iCopy=0; iCopy<m_noOfEvtThreads; ++iCopy) {
1111 for (const auto& it : theNames ) {
1112 Gaudi::Utils::TypeNameString item(it);
1113 result = addMultiSvc(item, ServiceManager::DEFAULT_SVC_PRIORITY);
1114 //FIXME SHOULD CLONE?
1115 if( result.isFailure() ) {
1116 MsgStream log( m_messageSvc, m_name );
1117 log << MSG::ERROR
1118 << "decodeMultiThreadSvcNameList: Cannot create service "
1119 << item.type() << "/" << item.name() << endmsg;
1120 } else {
1121 ON_VERBOSE {
1122 MsgStream log( m_messageSvc, m_name );
1123 log << MSG::VERBOSE
1124 << "decodeMultiThreadSvcNameList: created service "
1125 << item.type() << "/" << item.name() << endmsg;
1126 }
1127 }
1128 }
1129 }
1130 return result;
1131 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
ApplicationMgr::m_noOfEvtThreads
int m_noOfEvtThreads
no of multiThreadSvc copies
Definition: ApplicationMgr.h:233
MSG::VERBOSE
Definition: IMessageSvc.h:17
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
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:1168
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
ApplicationMgr::m_multiThreadSvcNameList
StringArrayProperty m_multiThreadSvcNameList
List of external services names for which we want a copy per evt thread.
Definition: ApplicationMgr.h:232
ana.item
tuple item
print s1,s2
Definition: ana.py:146
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:210
MSG::ERROR
Definition: IMessageSvc.h:21
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:41
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void ApplicationMgr::dllNameListHandler | ( | Property & | theProp | ) |

Definition at line 1205 of file ApplicationMgr.cpp.

1205 {
1206 if ( !(decodeDllNameList( )).isSuccess() ) {
1207 throw GaudiException("Failed to load DLLs.",
1208 "MinimalEventLoopMgr::dllNameListHandler",
1209 StatusCode::FAILURE);
1210 }
1211 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:1216
StatusCode::FAILURE
Definition: StatusCode.h:29

void ApplicationMgr::evtLoopPropertyHandler | ( | Property & | theProp | ) |

Definition at line 1009 of file ApplicationMgr.cpp.

1009 {
1010 if ( m_processingMgr ) {
1011 auto props = m_processingMgr.as<IProperty>();
1012 if ( props ) props->setProperty( p ).ignore();
1013 }
1014 }
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:220
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
IProperty::setProperty
virtual StatusCode setProperty(const Property &p)=0
Set the property by property.
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21

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

implementation of IEventProcessor::executeEvent(void*)

Definition at line 883 of file ApplicationMgr.cpp.

883 {
884 MsgStream log( m_messageSvc, name() );
885 if( m_state == Gaudi::StateMachine::RUNNING ) {
886 if ( m_processingMgr ) {
887 return m_processingMgr->executeEvent(par);
888 }
889 }
890 log << MSG::FATAL << "executeEvent: Invalid state \"" << FSMState() << "\""
891 <<endmsg;
892 return StatusCode::FAILURE;
893 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
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:220
MSG::FATAL
Definition: IMessageSvc.h:22
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:386
StatusCode::FAILURE
Definition: StatusCode.h:29
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:934
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

implementation of IEventProcessor::executeRun(int)

Definition at line 898 of file ApplicationMgr.cpp.

898 {
899 MsgStream log( m_messageSvc, name() );
900 if( m_state == Gaudi::StateMachine::RUNNING ) {
901 if ( m_processingMgr ) {
902 return m_processingMgr->executeRun(evtmax);
903 }
904 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
905 return StatusCode::SUCCESS;
906 }
907 log << MSG::FATAL << "executeRun: Invalid state \"" << FSMState() << "\""
908 << endmsg;
909 return StatusCode::FAILURE;
910 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:220
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
MSG::WARNING
Definition: IMessageSvc.h:20
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:934
IEventProcessor::executeRun
virtual StatusCode executeRun(int maxevt)=0
Process the maxevt events as a Run (beginRun() and endRun() called)
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void ApplicationMgr::extSvcNameListHandler | ( | Property & | theProp | ) |

Definition at line 1054 of file ApplicationMgr.cpp.

1054 {
1055 if ( !(decodeExtSvcNameList( )).isSuccess() ) {
1056 throw GaudiException("Failed to declare ext services",
1057 "MinimalEventLoopMgr::extSvcNameListHandler",
1058 StatusCode::FAILURE);
1059 }
1060 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:1065

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

Definition at line 677 of file ApplicationMgr.cpp.

677 {
678 MsgStream log( m_messageSvc, name() );
679 if( m_state == Gaudi::StateMachine::CONFIGURED ) {
680 log << MSG::INFO << "Already Finalized" << endmsg;
681 return StatusCode::SUCCESS;
682 }
683 if( m_state != Gaudi::StateMachine::INITIALIZED ) {
684 log << MSG::FATAL << "finalize: Invalid state \"" << m_state << "\""
685 << endmsg;
686 return StatusCode::FAILURE;
687 }
688 m_targetState = Gaudi::StateMachine::CONFIGURED;
689
690 // disable message suppression in finalize
691 m_svcLocator->service<IProperty>("MessageSvc")->setProperty(BooleanProperty("enableSuppression", false)).ignore();
692
693 // Finalize independently managed Algorithms
694 StatusCode sc = algManager()->finalize();
695 if (sc.isFailure()) {
696 log << MSG::WARNING << "Failed to finalize an algorithm." << endmsg;
697 m_returnCode = Gaudi::ReturnCode::FinalizationFailure;
698 }
699
700 // Finalize all Services
701 sc = svcManager()->finalize();
702 if (sc.isFailure()) {
703 log << MSG::WARNING << "Failed to finalize a service." << endmsg;
704 m_returnCode = Gaudi::ReturnCode::FinalizationFailure;
705 }
706
707 //svcManager()->removeService( (IService*) m_processingMgr.get() );
708 //svcManager()->removeService( (IService*) m_runable.get() );
709
710 if (m_codeCheck) {
711 StatusCode::disableChecking();
712 }
713
714 if (sc.isSuccess()) {
715 log << MSG::INFO << "Application Manager Finalized successfully" << endmsg;
716 } else {
717 log << MSG::ERROR << "Application Manager failed to finalize" << endmsg;
718 }
719
720 m_state = m_targetState;
721 return sc;
722 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:212
Gaudi::ReturnCode::FinalizationFailure
constexpr int FinalizationFailure
Error codes for operation failures.
Definition: AppReturnCode.h:32
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
ApplicationMgr::m_codeCheck
bool m_codeCheck
Activate StatusCode checking.
Definition: ApplicationMgr.h:248
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
BooleanProperty
SimpleProperty< bool > BooleanProperty
Definition: Property.h:702
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
MSG::FATAL
Definition: IMessageSvc.h:22
ApplicationMgr::m_returnCode
IntegerProperty m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:275
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:78
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:198
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
setProperty
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:254
IStateful::finalize
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).
MSG::ERROR
Definition: IMessageSvc.h:21
StatusCode::disableChecking
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:23
MSG::WARNING
Definition: IMessageSvc.h:20
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
MSG::INFO
Definition: IMessageSvc.h:19
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:147
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Definition at line 934 of file ApplicationMgr.cpp.

934 {
935 return m_state;
936 }
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
template<class I >

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

Definition at line 135 of file ApplicationMgr.h.

135 {
136 return m_managers[I::interfaceID().id()];
137 }
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:186

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

786 {
787 StatusCode sc = StatusCode(StatusCode::SUCCESS,true);
788
789 switch (state) {
790
791 case Gaudi::StateMachine::OFFLINE:
792 switch (m_state) {
793 case Gaudi::StateMachine::OFFLINE : return StatusCode::SUCCESS; break;
794 case Gaudi::StateMachine::CONFIGURED : return terminate(); break;
795 default: // Gaudi::StateMachine::INITIALIZED or Gaudi::StateMachine::RUNNING
796 sc = GoToState(Gaudi::StateMachine::CONFIGURED);
797 if (sc.isSuccess()) {
798 return terminate();
799 } break;
800 } break;
801
802 case Gaudi::StateMachine::CONFIGURED:
803 switch (m_state) {
804 case Gaudi::StateMachine::CONFIGURED : return StatusCode::SUCCESS; break;
805 case Gaudi::StateMachine::OFFLINE : return configure(); break;
806 case Gaudi::StateMachine::INITIALIZED : return finalize(); break;
807 default: // Gaudi::StateMachine::RUNNING
808 sc = GoToState(Gaudi::StateMachine::INITIALIZED);
809 if (sc.isSuccess()) {
810 return finalize();
811 } break;
812 } break;
813
814 case Gaudi::StateMachine::INITIALIZED:
815 switch (m_state) {
816 case Gaudi::StateMachine::INITIALIZED : return StatusCode::SUCCESS; break;
817 case Gaudi::StateMachine::CONFIGURED : return initialize(); break;
818 case Gaudi::StateMachine::RUNNING : return stop(); break;
819 default: // Gaudi::StateMachine::OFFLINE
820 sc = GoToState(Gaudi::StateMachine::CONFIGURED);
821 if (sc.isSuccess()) {
822 return initialize();
823 } break;
824 } break;
825
826 case Gaudi::StateMachine::RUNNING:
827 switch (m_state) {
828 case Gaudi::StateMachine::RUNNING : return StatusCode::SUCCESS; break;
829 case Gaudi::StateMachine::INITIALIZED : return start(); break;
830 default: // Gaudi::StateMachine::OFFLINE or Gaudi::StateMachine::CONFIGURED
831 sc = GoToState(Gaudi::StateMachine::INITIALIZED);
832 if (sc.isSuccess()) {
833 return start();
834 } break;
835 } break;
836
837 }
838
839 // If I get here, there has been a problem in the recursion
840
841 if (ignoreFailures){
842 // force the new state
843 m_state = state;
844 return StatusCode::SUCCESS;
845 }
846
847 return sc;
848 }
compareRootHistos.state
tuple state
Definition: compareRootHistos.py:348
ApplicationMgr::initialize
StatusCode initialize() override
Definition: ApplicationMgr.cpp:532
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
ApplicationMgr::terminate
StatusCode terminate() override
Definition: ApplicationMgr.cpp:727
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:786
ApplicationMgr::finalize
StatusCode finalize() override
Definition: ApplicationMgr.cpp:677
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::start
StatusCode start() override
Definition: ApplicationMgr.cpp:586
ApplicationMgr::configure
StatusCode configure() override
Definition: ApplicationMgr.cpp:311
ApplicationMgr::stop
StatusCode stop() override
Definition: ApplicationMgr.cpp:639
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13

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

Internal startup routine.

Definition at line 200 of file ApplicationMgr.cpp.

200 {
201
202 StatusCode sc;
203
204 // declare factories in current module
205 m_classManager->loadModule("").ignore();
206
207 // Create the Message service
208 auto msgsvc = svcManager()->createService(Gaudi::Utils::TypeNameString("MessageSvc", m_messageSvcType));
209 if( !msgsvc ) {
210 fatal() << "Error creating MessageSvc of type " << m_messageSvcType << endmsg;
211 return sc;
212 }
213 // Create the Job Options service
214 auto jobsvc = svcManager()->createService(Gaudi::Utils::TypeNameString("JobOptionsSvc", m_jobOptionsSvcType));
215 if( !jobsvc ) {
216 fatal() << "Error creating JobOptionsSvc" << endmsg;
217 return sc;
218 }
219
220 auto jobOptsIProp = jobsvc.as<IProperty>();
221 if ( !jobOptsIProp ) {
222 fatal() << "Error locating JobOptionsSvc" << endmsg;
223 return sc;
224 }
225 sc = jobOptsIProp->setProperty( StringProperty("TYPE", m_jobOptionsType) );
226 if( !sc.isSuccess() ) {
227 fatal() << "Error setting TYPE option in JobOptionsSvc" << endmsg;
228 return sc;
229 }
230
231 if ( m_jobOptionsPreAction != "") {
232 sc = jobOptsIProp->setProperty( StringProperty("PYTHONPARAMS", m_jobOptionsPreAction) );
233 if( !sc.isSuccess() ) {
234 fatal() << "Error setting JobOptionsPreAction option in JobOptionsSvc" << endmsg;
235 return sc;
236 }
237 }
238
239 if ( m_jobOptionsPostAction != "") {
240 sc = jobOptsIProp->setProperty( StringProperty("PYTHONACTION", m_jobOptionsPostAction) );
241 if( !sc.isSuccess() ) {
242 fatal() << "Error setting JobOptionsPostAction option in JobOptionsSvc" << endmsg;
243 return sc;
244 }
245 }
246
247 if ( !m_jobOptionsPath.empty() ) { // The command line takes precedence
248 sc = jobOptsIProp->setProperty( StringProperty("PATH", m_jobOptionsPath) );
249 if( !sc.isSuccess() ) {
250 fatal() << "Error setting PATH option in JobOptionsSvc" << endmsg;
251 return sc;
252 }
253 }
254 else if ( isEnvSet("JOBOPTPATH") ) {// Otherwise the Environment JOBOPTPATH
255 sc = jobOptsIProp->setProperty (StringProperty("PATH",
256 getEnv("JOBOPTPATH")));
257 if( !sc.isSuccess() ) {
258 fatal()
259 << "Error setting PATH option in JobOptionsSvc from env"
260 << endmsg;
261 return sc;
262 }
263 }
264 else { // Otherwise the default
265 sc = jobOptsIProp->setProperty (StringProperty("PATH",
266 "../options/job.opts"));
267 if( !sc.isSuccess() ) {
268 fatal()
269 << "Error setting PATH option in JobOptionsSvc to default"
270 << endmsg;
271 return sc;
272 }
273 }
274 jobOptsIProp.reset();
275
276 // Sets my default the Output Level of the Message service to be
277 // the same as this
278 auto msgSvcIProp = msgsvc.as<IProperty>();
279 msgSvcIProp->setProperty( IntegerProperty("OutputLevel", m_outputLevel)).ignore();
280 msgSvcIProp.reset();
281
282 sc = jobsvc->sysInitialize();
283 if( !sc.isSuccess() ) {
284 fatal() << "Error initializing JobOptionsSvc" << endmsg;
285 return sc;
286 }
287 sc = msgsvc->sysInitialize();
288 if( !sc.isSuccess() ) {
289 fatal() << "Error initializing MessageSvc" << endmsg;
290 return sc;
291 }
292
293 // Get the useful interface from Message and JobOptions services
294 m_messageSvc = m_svcLocator->service("MessageSvc");
295 if( !m_messageSvc ) {
296 fatal() << "Error retrieving MessageSvc." << endmsg;
297 return sc;
298 }
299 m_jobOptionsSvc = m_svcLocator->service("JobOptionsSvc");
300 if( !m_jobOptionsSvc ) {
301 fatal() << "Error retrieving JobOptionsSvc." << endmsg;
302 return sc;
303 }
304
305 return sc;
306 }
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:617
ApplicationMgr::m_jobOptionsType
std::string m_jobOptionsType
Source type (e.g. dbase, file...)
Definition: ApplicationMgr.h:236
ApplicationMgr::m_messageSvcType
StringProperty m_messageSvcType
MessageSvc type.
Definition: ApplicationMgr.h:207
std::string::empty
T empty(T...args)
DLLClassManager::loadModule
StatusCode loadModule(const std::string &module, bool fireIncident=true) override
Definition: DLLClassManager.cpp:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
ApplicationMgr::m_jobOptionsPreAction
std::string m_jobOptionsPreAction
additional command to run on config
Definition: ApplicationMgr.h:238
merge_files.sc
int sc
Definition: merge_files.py:167
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:221
ApplicationMgr::m_jobOptionsPostAction
std::string m_jobOptionsPostAction
additional command to run on config
Definition: ApplicationMgr.h:239
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
StringProperty
SimpleProperty< std::string > StringProperty
Definition: Property.h:718
ApplicationMgr::m_outputLevel
int m_outputLevel
Message output level.
Definition: ApplicationMgr.h:244
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:78
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
ApplicationMgr::m_jobOptionsPath
std::string m_jobOptionsPath
The "file" to look for properties.
Definition: ApplicationMgr.h:237
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!) ...
Definition: ApplicationMgr.h:198
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...
IProperty::setProperty
virtual StatusCode setProperty(const Property &p)=0
Set the property by property.
IntegerProperty
SimpleProperty< int > IntegerProperty
Definition: Property.h:708
System::isEnvSet
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
Definition: System.cpp:637
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:199
ApplicationMgr::m_jobOptionsSvcType
StringProperty m_jobOptionsSvcType
JobOptionsSvc type.
Definition: ApplicationMgr.h:208
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:112
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Definition at line 532 of file ApplicationMgr.cpp.

532 {
533
534 MsgStream log( m_messageSvc, name() );
535 StatusCode sc;
536
537 // I cannot add these services in configure() because they are coming from GaudiUtils
538 // and it messes up genconf when rebuilding it.
539 if (m_stopOnSignal) {
540 // Instantiate the service that schedules a stop when a signal is received
541 std::string svcname("Gaudi::Utils::StopSignalHandler");
542 sc = svcManager()->addService(svcname);
543 if ( sc.isFailure() ) {
544 log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
545 }
546 }
547
548 if (m_stalledEventMonitoring) {
549 // Instantiate the service that schedules a stop when a signal is received
550 std::string svcname("StalledEventMonitor");
551 sc = svcManager()->addService(svcname);
552 if ( sc.isFailure() ) {
553 log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
554 }
555 }
556
557 if( m_state == Gaudi::StateMachine::INITIALIZED ) {
558 log << MSG::INFO << "Already Initialized!" << endmsg;
559 return StatusCode::SUCCESS;
560 }
561 if( m_state != Gaudi::StateMachine::CONFIGURED ) {
562 log << MSG::FATAL
563 << "initialize: Invalid state \"" << m_state << "\"" << endmsg;
564 return StatusCode::FAILURE;
565 }
566 m_targetState = Gaudi::StateMachine::INITIALIZED;
567
568 //--------------------------------------------------------------------------
569 // Initialize the list of top Services
570 //--------------------------------------------------------------------------
571 sc = svcManager()->initialize();
572 if( !sc.isSuccess() ) return sc;
573
574 //--------------------------------------------------------------------------
575 // Final steps: Inform user and change internal state
576 //--------------------------------------------------------------------------
577 log << MSG::INFO << "Application Manager Initialized successfully" << endmsg;
578 m_state = m_targetState;
579
580 return sc;
581 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:212
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.
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
std::string
STL class.
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IStateful::initialize
virtual StatusCode initialize()=0
Initialization (from CONFIGURED to INITIALIZED).
ApplicationMgr::m_stalledEventMonitoring
BooleanProperty m_stalledEventMonitoring
Property to enable/disable the monitoring and reporting of stalled events (enabled by default)...
Definition: ApplicationMgr.h:269
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::m_stopOnSignal
BooleanProperty m_stopOnSignal
Property to enable/disable the "stop on signal" service (enabled by default).
Definition: ApplicationMgr.h:265
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void ApplicationMgr::initLoopCheckHndlr | ( | Property & |  | ) |

Definition at line 1304 of file ApplicationMgr.cpp.

1304 {
1305 svcManager()->setLoopCheckEnabled(m_loopCheck);
1306 }
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
ApplicationMgr::m_loopCheck
BooleanProperty m_loopCheck
For ServiceMgr initialization loop checking.
Definition: ApplicationMgr.h:261
ISvcManager::setLoopCheckEnabled
virtual void setLoopCheckEnabled(bool en=true)=0
Set the value of the initialization loop check flag.

void ApplicationMgr::multiThreadSvcNameListHandler | ( | Property & | theProp | ) |

Definition at line 1095 of file ApplicationMgr.cpp.

1095 {
1096 if ( !(decodeMultiThreadSvcNameList( )).isSuccess() ) {
1097 throw GaudiException("Failed to create copies of mt services",
1098 "MinimalEventLoopMgr::multiThreadSvcNameListHandler",
1099 StatusCode::FAILURE);
1100 }
1101
1102 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
ApplicationMgr::decodeMultiThreadSvcNameList
StatusCode decodeMultiThreadSvcNameList()
Definition: ApplicationMgr.cpp:1107

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

Definition at line 929 of file ApplicationMgr.cpp.

929 {
930 return m_name;
931 }
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:210

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

Definition at line 620 of file ApplicationMgr.cpp.

620 {
621 if( m_state != Gaudi::StateMachine::RUNNING ) {
622 MsgStream log( m_messageSvc, name() );
623 log << MSG::FATAL << "nextEvent: Invalid state \"" << m_state << "\""
624 << endmsg;
625 return StatusCode::FAILURE;
626 }
627 if (!m_processingMgr) {
628 MsgStream log( m_messageSvc, name() );
629 log << MSG::FATAL << "No event processing manager specified. Check option:"
630 << s_eventloop << endmsg;
631 return StatusCode::FAILURE;
632 }
633 return m_processingMgr->nextEvent(maxevt);
634 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:220
IEventProcessor::nextEvent
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode::FAILURE
Definition: StatusCode.h:29
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void ApplicationMgr::pluginDebugPropertyHandler | ( | Property & | theProp | ) |

Definition at line 1290 of file ApplicationMgr.cpp.

1291 {
1292 // Setup debug level for the plugin system
1293 MsgStream log (m_messageSvc, name());
1294 log << MSG::INFO
1295 << "Updating Gaudi::PluginService::SetDebug(level) to level="
1296 << m_pluginDebugLevel
1297 << endmsg;
1298 Gaudi::PluginService::SetDebug(m_pluginDebugLevel);
1299 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
ApplicationMgr::m_pluginDebugLevel
IntegerProperty m_pluginDebugLevel
Debug level for the plugin system.
Definition: ApplicationMgr.h:249
Gaudi::PluginService::SetDebug
GAUDIPS_API void SetDebug(int debugLevel)
Backward compatibility with Reflex.
Definition: PluginService.cpp:342
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Definition at line 165 of file ApplicationMgr.cpp.

167 {
168 if ( !ppvi ) { return StatusCode::FAILURE ; }
169
170 // try to find own/direct interfaces:
171 StatusCode sc = base_class::queryInterface(iid,ppvi);
172 if (sc.isSuccess()) return sc;
173
174 // find indirect interfaces :
175 if ( ISvcLocator ::interfaceID() . versionMatch ( iid ) )
176 { return serviceLocator()-> queryInterface ( iid , ppvi ) ; }
177 if ( ISvcManager ::interfaceID() . versionMatch ( iid ) )
178 { return svcManager() -> queryInterface ( iid , ppvi ) ; }
179 if ( IAlgManager ::interfaceID() . versionMatch ( iid ) )
180 { return algManager() -> queryInterface ( iid , ppvi ) ; }
181 if ( IClassManager ::interfaceID() . versionMatch ( iid ) )
182 { return m_classManager -> queryInterface ( iid , ppvi ) ; }
183 if ( IProperty ::interfaceID() . versionMatch ( iid ) )
184 { return m_propertyMgr -> queryInterface ( iid , ppvi ) ; }
185 if ( IMessageSvc ::interfaceID() . versionMatch ( iid ) )
186 {
187 *ppvi = reinterpret_cast<void*>(m_messageSvc.get());
188 if (m_messageSvc) m_messageSvc->addRef();
189 // Note that 0 can be a valid IMessageSvc pointer value (when used for
190 // MsgStream).
191 return StatusCode::SUCCESS;
192 }
193 *ppvi = nullptr;
194 return StatusCode::FAILURE;
195 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Needed to locate the message service.
Definition: ApplicationMgr.h:156
ApplicationMgr::queryInterface
StatusCode queryInterface(const InterfaceID &iid, void **pinterface) override
Definition: ApplicationMgr.cpp:165
ApplicationMgr::m_propertyMgr
SmartIF< PropertyMgr > m_propertyMgr
Reference to Property Manager.
Definition: ApplicationMgr.h:200
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:199
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:147
IInterface::interfaceID
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:243
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218

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

Definition at line 946 of file ApplicationMgr.cpp.

946 {
947 StatusCode retval = StatusCode::SUCCESS;
948 StatusCode sc;
949 if ( m_state < Gaudi::StateMachine::INITIALIZED ) {
950 throw GaudiException("Cannot reinitialize application if not INITIALIZED or RUNNING",
951 "ApplicationMgr::reinitialize", StatusCode::FAILURE);
952 }
953 if ( m_state == Gaudi::StateMachine::RUNNING ) {
954 retval = GoToState(Gaudi::StateMachine::INITIALIZED);
955 }
956 sc = svcManager()->reinitialize();
957 if (sc.isFailure()) retval = sc;
958 sc = algManager()->reinitialize();
959 if (sc.isFailure()) retval = sc;
960 return retval;
961 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
StatusCode::FAILURE
Definition: StatusCode.h:29
IStateful::reinitialize
virtual StatusCode reinitialize()=0
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:786
compareRootHistos.retval
tuple retval
Definition: compareRootHistos.py:351
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:147

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

Definition at line 966 of file ApplicationMgr.cpp.

966 {
967 StatusCode retval = StatusCode::SUCCESS;
968 StatusCode sc;
969 if ( m_state != Gaudi::StateMachine::RUNNING ) {
970 throw GaudiException("Cannot restart application if not RUNNING",
971 "ApplicationMgr::restart", StatusCode::FAILURE);
972 }
973 sc = svcManager()->restart();
974 if (sc.isFailure()) retval = sc;
975 sc = algManager()->restart();
976 if (sc.isFailure()) retval = sc;
977 return retval;
978 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
compareRootHistos.retval
tuple retval
Definition: compareRootHistos.py:351
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
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:211
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:147

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

Definition at line 853 of file ApplicationMgr.cpp.

853 {
854 StatusCode sc = StatusCode::SUCCESS;
855
856 sc = GoToState(Gaudi::StateMachine::RUNNING);
857 if ( sc.isSuccess() ) {
858 MsgStream log(m_messageSvc, name());
859 if ( m_runable != 0 ) { // loop over the events
860 sc = m_runable->run();
861 if ( !sc.isSuccess() ) {
862 log << MSG::FATAL << "Application execution failed. Ending the job."
863 << endmsg;
864 }
865 } else {
866 log << MSG::FATAL << "Application has no runable object. Check option:"
867 << s_runable << endmsg;
868 }
869 }
870 if (sc.isSuccess()) { // try to close cleanly
871 sc = GoToState(Gaudi::StateMachine::OFFLINE);
872 }
873 // either the runable failed of the stut-down
874 if (sc.isFailure()) { // try to close anyway (but keep the StatusCode unchanged)
875 GoToState(Gaudi::StateMachine::OFFLINE,true).ignore();
876 }
877 return sc;
878 }
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:219
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:786
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Needed to locate the message service.

Definition at line 156 of file ApplicationMgr.h.

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

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

Definition at line 169 of file ApplicationMgr.h.

169 {}

void ApplicationMgr::SIExitHandler | ( | Property & | theProp | ) |

Definition at line 999 of file ApplicationMgr.cpp.

999 {
1000 StatusCode status;
1001 status = finalize();
1002 status = terminate();
1003 ::exit( 0 );
1004 }
ApplicationMgr::terminate
StatusCode terminate() override
Definition: ApplicationMgr.cpp:727
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::finalize
StatusCode finalize() override
Definition: ApplicationMgr.cpp:677

void ApplicationMgr::SIGoHandler | ( | Property & | theProp | ) |

Definition at line 983 of file ApplicationMgr.cpp.

983 {
984
985 MsgStream log (m_messageSvc, name());
986 StatusCode sc;
987
988 // Re-initialize everything
989 sc = reinitialize();
990 // Execute a number of events
991 executeRun(m_evtMax);
992
993 return;
994 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
merge_files.sc
int sc
Definition: merge_files.py:167
ApplicationMgr::m_evtMax
int m_evtMax
Number of events to be processed.
Definition: ApplicationMgr.h:227
ApplicationMgr::executeRun
StatusCode executeRun(int evtmax) override
implementation of IEventProcessor::executeRun(int)
Definition: ApplicationMgr.cpp:898
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ApplicationMgr::reinitialize
StatusCode reinitialize() override
Definition: ApplicationMgr.cpp:946
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218

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

Definition at line 586 of file ApplicationMgr.cpp.

586 {
587
588 MsgStream log( m_messageSvc, name() );
589 StatusCode sc;
590
591 if( m_state == Gaudi::StateMachine::RUNNING ) {
592 log << MSG::INFO << "Already Initialized!" << endmsg;
593 return StatusCode::SUCCESS;
594 }
595 if( m_state != Gaudi::StateMachine::INITIALIZED ) {
596 log << MSG::FATAL
597 << "start: Invalid state \"" << m_state << "\"" << endmsg;
598 return StatusCode::FAILURE;
599 }
600 m_targetState = Gaudi::StateMachine::RUNNING;
601
602 //--------------------------------------------------------------------------
603 // Initialize the list of top Services
604 //--------------------------------------------------------------------------
605 sc = svcManager()->start();
606 if( !sc.isSuccess() ) return sc;
607
608 //--------------------------------------------------------------------------
609 // Final steps: Inform user and change internal state
610 //--------------------------------------------------------------------------
611 log << MSG::INFO << "Application Manager Started successfully" << endmsg;
612 m_state = m_targetState;
613
614 return sc;
615 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:212
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
IStateful::start
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Definition at line 639 of file ApplicationMgr.cpp.

639 {
640
641 MsgStream log( m_messageSvc, name() );
642 StatusCode sc;
643
644 if( m_state == Gaudi::StateMachine::INITIALIZED ) {
645 log << MSG::INFO << "Already Initialized!" << endmsg;
646 return StatusCode::SUCCESS;
647 }
648 if( m_state != Gaudi::StateMachine::RUNNING ) {
649 log << MSG::FATAL
650 << "stop: Invalid state \"" << m_state << "\"" << endmsg;
651 return StatusCode::FAILURE;
652 }
653 m_targetState = Gaudi::StateMachine::INITIALIZED;
654
655 // Stop independently managed Algorithms
656 sc = algManager()->stop();
657 if( !sc.isSuccess() ) return sc;
658
659 //--------------------------------------------------------------------------
660 // Stop the list of top Services
661 //--------------------------------------------------------------------------
662 sc = svcManager()->stop();
663 if( !sc.isSuccess() ) return sc;
664
665 //--------------------------------------------------------------------------
666 // Final steps: Inform user and change internal state
667 //--------------------------------------------------------------------------
668 log << MSG::INFO << "Application Manager Stopped successfully" << endmsg;
669 m_state = m_targetState;
670
671 return sc;
672 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:212
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:139
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode::FAILURE
Definition: StatusCode.h:29
IStateful::stop
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
MSG::INFO
Definition: IMessageSvc.h:19
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:147
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

implementation of IEventProcessor::stopRun()

Definition at line 915 of file ApplicationMgr.cpp.

915 {
916 MsgStream log( m_messageSvc, name() );
917 if( m_state == Gaudi::StateMachine::RUNNING ) {
918 if ( m_processingMgr ) {
919 return m_processingMgr->stopRun();
920 }
921 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
922 return StatusCode::SUCCESS;
923 }
924 log << MSG::FATAL << "stopRun: Invalid state \"" << FSMState() << "\""
925 << endmsg;
926 return StatusCode::FAILURE;
927 }
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.
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:220
MSG::FATAL
Definition: IMessageSvc.h:22
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
MSG::WARNING
Definition: IMessageSvc.h:20
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:934
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Definition at line 139 of file ApplicationMgr.h.

139 {
140 // Cache the casted pointer to ISvcManager
141 if (!m_svcManager) {
142 m_svcManager = getManager<IService>();
143 }
144 return m_svcManager;
145 }
ApplicationMgr::m_svcManager
SmartIF< ISvcManager > m_svcManager
Cached pointer to the manager of services.
Definition: ApplicationMgr.h:191

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

Definition at line 108 of file ApplicationMgr.h.

108 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

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

Definition at line 102 of file ApplicationMgr.h.

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

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

Definition at line 110 of file ApplicationMgr.h.

110 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

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

Definition at line 112 of file ApplicationMgr.h.

112 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

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

Definition at line 104 of file ApplicationMgr.h.

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

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

Definition at line 106 of file ApplicationMgr.h.

106 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

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

Definition at line 938 of file ApplicationMgr.cpp.

938 {
939 return m_targetState;
940 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:212

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

Definition at line 727 of file ApplicationMgr.cpp.

727 {
728 MsgStream log( m_messageSvc, name() );
729
730 if( m_state == Gaudi::StateMachine::OFFLINE ) {
731 log << MSG::INFO << "Already Offline" << endmsg;
732 return StatusCode::SUCCESS;
733 }
734 if( m_state != Gaudi::StateMachine::CONFIGURED ) {
735 log << MSG::FATAL << "terminate: Invalid state \"" << m_state << "\""
736 << endmsg;
737 return StatusCode::FAILURE;
738 }
739 // release all Services
740 m_targetState = Gaudi::StateMachine::OFFLINE;
741
742 if (m_returnCode.value() == Gaudi::ReturnCode::Success) {
743 log << MSG::INFO << "Application Manager Terminated successfully" << endmsg;
744 } else if (m_returnCode.value() == Gaudi::ReturnCode::ScheduledStop ) {
745 log << MSG::INFO << "Application Manager Terminated successfully with a user requested ScheduledStop" << endmsg;
746 } else {
747 log << MSG::ERROR << "Application Manager Terminated with error code " << m_returnCode.value() << endmsg;
748 }
749
750 { // Force a disable the auditing of finalize for MessageSvc
751 auto prop = m_messageSvc.as<IProperty>();
752 if (prop) {
753 prop->setProperty(BooleanProperty("AuditFinalize", false)).ignore();
754 }
755 }
756 { // Force a disable the auditing of finalize for JobOptionsSvc
757 auto prop = m_jobOptionsSvc.as<IProperty>();
758 if (prop) {
759 prop->setProperty(BooleanProperty("AuditFinalize", false)).ignore();
760 }
761 }
762
763 // finalize MessageSvc
764 auto svc = m_messageSvc.as<IService>();
765 if ( !svc ) {
766 log << MSG::ERROR << "Could not get the IService interface of the MessageSvc" << endmsg;
767 } else {
768 svc->sysFinalize().ignore();
769 }
770
771 // finalize JobOptionsSvc
772 svc = m_jobOptionsSvc.as<IService>();
773 if ( !svc ) {
774 log << MSG::ERROR << "Could not get the IService interface of the JobOptionsSvc" << endmsg;
775 } else {
776 svc->sysFinalize().ignore();
777 }
778
779 m_state = m_targetState;
780 return StatusCode::SUCCESS;
781 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:212
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
BooleanProperty
SimpleProperty< bool > BooleanProperty
Definition: Property.h:702
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:221
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:25
MSG::FATAL
Definition: IMessageSvc.h:22
ApplicationMgr::m_returnCode
IntegerProperty m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:275
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
StatusCode::FAILURE
Definition: StatusCode.h:29
IService
General service interface definition.
Definition: IService.h:18
StatusCode::SUCCESS
Definition: StatusCode.h:30
IProperty::setProperty
virtual StatusCode setProperty(const Property &p)=0
Set the property by property.
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
MSG::ERROR
Definition: IMessageSvc.h:21
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:211
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:16
MSG::INFO
Definition: IMessageSvc.h:19
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:929
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

## Member Data Documentation

bool ApplicationMgr::m_actHistory
| protected

Activate HistorySvc.

Definition at line 247 of file ApplicationMgr.h.

SmartIF<IAlgManager> ApplicationMgr::m_algManager
| protected

Cached pointer to the manager of algorithms.

Definition at line 194 of file ApplicationMgr.h.

std::string ApplicationMgr::m_appName
| protected

The name of the application.

Definition at line 245 of file ApplicationMgr.h.

std::string ApplicationMgr::m_appVersion
| protected

The version of the application.

Definition at line 246 of file ApplicationMgr.h.

BooleanProperty ApplicationMgr::m_auditAlgs
| protected

Definition at line 256 of file ApplicationMgr.h.

BooleanProperty ApplicationMgr::m_auditSvcs
| protected

Definition at line 255 of file ApplicationMgr.h.

BooleanProperty ApplicationMgr::m_auditTools
| protected

Defaults for auditors.

Definition at line 254 of file ApplicationMgr.h.

SmartIF<DLLClassManager> ApplicationMgr::m_classManager
| protected

Reference to the class manager.

Definition at line 199 of file ApplicationMgr.h.

bool ApplicationMgr::m_codeCheck
| protected

Activate StatusCode checking.

Definition at line 248 of file ApplicationMgr.h.

StringArrayProperty ApplicationMgr::m_createSvcNameList
| protected

Definition at line 251 of file ApplicationMgr.h.

StringArrayProperty ApplicationMgr::m_declaredManagers
| protected

Property to declare the list of known managers.

Definition at line 188 of file ApplicationMgr.h.

VectorName ApplicationMgr::m_defServices
| protected

Vector default services names.

Definition at line 214 of file ApplicationMgr.h.

StringArrayProperty ApplicationMgr::m_dllNameList
| protected

List of DDL's names.

Definition at line 235 of file ApplicationMgr.h.

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

Environment variables to set.

Definition at line 258 of file ApplicationMgr.h.

std::string ApplicationMgr::m_eventLoopMgr
| protected

Processing manager type.

Definition at line 241 of file ApplicationMgr.h.

int ApplicationMgr::m_evtMax
| protected

Number of events to be processed.

Definition at line 227 of file ApplicationMgr.h.

std::string ApplicationMgr::m_evtsel
| protected

Event selection.

Definition at line 242 of file ApplicationMgr.h.

BooleanProperty ApplicationMgr::m_extSvcCreates
| protected

LHCb or ATLAS defn of "ExtSvc".

Definition at line 229 of file ApplicationMgr.h.

StringArrayProperty ApplicationMgr::m_extSvcNameList
| protected

List of external services names.

Definition at line 228 of file ApplicationMgr.h.

std::string ApplicationMgr::m_histPersName
| protected

CGL: Name of the Hist Pers Svc.

Definition at line 243 of file ApplicationMgr.h.

std::string ApplicationMgr::m_jobOptionsPath
| protected

The "file" to look for properties.

Definition at line 237 of file ApplicationMgr.h.

std::string ApplicationMgr::m_jobOptionsPostAction
| protected

additional command to run on config

Definition at line 239 of file ApplicationMgr.h.

std::string ApplicationMgr::m_jobOptionsPreAction
| protected

additional command to run on config

Definition at line 238 of file ApplicationMgr.h.

SmartIF<IJobOptionsSvc> ApplicationMgr::m_jobOptionsSvc
| protected

Reference to JobOption service.

Definition at line 221 of file ApplicationMgr.h.

StringProperty ApplicationMgr::m_jobOptionsSvcType
| protected

JobOptionsSvc type.

Definition at line 208 of file ApplicationMgr.h.

std::string ApplicationMgr::m_jobOptionsType
| protected

Source type (e.g. dbase, file...)

Definition at line 236 of file ApplicationMgr.h.

BooleanProperty ApplicationMgr::m_loopCheck
| protected

For ServiceMgr initialization loop checking.

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

SmartIF<IMessageSvc> ApplicationMgr::m_messageSvc
| protected

Reference to the message service.

Definition at line 218 of file ApplicationMgr.h.

StringProperty ApplicationMgr::m_messageSvcType
| protected

MessageSvc type.

Definition at line 207 of file ApplicationMgr.h.

StringArrayProperty ApplicationMgr::m_multiThreadSvcNameList
| protected

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

Definition at line 232 of file ApplicationMgr.h.

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

Name.

Definition at line 210 of file ApplicationMgr.h.

int ApplicationMgr::m_noOfEvtThreads
| protected

no of multiThreadSvc copies

Definition at line 233 of file ApplicationMgr.h.

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

names of successfully loaded dlls

Definition at line 281 of file ApplicationMgr.h.

int ApplicationMgr::m_outputLevel
| protected

Message output level.

Definition at line 244 of file ApplicationMgr.h.

StringArrayProperty ApplicationMgr::m_outStreamNameList
| protected

List of output stream names.

Definition at line 205 of file ApplicationMgr.h.

StringProperty ApplicationMgr::m_outStreamType
| protected

Output stream type (obsolete?)

Definition at line 206 of file ApplicationMgr.h.

IntegerProperty ApplicationMgr::m_pluginDebugLevel
| protected

Debug level for the plugin system.

Definition at line 249 of file ApplicationMgr.h.

SmartIF<IEventProcessor> ApplicationMgr::m_processingMgr
| protected

Reference to processing manager object.

Definition at line 220 of file ApplicationMgr.h.

bool ApplicationMgr::m_propertiesPrint
| protected

flag to activate the printout of properties

Definition at line 272 of file ApplicationMgr.h.

SmartIF<PropertyMgr> ApplicationMgr::m_propertyMgr
| protected

Reference to Property Manager.

Definition at line 200 of file ApplicationMgr.h.

IntegerProperty ApplicationMgr::m_returnCode
| protected

Property to record the error conditions occurring during the running.

Definition at line 275 of file ApplicationMgr.h.

SmartIF<IRunable> ApplicationMgr::m_runable
| protected

Reference to the runable object.

Definition at line 219 of file ApplicationMgr.h.

std::string ApplicationMgr::m_runableType
| protected

Runable type.

Definition at line 240 of file ApplicationMgr.h.

IntegerProperty ApplicationMgr::m_SIExit
| protected

For SI's "Exit" command via callback.

Definition at line 203 of file ApplicationMgr.h.

IntegerProperty ApplicationMgr::m_SIGo
| protected

For SI's "Go" command via callback.

Definition at line 202 of file ApplicationMgr.h.

BooleanProperty ApplicationMgr::m_stalledEventMonitoring
| protected

Property to enable/disable the monitoring and reporting of stalled events (enabled by default).

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

BooleanProperty ApplicationMgr::m_stopOnSignal
| protected

Property to enable/disable the "stop on signal" service (enabled by default).

See also
  Gaudi::Utils::StopSignalHandler

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

SmartIF<ISvcManager> ApplicationMgr::m_svcManager
| protected

Cached pointer to the manager of services.

Definition at line 191 of file ApplicationMgr.h.

VectorName ApplicationMgr::m_svcMapping
| protected

Default mapping of services.

Definition at line 215 of file ApplicationMgr.h.

VectorName ApplicationMgr::m_svcOptMapping
| protected

Default mapping of services.

Definition at line 216 of file ApplicationMgr.h.

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

Internal State.

Definition at line 212 of file ApplicationMgr.h.

StringArrayProperty ApplicationMgr::m_topAlgNameList
| protected

List of top level algorithms names.

Definition at line 204 of file ApplicationMgr.h.

bool ApplicationMgr::m_useHiveAlgorithmManager
| protected

Definition at line 278 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