ATLAS Offline Software
SharedEvtQueueProvider.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAMPTOOLS_SHAREDEVTQUEUEPROVIDER_H
6 #define ATHENAMPTOOLS_SHAREDEVTQUEUEPROVIDER_H
7 
8 #include "AthenaMPToolBase.h"
9 #include "GaudiKernel/IIncidentListener.h"
11 
12 class IEventShare;
13 
15  , public IIncidentListener
16 {
17  public:
18  SharedEvtQueueProvider(const std::string& type
19  , const std::string& name
20  , const IInterface* parent);
21 
22  virtual ~SharedEvtQueueProvider() override;
23 
24  // _________IAthenaMPTool_________
25  virtual int makePool ATLAS_NOT_THREAD_SAFE (int maxevt, int nprocs, const std::string& topdir) override;
27 
28  virtual void subProcessLogs(std::vector<std::string>&) override;
30 
31  // _________IIncidentListener___________
32  virtual void handle(const Incident& inc) override;
33 
34  // _____ Actual working horses ________
35  virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> bootstrap_func() override;
36  virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> exec_func() override;
37  virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> fin_func() override;
38 
39  private:
43 
44  // Properties
45  int m_nprocesses; // We use this data member for adding negative numbers at the end of the event queue
46  // We cannot use m_nprocs for this purpose in order to avoid generating Output File Reports by Shared Queue Providers
47  bool m_useSharedReader; // Are we doing the reading?
50  int m_nChunkStart; // The beginning of the current chunk
51  int m_nPositionInChunk; // Position within the current chunk
52 
53 
54  int m_nEvtRequested; // Max event received from AppMgr
55  int m_nEvtCounted; // The number of events this tool has counted itself in the input files
56 
59 
60  // Add next event chunk to the queue
61  void addEventsToQueue();
62 
63 };
64 
65 #endif
SharedEvtQueueProvider::SharedEvtQueueProvider
SharedEvtQueueProvider()
SharedEvtQueueProvider::m_useSharedReader
bool m_useSharedReader
Definition: SharedEvtQueueProvider.h:47
SharedEvtQueueProvider::m_nEvtRequested
int m_nEvtRequested
Definition: SharedEvtQueueProvider.h:54
SharedEvtQueueProvider::m_nChunkStart
int m_nChunkStart
Definition: SharedEvtQueueProvider.h:50
AthenaMPToolBase
Definition: AthenaMPToolBase.h:25
SharedEvtQueueProvider::m_nEventsBeforeFork
int m_nEventsBeforeFork
Definition: SharedEvtQueueProvider.h:48
SharedEvtQueueProvider::m_nChunkSize
int m_nChunkSize
Definition: SharedEvtQueueProvider.h:49
SharedEvtQueueProvider::addEventsToQueue
void addEventsToQueue()
Definition: SharedEvtQueueProvider.cxx:377
SharedEvtQueueProvider::m_sharedEventQueue
AthenaInterprocess::SharedQueue * m_sharedEventQueue
Definition: SharedEvtQueueProvider.h:57
SharedEvtQueueProvider::generateOutputReport
virtual AthenaMP::AllWorkerOutputs_ptr generateOutputReport() override
Definition: SharedEvtQueueProvider.cxx:123
SharedEvtQueueProvider::m_nprocesses
int m_nprocesses
Definition: SharedEvtQueueProvider.h:45
SharedEvtQueueProvider::handle
virtual void handle(const Incident &inc) override
Definition: SharedEvtQueueProvider.cxx:357
SharedEvtQueueProvider::ATLAS_NOT_THREAD_SAFE
virtual StatusCode exec ATLAS_NOT_THREAD_SAFE() override
SharedEvtQueueProvider::subProcessLogs
virtual void subProcessLogs(std::vector< std::string > &) override
Definition: SharedEvtQueueProvider.cxx:115
SharedEvtQueueProvider::exec_func
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > exec_func() override
Definition: SharedEvtQueueProvider.cxx:235
SharedEvtQueueProvider::ATLAS_NOT_THREAD_SAFE
virtual int makePool ATLAS_NOT_THREAD_SAFE(int maxevt, int nprocs, const std::string &topdir) override
LHEonly.nprocs
nprocs
Definition: LHEonly.py:17
IEventShare
Abstract interface for sharing within an event stream.
Definition: IEventShare.h:28
AthenaInterprocess::SharedQueue
Definition: SharedQueue.h:21
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArG4FSStartPointFilter.exec
exec
Definition: LArG4FSStartPointFilter.py:103
SharedEvtQueueProvider::m_nEvtCounted
int m_nEvtCounted
Definition: SharedEvtQueueProvider.h:55
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SharedEvtQueueProvider::fin_func
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > fin_func() override
Definition: SharedEvtQueueProvider.cxx:347
AthenaMPToolBase.h
SharedEvtQueueProvider::m_evtShare
IEventShare * m_evtShare
Definition: SharedEvtQueueProvider.h:58
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SharedEvtQueueProvider::bootstrap_func
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > bootstrap_func() override
Definition: SharedEvtQueueProvider.cxx:129
SharedEvtQueueProvider::SharedEvtQueueProvider
SharedEvtQueueProvider(const SharedEvtQueueProvider &)
SharedEvtQueueProvider::~SharedEvtQueueProvider
virtual ~SharedEvtQueueProvider() override
Definition: SharedEvtQueueProvider.cxx:51
SharedEvtQueueProvider::operator=
SharedEvtQueueProvider & operator=(const SharedEvtQueueProvider &)
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthenaMP::AllWorkerOutputs_ptr
std::unique_ptr< AllWorkerOutputs > AllWorkerOutputs_ptr
Definition: IAthenaMPTool.h:28
SharedQueue.h
SharedEvtQueueProvider
Definition: SharedEvtQueueProvider.h:16
SharedEvtQueueProvider::m_nPositionInChunk
int m_nPositionInChunk
Definition: SharedEvtQueueProvider.h:51