ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
StopwatchModule.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
9
//
10
// includes
11
//
12
13
#include <
EventLoop/StopwatchModule.h
>
14
15
#include <
EventLoop/ModuleData.h
>
16
#include <
RootCoreUtils/Assert.h
>
17
#include <TList.h>
18
#include <TStopwatch.h>
19
20
//
21
// method implementations
22
//
23
24
namespace
EL
25
{
26
namespace
Detail
27
{
28
::StatusCode
StopwatchModule ::
29
firstInitialize (
ModuleData
&
/*data*/
)
30
{
31
m_stopwatch
= std::make_unique<TStopwatch> ();
32
33
m_stopwatch
->Start ();
34
35
m_runTime
= std::make_unique<TH1D> (
"EventLoop_RunTime"
,
"worker run-time summary"
, 5, 0, 5);
36
m_runTime
->SetDirectory (
nullptr
);
37
m_runTime
->Fill (0);
38
m_runTime
->GetXaxis()->SetBinLabel (1,
"jobs"
);
39
m_runTime
->GetXaxis()->SetBinLabel (2,
"files"
);
40
m_runTime
->GetXaxis()->SetBinLabel (3,
"events"
);
41
m_runTime
->GetXaxis()->SetBinLabel (4,
"cpu time"
);
42
m_runTime
->GetXaxis()->SetBinLabel (5,
"real time"
);
43
return ::StatusCode::SUCCESS;
44
}
45
46
47
48
::StatusCode
StopwatchModule ::
49
onFileExecute (
ModuleData
&
/*data*/
)
50
{
51
m_runTime
->Fill (1);
52
return ::StatusCode::SUCCESS;
53
}
54
55
56
57
::StatusCode
StopwatchModule ::
58
postFinalize (
ModuleData
& data)
59
{
60
m_stopwatch
->Stop ();
61
m_runTime
->Fill (2, data.m_eventsProcessed);
62
m_runTime
->Fill (3,
m_stopwatch
->CpuTime());
63
m_runTime
->Fill (4,
m_stopwatch
->RealTime());
64
m_stopwatch
->Continue ();
65
data.addOutput (std::move (
m_runTime
));
66
return ::StatusCode::SUCCESS;
67
}
68
69
70
71
::StatusCode
StopwatchModule ::
72
onWorkerEnd (
ModuleData
&
/*data*/
)
73
{
74
m_stopwatch
->Stop ();
75
m_stopwatch
->Print ();
76
return ::StatusCode::SUCCESS;
77
}
78
}
79
}
Assert.h
ModuleData.h
StopwatchModule.h
EL::Detail::StopwatchModule::m_stopwatch
std::unique_ptr< TStopwatch > m_stopwatch
the stop watch we use for measuring total time spend
Definition
StopwatchModule.h:49
EL::Detail::StopwatchModule::m_runTime
std::unique_ptr< TH1 > m_runTime
the run time summary histogram
Definition
StopwatchModule.h:45
EL::Detail
Definition
AsgComponentFactories.h:20
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL::Detail::ModuleData
the data the EventLoop core classes are sharing with the Module implementation
Definition
ModuleData.h:64
Generated on
for ATLAS Offline Software by
1.17.0