ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaMP
src
AthMpEvtLoopMgr.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 ATHENAMP_ATHMPEVTLOOPMGR_H
6
#define ATHENAMP_ATHMPEVTLOOPMGR_H
7
8
#include "GaudiKernel/IEventProcessor.h"
9
#include "
AthenaBaseComps/AthService.h
"
10
#include "GaudiKernel/ToolHandle.h"
11
#include "
AthenaKernel/IDataShare.h
"
12
#include "
AthenaMPTools/IAthenaMPTool.h
"
13
#include "
AthenaInterprocess/FdsRegistry.h
"
14
#include "
AthenaInterprocess/IMPRunStop.h
"
15
#include <memory>
16
17
class
ISvcLocator;
18
19
class
ATLAS_NOT_THREAD_SAFE
AthMpEvtLoopMgr
:
public
extends<AthService,
20
IEventProcessor,
21
AthenaInterprocess::IMPRunStop>
22
{
23
public
:
24
AthMpEvtLoopMgr
(
const
std::string& name, ISvcLocator* svcLocator);
25
virtual
~AthMpEvtLoopMgr
() =
default
;
26
27
AthMpEvtLoopMgr
() =
delete
;
28
AthMpEvtLoopMgr
(
const
AthMpEvtLoopMgr
&) =
delete
;
29
AthMpEvtLoopMgr
&
operator =
(
const
AthMpEvtLoopMgr
&) =
delete
;
30
31
32
virtual
StatusCode
initialize
()
override
;
33
virtual
StatusCode
finalize
()
override
;
34
35
virtual
StatusCode
nextEvent
(
int
maxevt)
override
;
36
virtual
StatusCode
executeEvent
(EventContext &&ctx)
override
;
37
virtual
StatusCode
executeRun
(
int
maxevt)
override
;
38
virtual
StatusCode
stopRun
()
override
;
39
40
virtual
EventContext
createEventContext
()
override
;
41
42
virtual
bool
stopScheduled
()
const override
{
return
m_scheduledStop
;};
43
44
private
:
45
ServiceHandle<IEventProcessor>
m_evtProcessor
{
this
,
"EventLoopManager"
,
"AthenaEventLoopMgr"
};
46
SmartIF<IService>
m_evtSelector
{
nullptr
};
47
SmartIF<IDataShare>
m_dataShare
;
48
49
Gaudi::Property<int>
m_nWorkers
{
this
,
"NWorkers"
, 0,
50
"Number of AthenaMP worker processes"
};
51
52
Gaudi::Property<std::string>
m_workerTopDir
{
this
,
"WorkerTopDir"
,
"athenaMP_workers"
,
53
"Sub-directory of the main run directory that contains run directories of all workers"
};
54
55
Gaudi::Property<std::string>
m_outputReportName
{
this
,
"OutputReportFile"
,
"AthenaMPOutputs"
,
56
"ASCII file in the main run directory that lists outputs of all workers. Used by Job Transform"
};
57
58
Gaudi::Property<std::string>
m_strategy
{
this
,
"Strategy"
,
""
,
59
"Event processing strategy used by AthenaMP workers. E.g, Shared Queue, Round Robin"
};
60
61
Gaudi::Property<bool>
m_isPileup
{
this
,
"IsPileup"
,
false
,
62
"Is AthenaMP running a PileUp Digitization job?"
};
63
64
Gaudi::Property<bool>
m_collectSubprocessLogs
{
this
,
"CollectSubprocessLogs"
,
false
,
65
"Copy all workers' logs into the main log file at the end of the job?"
};
66
67
ToolHandleArray<IAthenaMPTool>
m_tools
{
this
,
"Tools"
, {}};
68
69
Gaudi::Property<int>
m_nPollingInterval
{
this
,
"PollingInterval"
, 100,
70
"Interval in milliseconds between checks of sub-processes statuses"
};
71
72
Gaudi::Property<int>
m_nMemSamplingInterval
{
this
,
"MemSamplingInterval"
, 0,
73
"Interval in seconds between taking memory usage samples. 0 - no sampling"
};
74
75
Gaudi::Property<int>
m_nEventsBeforeFork
{
this
,
"EventsBeforeFork"
, 0,
76
"Number of events to be processed by the main process before forking the workers. 0 - fork after BeginRun incident"
};
77
78
Gaudi::Property<unsigned int>
m_eventPrintoutInterval
{
this
,
"EventPrintoutInterval"
, 1,
79
"The value to be forwarded to the EventPrintoutInterval property of the AthenaEventLoopMgr"
};
80
81
StringArrayProperty
m_execAtPreFork
{
this
,
"ExecAtPreFork"
, {},
82
"The value to be forwarded to the ExecAtPreFork property of the AthenaEventLoopMgr"
};
83
84
int
m_nChildProcesses
{0};
// Total number of child processes
85
pid_t
m_masterPid
{};
// PID of the main process
86
bool
m_scheduledStop
{
false
};
// Flag for early termination of the event loop (for the generators use-case)
87
88
// vectors for collecting memory samples
89
std::vector<unsigned long>
m_samplesRss
;
90
std::vector<unsigned long>
m_samplesPss
;
91
std::vector<unsigned long>
m_samplesSize
;
92
std::vector<unsigned long>
m_samplesSwap
;
93
94
StatusCode
wait
();
95
StatusCode
generateOutputReport
();
96
std::shared_ptr<AthenaInterprocess::FdsRegistry>
extractFds
();
97
StatusCode
updateSkipEvents
(
int
skipEvents);
98
};
99
100
#endif
operator=
ElementLink & operator=(const ElementLink &)=default
AthService.h
pid_t
int32_t pid_t
Definition
FPGATrackSimTypes.h:19
FdsRegistry.h
IAthenaMPTool.h
IDataShare.h
IMPRunStop.h
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition
checker_macros.h:212
AthMpEvtLoopMgr::stopRun
virtual StatusCode stopRun() override
Definition
AthMpEvtLoopMgr.cxx:363
AthMpEvtLoopMgr::m_samplesSize
std::vector< unsigned long > m_samplesSize
Definition
AthMpEvtLoopMgr.h:91
AthMpEvtLoopMgr::m_nPollingInterval
Gaudi::Property< int > m_nPollingInterval
Definition
AthMpEvtLoopMgr.h:69
AthMpEvtLoopMgr::createEventContext
virtual EventContext createEventContext() override
Definition
AthMpEvtLoopMgr.cxx:117
AthMpEvtLoopMgr::m_dataShare
SmartIF< IDataShare > m_dataShare
Definition
AthMpEvtLoopMgr.h:47
AthMpEvtLoopMgr::AthMpEvtLoopMgr
AthMpEvtLoopMgr(const std::string &name, ISvcLocator *svcLocator)
Definition
AthMpEvtLoopMgr.cxx:39
AthMpEvtLoopMgr::finalize
virtual StatusCode finalize() override
Definition
AthMpEvtLoopMgr.cxx:106
AthMpEvtLoopMgr::stopScheduled
virtual bool stopScheduled() const override
Definition
AthMpEvtLoopMgr.h:42
AthMpEvtLoopMgr::executeEvent
virtual StatusCode executeEvent(EventContext &&ctx) override
Definition
AthMpEvtLoopMgr.cxx:122
AthMpEvtLoopMgr::m_execAtPreFork
StringArrayProperty m_execAtPreFork
Definition
AthMpEvtLoopMgr.h:81
AthMpEvtLoopMgr::nextEvent
virtual StatusCode nextEvent(int maxevt) override
Definition
AthMpEvtLoopMgr.cxx:111
AthMpEvtLoopMgr::m_tools
ToolHandleArray< IAthenaMPTool > m_tools
Definition
AthMpEvtLoopMgr.h:67
AthMpEvtLoopMgr::m_nWorkers
Gaudi::Property< int > m_nWorkers
Definition
AthMpEvtLoopMgr.h:49
AthMpEvtLoopMgr::m_masterPid
pid_t m_masterPid
Definition
AthMpEvtLoopMgr.h:85
AthMpEvtLoopMgr::m_workerTopDir
Gaudi::Property< std::string > m_workerTopDir
Definition
AthMpEvtLoopMgr.h:52
AthMpEvtLoopMgr::updateSkipEvents
StatusCode updateSkipEvents(int skipEvents)
Definition
AthMpEvtLoopMgr.cxx:572
AthMpEvtLoopMgr::m_collectSubprocessLogs
Gaudi::Property< bool > m_collectSubprocessLogs
Definition
AthMpEvtLoopMgr.h:64
AthMpEvtLoopMgr::m_eventPrintoutInterval
Gaudi::Property< unsigned int > m_eventPrintoutInterval
Definition
AthMpEvtLoopMgr.h:78
AthMpEvtLoopMgr::extractFds
std::shared_ptr< AthenaInterprocess::FdsRegistry > extractFds()
Definition
AthMpEvtLoopMgr.cxx:507
AthMpEvtLoopMgr::m_nEventsBeforeFork
Gaudi::Property< int > m_nEventsBeforeFork
Definition
AthMpEvtLoopMgr.h:75
AthMpEvtLoopMgr::m_isPileup
Gaudi::Property< bool > m_isPileup
Definition
AthMpEvtLoopMgr.h:61
AthMpEvtLoopMgr::~AthMpEvtLoopMgr
virtual ~AthMpEvtLoopMgr()=default
AthMpEvtLoopMgr::m_samplesRss
std::vector< unsigned long > m_samplesRss
Definition
AthMpEvtLoopMgr.h:89
AthMpEvtLoopMgr::executeRun
virtual StatusCode executeRun(int maxevt) override
Definition
AthMpEvtLoopMgr.cxx:128
AthMpEvtLoopMgr::m_strategy
Gaudi::Property< std::string > m_strategy
Definition
AthMpEvtLoopMgr.h:58
AthMpEvtLoopMgr::m_scheduledStop
bool m_scheduledStop
Definition
AthMpEvtLoopMgr.h:86
AthMpEvtLoopMgr::AthMpEvtLoopMgr
AthMpEvtLoopMgr(const AthMpEvtLoopMgr &)=delete
AthMpEvtLoopMgr::AthMpEvtLoopMgr
AthMpEvtLoopMgr()=delete
AthMpEvtLoopMgr::wait
StatusCode wait()
Definition
AthMpEvtLoopMgr.cxx:379
AthMpEvtLoopMgr::m_evtProcessor
ServiceHandle< IEventProcessor > m_evtProcessor
Definition
AthMpEvtLoopMgr.h:45
AthMpEvtLoopMgr::m_nChildProcesses
int m_nChildProcesses
Definition
AthMpEvtLoopMgr.h:84
AthMpEvtLoopMgr::generateOutputReport
StatusCode generateOutputReport()
Definition
AthMpEvtLoopMgr.cxx:436
AthMpEvtLoopMgr::m_outputReportName
Gaudi::Property< std::string > m_outputReportName
Definition
AthMpEvtLoopMgr.h:55
AthMpEvtLoopMgr::m_samplesSwap
std::vector< unsigned long > m_samplesSwap
Definition
AthMpEvtLoopMgr.h:92
AthMpEvtLoopMgr::m_samplesPss
std::vector< unsigned long > m_samplesPss
Definition
AthMpEvtLoopMgr.h:90
AthMpEvtLoopMgr::m_nMemSamplingInterval
Gaudi::Property< int > m_nMemSamplingInterval
Definition
AthMpEvtLoopMgr.h:72
AthMpEvtLoopMgr::m_evtSelector
SmartIF< IService > m_evtSelector
Definition
AthMpEvtLoopMgr.h:46
ServiceHandle
Definition
ClusterMakerTool.h:36
initialize
void initialize()
Definition
run_EoverP.cxx:894
Generated on
for ATLAS Offline Software by
1.17.0