The Gaudi Framework  v33r1 (b1225454)
ApplicationMgr Class Reference

The Application Manager class. More...

#include <src/ApplicationMgr/ApplicationMgr.h>

Inheritance diagram for ApplicationMgr:
Collaboration diagram for ApplicationMgr:

Public Member Functions

 ApplicationMgr (IInterface *=nullptr)
 
StatusCode queryInterface (const InterfaceID &iid, void **pinterface) override
 
StatusCode run () override
 
StatusCode configure () override
 
StatusCode terminate () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode nextEvent (int maxevt) override
 
const std::stringname () const override
 
EventContext createEventContext () override
 implementation of IEventProcessor::createEventContext() More...
 
StatusCode executeEvent (EventContext &&ctx) override
 implementation of IEventProcessor::executeEvent(void*) More...
 
StatusCode executeRun (int evtmax) override
 implementation of IEventProcessor::executeRun(int) More...
 
StatusCode stopRun () override
 implementation of IEventProcessor::stopRun() More...
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 
StatusCode sysStart () override
 
StatusCode sysStop () override
 
StatusCode sysFinalize () override
 
StatusCode sysReinitialize () override
 
StatusCode sysRestart () override
 
template<class I >
SmartIF< IComponentManager > & getManager ()
 
SmartIF< ISvcManager > & svcManager ()
 
SmartIF< IAlgManager > & algManager ()
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Needed to locate the message service. More...
 
void outputLevelUpdate () override
 Function to call to update the outputLevel of the components (after a change in MessageSvc). More...
 
void printAlgsSequences ()
 Print the sequence of algorithms that have been loaded. More...
 
void push (EventContext &&ctx) override
 
bool empty () const override
 
std::optional< Gaudi::Interfaces::IQueueingEventProcessor::ResultTypepop () override
 
Gaudi::Details::PropertyBase handlers
void evtLoopPropertyHandler (Gaudi::Details::PropertyBase &theProp)
 
StatusCode decodeExtSvcNameList ()
 
StatusCode decodeCreateSvcNameList ()
 
void createSvcNameListHandler (Gaudi::Details::PropertyBase &)
 
void extSvcNameListHandler (Gaudi::Details::PropertyBase &theProp)
 
StatusCode decodeDllNameList ()
 
void dllNameListHandler (Gaudi::Details::PropertyBase &theProp)
 
void pluginDebugPropertyHandler (Gaudi::Details::PropertyBase &theProp)
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p) override
 set the property form another property More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 set the property from name and the value More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (const std::string &name) const override
 get the property by name More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 convert the property to the string More...
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties More...
 
bool hasProperty (const std::string &name) const override
 Return true if we have a property with the given name. More...
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor. More...
 
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) 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

void setServiceManager (ISvcManager *) override
 
StatusCode i_startup ()
 Internal startup routine. More...
 
StatusCode GoToState (Gaudi::StateMachine::State state, bool ignoreFailures=false)
 Reach a state from current state (whichever it is) going through the correct transitions. More...
 
- Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
Gaudi::Details::PropertyBaseproperty (const std::string &name) const
 
- Protected Member Functions inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >
MSG::Level setUpMessaging () const
 Set up local caches. More...
 
MSG::Level resetMessaging ()
 Reinitialize internal states. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Protected Attributes

ManagersMap m_managers
 Map of known component managers. More...
 
Gaudi::Property< std::vector< std::string > > m_declaredManagers
 Property to declare the list of known managers. More...
 
SmartIF< ISvcManagerm_svcManager
 Cached pointer to the manager of services. More...
 
SmartIF< IAlgManagerm_algManager
 Cached pointer to the manager of algorithms. More...
 
SmartIF< ISvcLocatorm_svcLocator
 Reference to its own service locator (must be instantiated prior to any service!) More...
 
SmartIF< DLLClassManagerm_classManager
 Reference to the class manager. More...
 
Gaudi::Property< int > m_SIGo
 
Gaudi::Property< int > m_SIExit
 
Gaudi::Property< std::vector< std::string > > m_topAlgNameList
 
Gaudi::Property< std::vector< std::string > > m_outStreamNameList
 
Gaudi::Property< std::stringm_outStreamType
 
Gaudi::Property< std::stringm_messageSvcType
 
Gaudi::Property< std::stringm_jobOptionsSvcType
 
std::string m_name = "ApplicationMgr"
 Name. More...
 
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Internal State. More...
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Internal State. More...
 
Gaudi::Property< std::vector< std::string > > m_svcMapping {this, "SvcMapping", {}, "Default mapping of services"}
 
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
 
SmartIF< IMessageSvcm_messageSvc
 Reference to the message service. More...
 
SmartIF< IRunablem_runable
 Reference to the runable object. More...
 
SmartIF< IEventProcessorm_processingMgr
 Reference to processing manager object. More...
 
SmartIF< IJobOptionsSvcm_jobOptionsSvc
 Reference to JobOption service. More...
 
SmartIF< IQueueingEventProcessor > m_queueingProcessor
 Reference to a queueing processing manager object. More...
 
Gaudi::Property< int > m_evtMax {this, "EvtMax", -1, "Number of events to be processed (-1 means all events)"}
 
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
 
Gaudi::Property< bool > m_extSvcCreates
 
Gaudi::Property< std::vector< std::string > > m_dllNameList {this, "Dlls", {}, "List of DDL's names"}
 
Gaudi::Property< std::stringm_jobOptionsType {this, "JobOptionsType", "FILE", "Source type (e.g. dbase, file...)"}
 
Gaudi::Property< std::stringm_jobOptionsPath {this, "JobOptionsPath", {}, "The \"file\" to look for properties"}
 
Gaudi::Property< std::stringm_jobOptionsPreAction
 
Gaudi::Property< std::stringm_jobOptionsPostAction
 
Gaudi::Property< std::stringm_runableType {this, "Runable", "AppMgrRunable", "Runable type"}
 
Gaudi::Property< std::stringm_eventLoopMgr {this, "EventLoop", "EventLoopMgr", "Processing manager type"}
 
Gaudi::Property< std::stringm_evtsel {this, "EvtSel", {}, "Event selection"}
 
Gaudi::Property< std::stringm_histPersName {this, "HistogramPersistency", "NONE", "Name of the Hist Pers Svc"}
 
Gaudi::Property< int > m_outputLevel {this, "OutputLevel", MSG::INFO, "Message output level"}
 
Gaudi::Property< std::stringm_appName {this, "AppName", "ApplicationMgr", "The name of the application"}
 
Gaudi::Property< std::stringm_appVersion {this, "AppVersion", {}, "The version of the application"}
 
Gaudi::Property< bool > m_actHistory {this, "ActivateHistory", false, "Activate HistorySvc"}
 
Gaudi::Property< bool > m_codeCheck {this, "StatusCodeCheck", false, "Activate StatusCode checking"}
 
Gaudi::Property< int > m_pluginDebugLevel
 
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
 
Gaudi::Property< bool > m_auditTools {this, "AuditTools", false}
 Defaults for auditors. More...
 
Gaudi::Property< bool > m_auditSvcs {this, "AuditServices", false}
 
Gaudi::Property< bool > m_auditAlgs {this, "AuditAlgorithms", false}
 
Gaudi::Property< std::map< std::string, std::string > > m_environment
 
Gaudi::Property< bool > m_loopCheck
 
Gaudi::Property< bool > m_stopOnSignal
 Property to enable/disable the "stop on signal" service. More...
 
Gaudi::Property< bool > m_stalledEventMonitoring
 Property to enable/disable the monitoring and reporting of stalled events. More...
 
Gaudi::Property< bool > m_propertiesPrint
 
Gaudi::Property< int > m_returnCode
 Property to record the error conditions occurring during the running. More...
 
Gaudi::Property< bool > m_printAlgsSequence
 
bool m_useHiveAlgorithmManager
 

Static Private Member Functions

template<typename SELF , typename PIMPL , typename METHOD , typename... ARGS>
static auto i_delegateToEvtProc (SELF *self, PIMPL &member, std::string_view method_name, METHOD &&method, ARGS &&... args)
 Helper to delegate calls to event processor implementation. More...
 

Private Attributes

std::vector< std::stringm_okDlls
 names of successfully loaded dlls More...
 

Additional Inherited Members

- Public Types inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
using PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
 Typedef used to refer to this class from derived classes, as in. More...
 
- Public Types inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IQueueingEventProcessor, IService, IStateful, INamedInterface, IProperty > >
using base_class = CommonMessaging
 

Detailed Description

The Application Manager class.

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

Author
Pere Mato

Definition at line 55 of file ApplicationMgr.h.

Member Typedef Documentation

◆ ManagersMap

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

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

Definition at line 172 of file ApplicationMgr.h.

Constructor & Destructor Documentation

◆ ApplicationMgr()

ApplicationMgr::ApplicationMgr ( IInterface = nullptr)

Definition at line 58 of file ApplicationMgr.cpp.

58  {
59  // IInterface initialization
60  addRef(); // Initial count set to 1
61 
62  // Instantiate component managers
63  m_managers[IService::interfaceID().id()] = new ServiceManager( this );
64 
66 
67  // Instantiate internal services
68  // SvcLocator/Factory HAS to be already instantiated
69  m_classManager = new DLLClassManager( this );
70 
71  AlgorithmManager* algMgr = new AlgorithmManager( this );
72  m_managers[IAlgorithm::interfaceID().id()] = algMgr;
73  // m_managers[IAlgorithm::interfaceID().id()] = new HiveAlgorithmManager(this);
74 
75  // This property is not hosted in the ApplicationMgr instance
76  declareProperty( "AlgTypeAliases", algMgr->typeAliases(),
77  "Aliases of algorithm types, to replace an algorithm type for every instance" );
78 
79  // ServiceMgr Initialization loop checking
81 
82  m_svcMapping = {"EvtDataSvc/EventDataSvc",
83  "DetDataSvc/DetectorDataSvc",
84  "HistogramSvc/HistogramDataSvc",
85  "HbookCnv::PersSvc/HbookHistSvc",
86  "RootHistCnv::PersSvc/RootHistSvc",
87  "EvtPersistencySvc/EventPersistencySvc",
88  "DetPersistencySvc/DetectorPersistencySvc",
89  "HistogramPersistencySvc/HistogramPersistencySvc"};
90 }
The ServiceManager class is in charge of the creation of concrete instances of Services.
The AlgorithmManager class is in charge of the creation of concrete instances of Algorithms.
ManagersMap m_managers
Map of known component managers.
AlgTypeAliasesMap & typeAliases()
SmartIF< ISvcManager > & svcManager()
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
Gaudi::Property< std::vector< std::string > > m_svcMapping
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
virtual void setLoopCheckEnabled(bool en=true)=0
Set the value of the initialization loop check flag.
Gaudi::Property< bool > m_loopCheck

Member Function Documentation

◆ algManager()

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

Definition at line 142 of file ApplicationMgr.h.

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

◆ configure()

StatusCode ApplicationMgr::configure ( )
override

Definition at line 231 of file ApplicationMgr.cpp.

231  {
232 
233  // Check if the state is compatible with the transition
234  MsgStream tlog( m_messageSvc, name() );
236  tlog << MSG::INFO << "Already Configured" << endmsg;
237  return StatusCode::SUCCESS;
238  }
240  tlog << MSG::FATAL << "configure: Invalid state \"" << m_state << "\"" << endmsg;
241  return StatusCode::FAILURE;
242  }
244 
245  // Reset application return code.
247 
248  StatusCode sc;
249  sc = i_startup();
250  if ( !sc.isSuccess() ) { return sc; }
251 
252  {
254  // Get my own options using the Job options service
255  if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Getting my own properties" << endmsg;
256  sc = m_jobOptionsSvc->setMyProperties( name(), this );
257  if ( !sc.isSuccess() ) {
258  log << MSG::WARNING << "Problems getting my properties from JobOptionsSvc" << endmsg;
259  return sc;
260  }
261  }
262 
263  // Make sure that the OutputLevel is in sync
266 
267  // Check current outputLevel to eventually inform the MessageSvc
268  if ( m_outputLevel != MSG::NIL && !m_appName.empty() ) {
269  // Print a welcome message
271  << "=================================================================="
272  << "==================================================================" << std::endl
273  << " "
274  << " Welcome to " << m_appName.value();
275 
276  if ( !m_appVersion.empty() ) {
277  log << MSG::ALWAYS << " version " << m_appVersion.value();
278  } else {
279  log << MSG::ALWAYS << " (GaudiCoreSvc "
280  << "v" << GAUDICORESVC_MAJOR_VERSION << "r" << GAUDICORESVC_MINOR_VERSION
281 #if GAUDICORESVC_PATCH_VERSION
282  << "p" << GAUDICORESVC_PATCH_VERSION
283 #endif
284  << ")";
285  }
286 
287  // Add the host name and current time to the message
289  << " "
290  << " running on " << System::hostName() << " on " << Gaudi::Time::current().format( true ) << std::endl
291  << "=================================================================="
292  << "==================================================================" << endmsg;
293  }
294 
295  // print all own properties if the options "PropertiesPrint" is set to true
296  if ( m_propertiesPrint ) {
297  const auto& properties = getProperties();
298  log << MSG::ALWAYS << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
299  << " #properties = " << properties.size() << endmsg;
300  for ( const auto& property : properties ) { log << "Property ['Name': Value] = " << *property << endmsg; }
301  }
302 
303  // Check if StatusCode need to be checked
304  if ( m_codeCheck ) {
306  sc = svcManager()->addService( "StatusCodeSvc", -9999 );
307  if ( sc.isFailure() ) {
308  log << MSG::FATAL << "Error adding StatusCodeSvc" << endmsg;
309  return StatusCode::FAILURE;
310  } else {
311  ON_VERBOSE
312  log << MSG::VERBOSE << "added service StatusCodeSvc" << endmsg;
313  }
314  } else {
316  }
317 
318  // set the requested environment variables
319  for ( auto& var : m_environment ) {
320  const std::string& name = var.first;
321  const std::string& value = var.second;
323  const MSG::Level lvl = ( !old.empty() && ( old != "UNKNOWN" ) ) ? MSG::WARNING : MSG::DEBUG;
324  if ( UNLIKELY( m_outputLevel <= lvl ) ) log << lvl << "Setting " << name << " = " << value << endmsg;
325  System::setEnv( name, value );
326  }
327 
328  // Declare Service Types
329  for ( auto& j : m_svcMapping ) {
331  if ( svcManager()->declareSvcType( itm.name(), itm.type() ).isFailure() ) {
332  log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
333  return StatusCode::FAILURE;
334  } else {
335  ON_VERBOSE
336  log << MSG::VERBOSE << "declared service " << j << endmsg;
337  }
338  }
339  for ( auto& j : m_svcOptMapping ) {
341  if ( svcManager()->declareSvcType( itm.name(), itm.type() ).isFailure() ) {
342  log << MSG::ERROR << "declaring svc type:'" << j << "' failed." << endmsg;
343  return StatusCode::FAILURE;
344  }
345  }
346 
347  //--------------------------------------------------------------------------
348  // Declare other Services and Algorithms by loading DLL's
349  sc = decodeDllNameList();
350  if ( sc.isFailure() ) {
351  log << MSG::ERROR << "Failure loading declared DLL's" << endmsg;
352  return sc;
353  }
354 
355  //--------------------------------------------------------------------------
356  // Deal with the services explicitly declared by the user.
357  sc = decodeExtSvcNameList();
358  if ( sc.isFailure() ) {
359  log << MSG::ERROR << "Failure during external service association" << endmsg;
360  return sc;
361  }
362 
364  if ( sc.isFailure() ) {
365  log << MSG::ERROR << "Failure during external service creation" << endmsg;
366  return sc;
367  }
368 
369  //--------------------------------------------------------------------------
370  // Retrieve intrinsic services. If needed configure them.
371  //--------------------------------------------------------------------------
372  const Gaudi::Utils::TypeNameString evtloop_item( m_eventLoopMgr );
373  sc = svcManager()->addService( evtloop_item, ServiceManager::DEFAULT_SVC_PRIORITY * 10 );
374  if ( !sc.isSuccess() ) {
375  log << MSG::FATAL << "Error adding :" << m_eventLoopMgr << endmsg;
376  return sc;
377  } else {
378  ON_VERBOSE
379  log << MSG::VERBOSE << "added service " << evtloop_item << endmsg;
380  }
381 
383  if ( !m_runable ) {
384  log << MSG::FATAL << "Error retrieving Runable: " << m_runableType.value() << "\n Check option ApplicationMgr."
385  << m_runableType.name() << endmsg;
386  return sc;
387  }
388  m_processingMgr = m_svcLocator->service( evtloop_item );
389  if ( !m_processingMgr ) {
390  log << MSG::FATAL << "Error retrieving Processing manager: " << m_eventLoopMgr.value()
391  << "\n Check option ApplicationMgr." << m_eventLoopMgr.name() << "\n No events will be processed." << endmsg;
392  return sc;
393  }
394  // The IEventProcessor might also be an IQueueingEventProcessor
396 
397  // Establish Update Handlers for ExtSvc and DLLs Properties
398  m_extSvcNameList.declareUpdateHandler( &ApplicationMgr::extSvcNameListHandler, this );
399  m_createSvcNameList.declareUpdateHandler( &ApplicationMgr::createSvcNameListHandler, this );
400  m_dllNameList.declareUpdateHandler( &ApplicationMgr::dllNameListHandler, this );
401 
402  if ( m_actHistory ) {
403  // Create HistorySvc with a priority to ensure it's initialized last, finalized first
404  sc = svcManager()->addService( "HistorySvc", std::numeric_limits<int>::max() );
405  if ( sc.isFailure() ) {
406  log << MSG::FATAL << "Error adding HistorySvc" << endmsg;
407  return StatusCode::FAILURE;
408  }
409  }
410 
411  log << MSG::INFO << "Application Manager Configured successfully" << endmsg;
413  return StatusCode::SUCCESS;
414 }
Gaudi::StateMachine::State m_targetState
Internal State.
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:379
#define UNLIKELY(x)
Definition: Kernel.h:106
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
Gaudi::Property< bool > m_propertiesPrint
T empty(T... args)
StatusCode decodeDllNameList()
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
GAUDI_API int setEnv(const std::string &name, const std::string &value, int overwrite=1)
Set an environment variables.
Definition: System.cpp:492
Gaudi::Property< bool > m_codeCheck
SmartIF< IRunable > m_runable
Reference to the runable object.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:308
T endl(T... args)
static Time current()
Returns the current time.
Definition: Time.cpp:119
Gaudi::Property< std::map< std::string, std::string > > m_environment
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::Property< std::string > m_appVersion
static GAUDI_API void enableChecking()
Definition: StatusCode.cpp:53
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
void createSvcNameListHandler(Gaudi::Details::PropertyBase &)
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
SmartIF< ISvcManager > & svcManager()
Gaudi::Property< std::string > m_eventLoopMgr
STL class.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:86
Gaudi::Property< int > m_outputLevel
Helper class to parse a string of format "type/name".
void extSvcNameListHandler(Gaudi::Details::PropertyBase &theProp)
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
virtual StatusCode setMyProperties(const std::string &client, IProperty *me)=0
Override default properties of the calling client.
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
void dllNameListHandler(Gaudi::Details::PropertyBase &theProp)
Gaudi::Property< std::string > m_runableType
bool isSuccess() const
Definition: StatusCode.h:365
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
Gaudi::Property< std::vector< std::string > > m_svcMapping
Gaudi::Property< std::vector< std::string > > m_dllNameList
Gaudi::Property< bool > m_actHistory
StatusCode decodeExtSvcNameList()
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:313
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:262
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
StatusCode decodeCreateSvcNameList()
T c_str(T... args)
constexpr static const auto FAILURE
Definition: StatusCode.h:101
StatusCode i_startup()
Internal startup routine.
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:55
#define ON_VERBOSE
Gaudi::StateMachine::State m_state
Internal State.
bool isFailure() const
Definition: StatusCode.h:145
Gaudi::Property< std::string > m_appName
constexpr int Success
Definition: AppReturnCode.h:26
SmartIF< IQueueingEventProcessor > m_queueingProcessor
Reference to a queueing processing manager object.
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.

◆ createEventContext()

EventContext ApplicationMgr::createEventContext ( )
override

implementation of IEventProcessor::createEventContext()

Definition at line 819 of file ApplicationMgr.cpp.

819  {
822  }
824  ss << "createEventContext: Invalid state \"" << FSMState() << '"';
825  throw GaudiException( ss.str(), name(), StatusCode::FAILURE );
826 }
Define general base for Gaudi exception.
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
T str(T... args)
virtual EventContext createEventContext()=0
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
Gaudi::StateMachine::State FSMState() const override
const std::string & name() const override

◆ createSvcNameListHandler()

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

Definition at line 925 of file ApplicationMgr.cpp.

925  {
926  if ( !( decodeCreateSvcNameList() ).isSuccess() ) {
927  throw GaudiException( "Failed to create ext services", "MinimalEventLoopMgr::createSvcNameListHandler",
929  }
930 }
Define general base for Gaudi exception.
StatusCode decodeCreateSvcNameList()
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ decodeCreateSvcNameList()

StatusCode ApplicationMgr::decodeCreateSvcNameList ( )

Definition at line 934 of file ApplicationMgr.cpp.

934  {
936  const auto& theNames = m_createSvcNameList.value();
937  auto it = theNames.begin();
938  auto et = theNames.end();
939  while ( result.isSuccess() && it != et ) {
940  Gaudi::Utils::TypeNameString item( *it++ );
941  if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
943  log << MSG::ERROR << "decodeCreateSvcNameList: Cannot create service " << item.type() << "/" << item.name()
944  << endmsg;
945  } else {
946  ON_DEBUG {
948  log << MSG::DEBUG << "decodeCreateSvcNameList: Created service " << item.type() << "/" << item.name() << endmsg;
949  }
950  }
951  }
952  return result;
953 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< ISvcManager > & svcManager()
Helper class to parse a string of format "type/name".
#define ON_DEBUG
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool isSuccess() const
Definition: StatusCode.h:365
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
std::string m_name
Name.
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ decodeDllNameList()

StatusCode ApplicationMgr::decodeDllNameList ( )

Definition at line 1006 of file ApplicationMgr.cpp.

1006  {
1007 
1010 
1011  // Clean up multiple entries from DLL list
1012  // -------------------------------------------------------------------------
1013  std::vector<std::string> newList;
1014  std::map<std::string, unsigned int> dllInList, duplicateList;
1015  {
1016  for ( const auto it : m_dllNameList ) {
1017  if ( 0 == dllInList[it] ) {
1018  newList.push_back( it ); // first instance of this module
1019  } else {
1020  ++duplicateList[it];
1021  } // module listed multiple times
1022  ++dllInList[it]; // increment count for this module
1023  }
1024  }
1025  // m_dllNameList = newList; // update primary list to new, filtered list (do not use the
1026  // property itself otherwise we get called again infinitely)
1027  // List modules that were in there twice..
1028  ON_DEBUG if ( !duplicateList.empty() ) {
1029  log << MSG::DEBUG << "Removed duplicate entries for modules : ";
1030  for ( auto it = duplicateList.begin(); it != duplicateList.end(); ++it ) {
1031  log << it->first << "(" << 1 + it->second << ")";
1032  if ( it != --duplicateList.end() ) log << ", ";
1033  }
1034  log << endmsg;
1035  }
1036  // -------------------------------------------------------------------------
1037 
1038  const std::vector<std::string>& theNames = newList;
1039 
1040  // only load the new dlls or previously failed dlls
1041  ON_DEBUG log << MSG::DEBUG << "Loading declared DLL's" << endmsg;
1042 
1043  std::vector<std::string> successNames, failNames;
1044  for ( const auto& it : theNames ) {
1045  if ( std::find( m_okDlls.rbegin(), m_okDlls.rend(), it ) == m_okDlls.rend() ) {
1046  // found a new module name
1047  StatusCode status = m_classManager->loadModule( it );
1048  if ( status.isFailure() ) {
1049  failNames.push_back( it );
1050  result = StatusCode::FAILURE;
1051  } else {
1052  successNames.push_back( it );
1053  }
1054  }
1055  }
1056 
1057  // report back to the user and store the names of the succesfully loaded dlls
1058  if ( !successNames.empty() ) {
1059  log << MSG::INFO << "Successfully loaded modules : ";
1060  for ( auto it = successNames.begin(); it != successNames.end(); it++ ) {
1061  log << ( *it );
1062  if ( ( it + 1 ) != successNames.end() ) log << ", ";
1063  // save name
1064  m_okDlls.push_back( *it );
1065  }
1066  log << endmsg;
1067  }
1068 
1069  if ( result == StatusCode::FAILURE ) {
1070  log << MSG::WARNING << "Failed to load modules: ";
1071  for ( auto it = failNames.begin(); it != failNames.end(); it++ ) {
1072  log << ( *it );
1073  if ( ( it + 1 ) != failNames.end() ) log << ", ";
1074  }
1075  log << endmsg;
1076  }
1077  return result;
1078 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
T empty(T... args)
StatusCode loadModule(const std::string &module, bool fireIncident=true) override
T rend(T... args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
T end(T... args)
std::vector< std::string > m_okDlls
names of successfully loaded dlls
T push_back(T... args)
#define ON_DEBUG
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
Gaudi::Property< std::vector< std::string > > m_dllNameList
T find(T... args)
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
T begin(T... args)
constexpr static const auto FAILURE
Definition: StatusCode.h:101
std::string m_name
Name.
bool isFailure() const
Definition: StatusCode.h:145
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
T rbegin(T... args)

◆ decodeExtSvcNameList()

StatusCode ApplicationMgr::decodeExtSvcNameList ( )

Definition at line 968 of file ApplicationMgr.cpp.

968  {
970 
971  const auto& theNames = m_extSvcNameList.value();
972 
973  auto it = theNames.begin();
974  auto et = theNames.end();
975  while ( result.isSuccess() && it != et ) {
976  Gaudi::Utils::TypeNameString item( *it++ );
977  if ( m_extSvcCreates ) {
978  if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
980  log << MSG::ERROR << "decodeExtSvcNameList: Cannot create service " << item.type() << "/" << item.name()
981  << endmsg;
982  }
983  } else {
984  if ( ( result = svcManager()->declareSvcType( item.name(), item.type() ) ).isFailure() ) {
986  log << MSG::ERROR << "decodeExtSvcNameList: Cannot declare service " << item.type() << "/" << item.name()
987  << endmsg;
988  }
989  }
990  }
991  return result;
992 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< ISvcManager > & svcManager()
Helper class to parse a string of format "type/name".
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
bool isSuccess() const
Definition: StatusCode.h:365
Gaudi::Property< bool > m_extSvcCreates
std::string m_name
Name.
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ dllNameListHandler()

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

Definition at line 997 of file ApplicationMgr.cpp.

997  {
998  if ( !( decodeDllNameList() ).isSuccess() ) {
999  throw GaudiException( "Failed to load DLLs.", "MinimalEventLoopMgr::dllNameListHandler", StatusCode::FAILURE );
1000  }
1001 }
Define general base for Gaudi exception.
StatusCode decodeDllNameList()
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ empty()

bool ApplicationMgr::empty ( ) const
override

Definition at line 811 of file ApplicationMgr.cpp.

811  {
813 }
static auto i_delegateToEvtProc(SELF *self, PIMPL &member, std::string_view method_name, METHOD &&method, ARGS &&... args)
Helper to delegate calls to event processor implementation.
virtual bool empty() const =0
Tell if the processor has events in the queues.
SmartIF< IQueueingEventProcessor > m_queueingProcessor
Reference to a queueing processing manager object.

◆ evtLoopPropertyHandler()

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

Definition at line 915 of file ApplicationMgr.cpp.

915  {
916  if ( m_processingMgr ) {
917  auto props = m_processingMgr.as<IProperty>();
918  if ( props ) props->setProperty( p ).ignore();
919  }
920 }
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:117
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:30

◆ executeEvent()

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

implementation of IEventProcessor::executeEvent(void*)

Definition at line 797 of file ApplicationMgr.cpp.

797  {
799  if ( m_processingMgr ) { return m_processingMgr->executeEvent( std::move( ctx ) ); }
800  }
802  log << MSG::FATAL << "executeEvent: Invalid state \"" << FSMState() << "\"" << endmsg;
803  return StatusCode::FAILURE;
804 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
virtual StatusCode executeEvent(EventContext &&ctx)=0
Process single event.
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
T move(T... args)
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
Gaudi::StateMachine::State FSMState() const override
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ executeRun()

StatusCode ApplicationMgr::executeRun ( int  evtmax)
override

implementation of IEventProcessor::executeRun(int)

Definition at line 830 of file ApplicationMgr.cpp.

830  {
833  if ( m_processingMgr ) { return m_processingMgr->executeRun( evtmax ); }
834  log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
835  return StatusCode::SUCCESS;
836  }
837  log << MSG::FATAL << "executeRun: Invalid state \"" << FSMState() << "\"" << endmsg;
838  return StatusCode::FAILURE;
839 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
Gaudi::StateMachine::State FSMState() const override
virtual StatusCode executeRun(int maxevt)=0
Process the maxevt events as a Run.
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ extSvcNameListHandler()

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

Definition at line 958 of file ApplicationMgr.cpp.

958  {
959  if ( !( decodeExtSvcNameList() ).isSuccess() ) {
960  throw GaudiException( "Failed to declare ext services", "MinimalEventLoopMgr::extSvcNameListHandler",
962  }
963 }
Define general base for Gaudi exception.
StatusCode decodeExtSvcNameList()
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ finalize()

StatusCode ApplicationMgr::finalize ( )
override

Definition at line 582 of file ApplicationMgr.cpp.

582  {
585  log << MSG::INFO << "Already Finalized" << endmsg;
586  return StatusCode::SUCCESS;
587  }
589  log << MSG::FATAL << "finalize: Invalid state \"" << m_state << "\"" << endmsg;
590  return StatusCode::FAILURE;
591  }
593 
594  // disable message suppression in finalize
595  m_svcLocator->service<IProperty>( "MessageSvc" )
596  ->setProperty( Gaudi::Property<bool>( "enableSuppression", false ) )
597  .ignore();
598 
599  // Finalize independently managed Algorithms
600  StatusCode sc = algManager()->finalize();
601  if ( sc.isFailure() ) {
602  log << MSG::WARNING << "Failed to finalize an algorithm." << endmsg;
604  }
605 
606  // Finalize all Services
607  sc = svcManager()->finalize();
608  if ( sc.isFailure() ) {
609  log << MSG::WARNING << "Failed to finalize a service." << endmsg;
611  }
612 
613  // svcManager()->removeService( (IService*) m_processingMgr.get() );
614  // svcManager()->removeService( (IService*) m_runable.get() );
615 
617 
618  if ( sc.isSuccess() ) {
619  log << MSG::INFO << "Application Manager Finalized successfully" << endmsg;
620  } else {
621  log << MSG::ERROR << "Application Manager failed to finalize" << endmsg;
622  }
623 
625  return sc;
626 }
Gaudi::StateMachine::State m_targetState
Internal State.
constexpr int FinalizationFailure
Error codes for operation failures.
Definition: AppReturnCode.h:42
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Gaudi::Property< bool > m_codeCheck
Implementation of property with value of concrete type.
Definition: Property.h:370
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< ISvcManager > & svcManager()
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:86
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool isSuccess() const
Definition: StatusCode.h:365
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).
constexpr static const auto FAILURE
Definition: StatusCode.h:101
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:55
Gaudi::StateMachine::State m_state
Internal State.
bool isFailure() const
Definition: StatusCode.h:145
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:30
SmartIF< IAlgManager > & algManager()
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ FSMState()

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

Definition at line 858 of file ApplicationMgr.cpp.

858 { return m_state; }
Gaudi::StateMachine::State m_state
Internal State.

◆ getManager()

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

Definition at line 132 of file ApplicationMgr.h.

132  {
133  return m_managers[I::interfaceID().id()];
134  }
ManagersMap m_managers
Map of known component managers.

◆ GoToState()

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

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

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

Definition at line 685 of file ApplicationMgr.cpp.

685  {
687 
688  switch ( state ) {
689 
691  switch ( m_state ) {
693  return StatusCode::SUCCESS;
694  break;
696  return terminate();
697  break;
698  default: // Gaudi::StateMachine::INITIALIZED or Gaudi::StateMachine::RUNNING
700  if ( sc.isSuccess() ) { return terminate(); }
701  break;
702  }
703  break;
704 
706  switch ( m_state ) {
708  return StatusCode::SUCCESS;
709  break;
711  return configure();
712  break;
714  return finalize();
715  break;
716  default: // Gaudi::StateMachine::RUNNING
718  if ( sc.isSuccess() ) { return finalize(); }
719  break;
720  }
721  break;
722 
724  switch ( m_state ) {
726  return StatusCode::SUCCESS;
727  break;
729  return initialize();
730  break;
732  return stop();
733  break;
734  default: // Gaudi::StateMachine::OFFLINE
736  if ( sc.isSuccess() ) { return initialize(); }
737  break;
738  }
739  break;
740 
742  switch ( m_state ) {
744  return StatusCode::SUCCESS;
745  break;
747  return start();
748  break;
749  default: // Gaudi::StateMachine::OFFLINE or Gaudi::StateMachine::CONFIGURED
751  if ( sc.isSuccess() ) { return start(); }
752  break;
753  }
754  break;
755  }
756 
757  // If I get here, there has been a problem in the recursion
758 
759  if ( ignoreFailures ) {
760  // force the new state
761  m_state = state;
762  return StatusCode::SUCCESS;
763  }
764 
765  return sc;
766 }
StatusCode initialize() override
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
StatusCode terminate() override
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
bool isSuccess() const
Definition: StatusCode.h:365
StatusCode finalize() override
StatusCode start() override
StatusCode configure() override
StatusCode stop() override
Gaudi::StateMachine::State m_state
Internal State.

◆ i_delegateToEvtProc()

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

Helper to delegate calls to event processor implementation.

Definition at line 315 of file ApplicationMgr.h.

316  {
317  if ( LIKELY( self->m_state == Gaudi::StateMachine::RUNNING ) ) {
318  if ( LIKELY( bool( member ) ) ) {
319  return std::invoke( method, *member.get(), std::forward<ARGS>( args )... );
320  } else {
322  s << method_name << ": event processor is not a \""
323  << System::typeinfoName( typeid( decltype( *member.get() ) ) ) << '"';
324  throw GaudiException{s.str(), self->name(), StatusCode::FAILURE};
325  }
326  }
328  s << method_name << ": Invalid state \"" << self->FSMState() << '"';
329  throw GaudiException{s.str(), self->name(), StatusCode::FAILURE};
330  }
Define general base for Gaudi exception.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:308
#define LIKELY(x)
Definition: Kernel.h:105
string s
Definition: gaudirun.py:328
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ i_startup()

StatusCode ApplicationMgr::i_startup ( )
protected

Internal startup routine.

Definition at line 121 of file ApplicationMgr.cpp.

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

◆ initialize()

StatusCode ApplicationMgr::initialize ( )
override

Definition at line 419 of file ApplicationMgr.cpp.

419  {
420  StatusCode sc;
421 
423 
424  // Make sure output level caches are up to date.
426 
427  // I cannot add these services in configure() because they are coming from GaudiUtils
428  // and it messes up genconf when rebuilding it.
429  if ( m_stopOnSignal ) {
430  // Instantiate the service that schedules a stop when a signal is received
431  std::string svcname( "Gaudi::Utils::StopSignalHandler" );
432  sc = svcManager()->addService( svcname );
433  if ( sc.isFailure() ) {
434  log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
435  }
436  }
437 
438  if ( m_stalledEventMonitoring ) {
439  // Instantiate the service that schedules a stop when a signal is received
440  std::string svcname( "StalledEventMonitor" );
441  sc = svcManager()->addService( svcname );
442  if ( sc.isFailure() ) {
443  log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
444  }
445  }
446 
448  log << MSG::INFO << "Already Initialized!" << endmsg;
449  return StatusCode::SUCCESS;
450  }
452  log << MSG::FATAL << "initialize: Invalid state \"" << m_state << "\"" << endmsg;
453  return StatusCode::FAILURE;
454  }
456 
457  //--------------------------------------------------------------------------
458  // Initialize the list of top Services
459  //--------------------------------------------------------------------------
460  sc = svcManager()->initialize();
461  if ( !sc.isSuccess() ) return sc;
462 
463  sc = algManager()->initialize();
464  if ( !sc.isSuccess() ) return sc;
465 
466  //--------------------------------------------------------------------------
467  // Final steps: Inform user and change internal state
468  //--------------------------------------------------------------------------
469  log << MSG::INFO << "Application Manager Initialized successfully" << endmsg;
471 
473 
474  return sc;
475 }
Gaudi::StateMachine::State m_targetState
Internal State.
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
Gaudi::Property< bool > m_printAlgsSequence
Gaudi::Property< bool > m_stopOnSignal
Property to enable/disable the "stop on signal" service.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
SmartIF< ISvcManager > & svcManager()
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
Gaudi::Property< bool > m_stalledEventMonitoring
Property to enable/disable the monitoring and reporting of stalled events.
bool isSuccess() const
Definition: StatusCode.h:365
virtual StatusCode initialize()=0
Initialization (from CONFIGURED to INITIALIZED).
void printAlgsSequences()
Print the sequence of algorithms that have been loaded.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
bool isFailure() const
Definition: StatusCode.h:145
SmartIF< IAlgManager > & algManager()
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ name()

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

Definition at line 855 of file ApplicationMgr.cpp.

855 { return m_name; }
std::string m_name
Name.

◆ nextEvent()

StatusCode ApplicationMgr::nextEvent ( int  maxevt)
override

Definition at line 522 of file ApplicationMgr.cpp.

522  {
525  log << MSG::FATAL << "nextEvent: Invalid state \"" << m_state << "\"" << endmsg;
526  return StatusCode::FAILURE;
527  }
528  if ( !m_processingMgr ) {
530  log << MSG::FATAL << "No event processing manager specified. Check option: " << m_eventLoopMgr.name() << endmsg;
531  return StatusCode::FAILURE;
532  }
533  return m_processingMgr->nextEvent( maxevt );
534 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Gaudi::Property< std::string > m_eventLoopMgr
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
int maxevt
Definition: Bootstrap.cpp:270
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ outputLevelUpdate()

void ApplicationMgr::outputLevelUpdate ( )
override

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

Definition at line 1080 of file ApplicationMgr.cpp.

1080  {
1081  resetMessaging();
1082  for ( auto& mgrItem : m_managers ) { mgrItem.second->outputLevelUpdate(); }
1083 }
ManagersMap m_managers
Map of known component managers.

◆ pluginDebugPropertyHandler()

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

◆ pop()

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

Definition at line 815 of file ApplicationMgr.cpp.

815  {
817 }
static auto i_delegateToEvtProc(SELF *self, PIMPL &member, std::string_view method_name, METHOD &&method, ARGS &&... args)
Helper to delegate calls to event processor implementation.
virtual std::optional< ResultType > pop()=0
Get the next available result.
SmartIF< IQueueingEventProcessor > m_queueingProcessor
Reference to a queueing processing manager object.

◆ printAlgsSequences()

void ApplicationMgr::printAlgsSequences ( )

Print the sequence of algorithms that have been loaded.

Definition at line 1106 of file ApplicationMgr.cpp.

1106  {
1108  log << MSG::ALWAYS << "****************************** Algorithm Sequence ****************************" << endmsg;
1109  for ( auto& algname : m_topAlgNameList ) { printAlgsSequencesHelper( algManager(), algname, log, 0 ); }
1110  log << MSG::ALWAYS << "******************************************************************************" << endmsg;
1111 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
Gaudi::Property< std::vector< std::string > > m_topAlgNameList
std::string m_name
Name.
SmartIF< IAlgManager > & algManager()
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ push()

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

Definition at line 806 of file ApplicationMgr.cpp.

806  {
808  std::move( ctx ) );
809 }
static auto i_delegateToEvtProc(SELF *self, PIMPL &member, std::string_view method_name, METHOD &&method, ARGS &&... args)
Helper to delegate calls to event processor implementation.
T move(T... args)
virtual void push(EventContext &&ctx)=0
Schedule the processing of an event.
SmartIF< IQueueingEventProcessor > m_queueingProcessor
Reference to a queueing processing manager object.

◆ queryInterface()

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

Definition at line 95 of file ApplicationMgr.cpp.

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

◆ reinitialize()

StatusCode ApplicationMgr::reinitialize ( )
override

Definition at line 865 of file ApplicationMgr.cpp.

865  {
868  StatusCode sc;
870  throw GaudiException( "Cannot reinitialize application if not INITIALIZED or RUNNING",
871  "ApplicationMgr::reinitialize", StatusCode::FAILURE );
872  }
874  sc = svcManager()->reinitialize();
875  if ( sc.isFailure() ) retval = sc;
876  sc = algManager()->reinitialize();
877  if ( sc.isFailure() ) retval = sc;
878 
880  if ( sc.isFailure() ) retval = sc;
882  if ( sc.isFailure() ) retval = sc;
883 
884  log << MSG::INFO << "Application Manager Reinitialized successfully" << endmsg;
885 
886  return retval;
887 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
Define general base for Gaudi exception.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:117
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
SmartIF< ISvcManager > & svcManager()
StatusCode sysReinitialize() override
virtual StatusCode reinitialize()=0
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
General service interface definition.
Definition: IService.h:28
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
bool isFailure() const
Definition: StatusCode.h:145
SmartIF< IAlgManager > & algManager()
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ restart()

StatusCode ApplicationMgr::restart ( )
override

Definition at line 892 of file ApplicationMgr.cpp.

892  {
894  StatusCode sc;
896  throw GaudiException( "Cannot restart application if not RUNNING", "ApplicationMgr::restart", StatusCode::FAILURE );
897  }
898 
899  sc = svcManager()->restart();
900  if ( sc.isFailure() ) retval = sc;
901  sc = algManager()->restart();
902  if ( sc.isFailure() ) retval = sc;
903 
904  sc = m_messageSvc.as<IService>()->sysRestart();
905  if ( sc.isFailure() ) retval = sc;
907  if ( sc.isFailure() ) retval = sc;
908 
909  return retval;
910 }
Define general base for Gaudi exception.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:117
StatusCode sysRestart() override
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
SmartIF< ISvcManager > & svcManager()
General service interface definition.
Definition: IService.h:28
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
virtual StatusCode restart()=0
Initialization (from RUNNING to RUNNING, via INITIALIZED).
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
bool isFailure() const
Definition: StatusCode.h:145
SmartIF< IAlgManager > & algManager()
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.

◆ run()

StatusCode ApplicationMgr::run ( )
override

Definition at line 771 of file ApplicationMgr.cpp.

771  {
773 
775  if ( sc.isSuccess() ) {
777  if ( m_runable != 0 ) { // loop over the events
778  sc = m_runable->run();
779  if ( !sc.isSuccess() ) { log << MSG::FATAL << "Application execution failed. Ending the job." << endmsg; }
780  } else {
781  log << MSG::FATAL << "Application has no runable object. Check option:" << m_runableType.name() << endmsg;
782  }
783  }
784  if ( sc.isSuccess() ) { // try to close cleanly
786  }
787  // either the runable failed of the stut-down
788  if ( sc.isFailure() ) { // try to close anyway (but keep the StatusCode unchanged)
790  }
791  return sc;
792 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
virtual StatusCode run()=0
Run the class implementation.
SmartIF< IRunable > m_runable
Reference to the runable object.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
Gaudi::Property< std::string > m_runableType
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
bool isSuccess() const
Definition: StatusCode.h:365
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
bool isFailure() const
Definition: StatusCode.h:145
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ serviceLocator()

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

Needed to locate the message service.

Definition at line 149 of file ApplicationMgr.h.

149 { return m_svcLocator; }
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)

◆ setServiceManager()

void ApplicationMgr::setServiceManager ( ISvcManager )
inlineoverrideprotected

Definition at line 159 of file ApplicationMgr.h.

159 {}

◆ start()

StatusCode ApplicationMgr::start ( )
override

Definition at line 480 of file ApplicationMgr.cpp.

480  {
481 
483  StatusCode sc;
484 
486  log << MSG::INFO << "Already Initialized!" << endmsg;
487  return StatusCode::SUCCESS;
488  }
490  log << MSG::FATAL << "start: Invalid state \"" << m_state << "\"" << endmsg;
491  return StatusCode::FAILURE;
492  }
494 
495  //--------------------------------------------------------------------------
496  // Initialize the list of top Services
497  //--------------------------------------------------------------------------
498  sc = m_jobOptionsSvc.as<IService>()->sysStart();
499  if ( !sc.isSuccess() ) return sc;
500 
501  sc = m_messageSvc.as<IService>()->sysStart();
502  if ( !sc.isSuccess() ) return sc;
503 
504  sc = svcManager()->start();
505  if ( !sc.isSuccess() ) return sc;
506 
507  sc = algManager()->start();
508  if ( !sc.isSuccess() ) return sc;
509 
510  //--------------------------------------------------------------------------
511  // Final steps: Inform user and change internal state
512  //--------------------------------------------------------------------------
513  log << MSG::INFO << "Application Manager Started successfully" << endmsg;
515 
516  return sc;
517 }
Gaudi::StateMachine::State m_targetState
Internal State.
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
StatusCode sysStart() override
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:117
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
SmartIF< ISvcManager > & svcManager()
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
General service interface definition.
Definition: IService.h:28
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool isSuccess() const
Definition: StatusCode.h:365
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
SmartIF< IAlgManager > & algManager()
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ stop()

StatusCode ApplicationMgr::stop ( )
override

Definition at line 539 of file ApplicationMgr.cpp.

539  {
540 
542  StatusCode sc;
543 
545  log << MSG::INFO << "Already Initialized!" << endmsg;
546  return StatusCode::SUCCESS;
547  }
549  log << MSG::FATAL << "stop: Invalid state \"" << m_state << "\"" << endmsg;
550  return StatusCode::FAILURE;
551  }
553 
554  // Stop independently managed Algorithms
555  sc = algManager()->stop();
556  if ( !sc.isSuccess() ) return sc;
557 
558  //--------------------------------------------------------------------------
559  // Stop the list of top Services
560  //--------------------------------------------------------------------------
561  sc = svcManager()->stop();
562  if ( !sc.isSuccess() ) return sc;
563 
564  sc = m_messageSvc.as<IService>()->sysStop();
565  if ( !sc.isSuccess() ) return sc;
566 
567  sc = m_jobOptionsSvc.as<IService>()->sysStop();
568  if ( !sc.isSuccess() ) return sc;
569 
570  //--------------------------------------------------------------------------
571  // Final steps: Inform user and change internal state
572  //--------------------------------------------------------------------------
573  log << MSG::INFO << "Application Manager Stopped successfully" << endmsg;
575 
576  return sc;
577 }
Gaudi::StateMachine::State m_targetState
Internal State.
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:117
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
SmartIF< ISvcManager > & svcManager()
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
General service interface definition.
Definition: IService.h:28
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
StatusCode sysStop() override
bool isSuccess() const
Definition: StatusCode.h:365
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
SmartIF< IAlgManager > & algManager()
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ stopRun()

StatusCode ApplicationMgr::stopRun ( )
override

implementation of IEventProcessor::stopRun()

Definition at line 844 of file ApplicationMgr.cpp.

844  {
847  if ( m_processingMgr ) { return m_processingMgr->stopRun(); }
848  log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
849  return StatusCode::SUCCESS;
850  }
851  log << MSG::FATAL << "stopRun: Invalid state \"" << FSMState() << "\"" << endmsg;
852  return StatusCode::FAILURE;
853 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
virtual StatusCode stopRun()=0
Schedule a stop of the current event processing.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
Gaudi::StateMachine::State FSMState() const override
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ svcManager()

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

Definition at line 136 of file ApplicationMgr.h.

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

◆ sysFinalize()

StatusCode ApplicationMgr::sysFinalize ( )
inlineoverride

Definition at line 107 of file ApplicationMgr.h.

107 { return StatusCode::SUCCESS; }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100

◆ sysInitialize()

StatusCode ApplicationMgr::sysInitialize ( )
inlineoverride

Definition at line 101 of file ApplicationMgr.h.

101 { return StatusCode::SUCCESS; }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100

◆ sysReinitialize()

StatusCode ApplicationMgr::sysReinitialize ( )
inlineoverride

Definition at line 109 of file ApplicationMgr.h.

109 { return StatusCode::SUCCESS; }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100

◆ sysRestart()

StatusCode ApplicationMgr::sysRestart ( )
inlineoverride

Definition at line 111 of file ApplicationMgr.h.

111 { return StatusCode::SUCCESS; }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100

◆ sysStart()

StatusCode ApplicationMgr::sysStart ( )
inlineoverride

Definition at line 103 of file ApplicationMgr.h.

103 { return StatusCode::SUCCESS; }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100

◆ sysStop()

StatusCode ApplicationMgr::sysStop ( )
inlineoverride

Definition at line 105 of file ApplicationMgr.h.

105 { return StatusCode::SUCCESS; }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100

◆ targetFSMState()

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

Definition at line 860 of file ApplicationMgr.cpp.

860 { return m_targetState; }
Gaudi::StateMachine::State m_targetState
Internal State.

◆ terminate()

StatusCode ApplicationMgr::terminate ( )
override

Definition at line 631 of file ApplicationMgr.cpp.

631  {
633 
635  log << MSG::INFO << "Already Offline" << endmsg;
636  return StatusCode::SUCCESS;
637  }
639  log << MSG::FATAL << "terminate: Invalid state \"" << m_state << "\"" << endmsg;
640  return StatusCode::FAILURE;
641  }
642  // release all Services
644 
645  if ( m_returnCode.value() == Gaudi::ReturnCode::Success ) {
646  log << MSG::INFO << "Application Manager Terminated successfully" << endmsg;
647  } else if ( m_returnCode.value() == Gaudi::ReturnCode::ScheduledStop ) {
648  log << MSG::INFO << "Application Manager Terminated successfully with a user requested ScheduledStop" << endmsg;
649  } else {
650  log << MSG::ERROR << "Application Manager Terminated with error code " << m_returnCode.value() << endmsg;
651  }
652 
653  { // Force a disable the auditing of finalize for MessageSvc
654  auto prop = m_messageSvc.as<IProperty>();
655  if ( prop ) { prop->setProperty( Gaudi::Property<bool>( "AuditFinalize", false ) ).ignore(); }
656  }
657  { // Force a disable the auditing of finalize for JobOptionsSvc
658  auto prop = m_jobOptionsSvc.as<IProperty>();
659  if ( prop ) { prop->setProperty( Gaudi::Property<bool>( "AuditFinalize", false ) ).ignore(); }
660  }
661 
662  // finalize MessageSvc
663  auto svc = m_messageSvc.as<IService>();
664  if ( !svc ) {
665  log << MSG::ERROR << "Could not get the IService interface of the MessageSvc" << endmsg;
666  } else {
667  svc->sysFinalize().ignore();
668  }
669 
670  // finalize JobOptionsSvc
671  svc = m_jobOptionsSvc.as<IService>();
672  if ( !svc ) {
673  log << MSG::ERROR << "Could not get the IService interface of the JobOptionsSvc" << endmsg;
674  } else {
675  svc->sysFinalize().ignore();
676  }
677 
679  return StatusCode::SUCCESS;
680 }
Gaudi::StateMachine::State m_targetState
Internal State.
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Implementation of property with value of concrete type.
Definition: Property.h:370
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:117
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
constexpr int ScheduledStop
Definition: AppReturnCode.h:35
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
General service interface definition.
Definition: IService.h:28
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::StateMachine::State m_state
Internal State.
constexpr int Success
Definition: AppReturnCode.h:26
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:30
const std::string & name() const override
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

Member Data Documentation

◆ m_actHistory

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

Definition at line 260 of file ApplicationMgr.h.

◆ m_algManager

SmartIF<IAlgManager> ApplicationMgr::m_algManager
protected

Cached pointer to the manager of algorithms.

Definition at line 184 of file ApplicationMgr.h.

◆ m_appName

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

Definition at line 258 of file ApplicationMgr.h.

◆ m_appVersion

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

Definition at line 259 of file ApplicationMgr.h.

◆ m_auditAlgs

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

Definition at line 278 of file ApplicationMgr.h.

◆ m_auditSvcs

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

Definition at line 277 of file ApplicationMgr.h.

◆ m_auditTools

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

Defaults for auditors.

Definition at line 276 of file ApplicationMgr.h.

◆ m_classManager

SmartIF<DLLClassManager> ApplicationMgr::m_classManager
protected

Reference to the class manager.

Definition at line 189 of file ApplicationMgr.h.

◆ m_codeCheck

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

Definition at line 261 of file ApplicationMgr.h.

◆ m_createSvcNameList

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

Definition at line 272 of file ApplicationMgr.h.

◆ m_declaredManagers

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

Property to declare the list of known managers.

Definition at line 178 of file ApplicationMgr.h.

◆ m_dllNameList

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

Definition at line 246 of file ApplicationMgr.h.

◆ m_environment

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

Definition at line 280 of file ApplicationMgr.h.

◆ m_eventLoopMgr

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

Definition at line 254 of file ApplicationMgr.h.

◆ m_evtMax

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

Definition at line 240 of file ApplicationMgr.h.

◆ m_evtsel

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

Definition at line 255 of file ApplicationMgr.h.

◆ m_extSvcCreates

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

Definition at line 243 of file ApplicationMgr.h.

◆ m_extSvcNameList

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

Definition at line 241 of file ApplicationMgr.h.

◆ m_histPersName

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

Definition at line 256 of file ApplicationMgr.h.

◆ m_jobOptionsPath

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

Definition at line 248 of file ApplicationMgr.h.

◆ m_jobOptionsPostAction

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

Definition at line 251 of file ApplicationMgr.h.

◆ m_jobOptionsPreAction

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

Definition at line 249 of file ApplicationMgr.h.

◆ m_jobOptionsSvc

SmartIF<IJobOptionsSvc> ApplicationMgr::m_jobOptionsSvc
protected

Reference to JobOption service.

Definition at line 233 of file ApplicationMgr.h.

◆ m_jobOptionsSvcType

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

Definition at line 219 of file ApplicationMgr.h.

◆ m_jobOptionsType

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

Definition at line 247 of file ApplicationMgr.h.

◆ m_loopCheck

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

Definition at line 283 of file ApplicationMgr.h.

◆ m_managers

ManagersMap ApplicationMgr::m_managers
protected

Map of known component managers.

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

Definition at line 176 of file ApplicationMgr.h.

◆ m_messageSvc

SmartIF<IMessageSvc> ApplicationMgr::m_messageSvc
protected

Reference to the message service.

Definition at line 230 of file ApplicationMgr.h.

◆ m_messageSvcType

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

Definition at line 217 of file ApplicationMgr.h.

◆ m_name

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

Name.

Definition at line 222 of file ApplicationMgr.h.

◆ m_okDlls

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

names of successfully loaded dlls

Definition at line 311 of file ApplicationMgr.h.

◆ m_outputLevel

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

Definition at line 257 of file ApplicationMgr.h.

◆ m_outStreamNameList

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

Definition at line 212 of file ApplicationMgr.h.

◆ m_outStreamType

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

Definition at line 214 of file ApplicationMgr.h.

◆ m_pluginDebugLevel

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

Definition at line 262 of file ApplicationMgr.h.

◆ m_printAlgsSequence

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

Definition at line 304 of file ApplicationMgr.h.

◆ m_processingMgr

SmartIF<IEventProcessor> ApplicationMgr::m_processingMgr
protected

Reference to processing manager object.

Definition at line 232 of file ApplicationMgr.h.

◆ m_propertiesPrint

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

Definition at line 297 of file ApplicationMgr.h.

◆ m_queueingProcessor

SmartIF<IQueueingEventProcessor> ApplicationMgr::m_queueingProcessor
protected

Reference to a queueing processing manager object.

Definition at line 235 of file ApplicationMgr.h.

◆ m_returnCode

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

Property to record the error conditions occurring during the running.

Definition at line 301 of file ApplicationMgr.h.

◆ m_runable

SmartIF<IRunable> ApplicationMgr::m_runable
protected

Reference to the runable object.

Definition at line 231 of file ApplicationMgr.h.

◆ m_runableType

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

Definition at line 253 of file ApplicationMgr.h.

◆ m_SIExit

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

Definition at line 199 of file ApplicationMgr.h.

◆ m_SIGo

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

Definition at line 191 of file ApplicationMgr.h.

◆ m_stalledEventMonitoring

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

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

See also
StalledEventMonitor

Definition at line 294 of file ApplicationMgr.h.

◆ m_state

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

Internal State.

Definition at line 223 of file ApplicationMgr.h.

◆ m_stopOnSignal

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

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

See also
Gaudi::Utils::StopSignalHandler

Definition at line 289 of file ApplicationMgr.h.

◆ m_svcLocator

SmartIF<ISvcLocator> ApplicationMgr::m_svcLocator
mutableprotected

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

Definition at line 187 of file ApplicationMgr.h.

◆ m_svcManager

SmartIF<ISvcManager> ApplicationMgr::m_svcManager
protected

Cached pointer to the manager of services.

Definition at line 181 of file ApplicationMgr.h.

◆ m_svcMapping

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

Definition at line 226 of file ApplicationMgr.h.

◆ m_svcOptMapping

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

Definition at line 227 of file ApplicationMgr.h.

◆ m_targetState

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

Internal State.

Definition at line 224 of file ApplicationMgr.h.

◆ m_topAlgNameList

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

Definition at line 206 of file ApplicationMgr.h.

◆ m_useHiveAlgorithmManager

bool ApplicationMgr::m_useHiveAlgorithmManager
protected

Definition at line 308 of file ApplicationMgr.h.


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