ATLAS Offline Software
Loading...
Searching...
No Matches
SharedEvtQueueProvider.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
12class IEventShare;
13
14class SharedEvtQueueProvider final : public extends<AthenaMPToolBase, IIncidentListener>
15{
16 public:
17 SharedEvtQueueProvider(const std::string& type
18 , const std::string& name
19 , const IInterface* parent);
20
21 virtual ~SharedEvtQueueProvider() override;
22
23 // _________IAthenaMPTool_________
24 virtual int makePool ATLAS_NOT_THREAD_SAFE (int maxevt, int nprocs, const std::string& topdir) override;
25 virtual StatusCode exec ATLAS_NOT_THREAD_SAFE() override;
26
27 virtual void subProcessLogs(std::vector<std::string>&) override;
29
30 // _________IIncidentListener___________
31 virtual void handle(const Incident& inc) override;
32
33 // _____ Actual working horses ________
34 virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> bootstrap_func() override;
35 virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> exec_func() override;
36 virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> fin_func() override;
37
38 private:
42
43 Gaudi::Property<bool> m_useSharedReader{this, "UseSharedReader", false, "Use shared reader"};
44 Gaudi::Property<int> m_nEventsBeforeFork{this, "EventsBeforeFork", 0, "Number of events before forking"};
45 Gaudi::Property<int> m_nChunkSize{this, "ChunkSize", 1};
46
52 int m_nprocesses{-1};
55
58
60 SmartIF<IEventShare> m_evtShare;
61
62 // Add next event chunk to the queue
63 void addEventsToQueue();
64
65};
66
67#endif
Abstract interface for sharing within an event stream.
Definition IEventShare.h:25
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > bootstrap_func() override
int m_nEvtRequested
Max event received from AppMgr.
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > exec_func() override
SharedEvtQueueProvider(const std::string &type, const std::string &name, const IInterface *parent)
int m_nprocesses
We use this data member for adding negative numbers at the end of the event queue.
AthenaInterprocess::SharedQueue * m_sharedEventQueue
virtual ~SharedEvtQueueProvider() override
Gaudi::Property< int > m_nEventsBeforeFork
SharedEvtQueueProvider(const SharedEvtQueueProvider &)
virtual StatusCode exec ATLAS_NOT_THREAD_SAFE() override
SmartIF< IEventShare > m_evtShare
int m_nEvtCounted
The number of events this tool has counted itself in the input files.
Gaudi::Property< bool > m_useSharedReader
Gaudi::Property< int > m_nChunkSize
virtual void handle(const Incident &inc) override
virtual AthenaMP::AllWorkerOutputs_ptr generateOutputReport() override
int m_nChunkStart
The beginning of the current chunk.
SharedEvtQueueProvider & operator=(const SharedEvtQueueProvider &)
int m_nPositionInChunk
Position within the current chunk.
virtual void subProcessLogs(std::vector< std::string > &) override
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > fin_func() override
virtual int makePool ATLAS_NOT_THREAD_SAFE(int maxevt, int nprocs, const std::string &topdir) override
std::unique_ptr< AllWorkerOutputs > AllWorkerOutputs_ptr