ATLAS Offline Software
Loading...
Searching...
No Matches
EL::Detail::GridReportingModule Class Referencefinal

a Module that handles the reporting from the job on the grid More...

#include <GridReportingModule.h>

Inheritance diagram for EL::Detail::GridReportingModule:
Collaboration diagram for EL::Detail::GridReportingModule:

Public Member Functions

virtual StatusCode onNewInputFile (ModuleData &data) override
 actions after opening a new input file
virtual StatusCode onExecute (ModuleData &data) override
 actions just before execute is called on algorithms
virtual StatusCode postFileClose (ModuleData &data) override
 action at end of the worker job
virtual void reportInputFailure (ModuleData &data) override
 report that we failed to open our input file
virtual StatusCode firstInitialize (ModuleData &data)
 action at the the very beginning of the worker job
virtual StatusCode preFileInitialize (ModuleData &data)
 action before opening the first file in the worker job
virtual StatusCode onInitialize (ModuleData &data)
 action just before algorithms are initialized
virtual StatusCode processInputs (ModuleData &data, IInputModuleActions &actions)
 process all input files
virtual StatusCode postFirstEvent (ModuleData &data)
 action after processing first event
virtual StatusCode onCloseInputFile (ModuleData &data)
 actions before closing an input file
virtual StatusCode postCloseInputFile (ModuleData &data)
 actions after CloseInputFile is called on the algorithms
virtual StatusCode onFileExecute (ModuleData &data)
 actions just before fileExecute is called on algorithms
virtual StatusCode onFinalize (ModuleData &data)
 actions just before algorithms are finalized
virtual StatusCode postFinalize (ModuleData &data)
 actions after algorithms have been finalized
virtual StatusCode onWorkerEnd (ModuleData &data)
 action at the end of the worker job

Private Attributes

std::vector< std::string > m_files
 the list of files we processed
unsigned m_eventsProcessed = 0
 the number of events we processed

Static Private Attributes

static constexpr int EC_BADINPUT = 223
 the panda error code for bad input files

Detailed Description

a Module that handles the reporting from the job on the grid

Definition at line 22 of file GridReportingModule.h.

Member Function Documentation

◆ firstInitialize()

StatusCode EL::Detail::Module::firstInitialize ( ModuleData & data)
virtualinherited

action at the the very beginning of the worker job

This gets called as early as possible in the worker initialization. Essentially all that should happen before this is to load all the modules. The main purpose is to start any benchmarks that are meant to capture the initialization process as well.

Reimplemented in EL::Detail::AlgorithmMemoryModule, EL::Detail::AlgorithmTimerModule, EL::Detail::MemoryMonitorModule, and EL::Detail::StopwatchModule.

Definition at line 25 of file Module.cxx.

27 {
28 return ::StatusCode::SUCCESS;
29 }

◆ onCloseInputFile()

StatusCode EL::Detail::Module::onCloseInputFile ( ModuleData & data)
virtualinherited

actions before closing an input file

Reimplemented in EL::Detail::AlgorithmStateModule, and EL::Detail::TreeCacheModule.

Definition at line 43 of file Module.cxx.

45 {
46 return ::StatusCode::SUCCESS;
47 }

◆ onExecute()

StatusCode EL::Detail::GridReportingModule::onExecute ( ModuleData & data)
overridevirtual

actions just before execute is called on algorithms

For now that is mostly used to point input modules to the right event

Reimplemented from EL::Detail::Module.

Definition at line 37 of file GridReportingModule.cxx.

39 {
41 return StatusCode::SUCCESS;
42 }
unsigned m_eventsProcessed
the number of events we processed

◆ onFileExecute()

StatusCode EL::Detail::Module::onFileExecute ( ModuleData & data)
virtualinherited

actions just before fileExecute is called on algorithms

Reimplemented in EL::Detail::AlgorithmStateModule, EL::Detail::FileExecutedModule, and EL::Detail::StopwatchModule.

Definition at line 65 of file Module.cxx.

67 {
68 return ::StatusCode::SUCCESS;
69 }

◆ onFinalize()

StatusCode EL::Detail::Module::onFinalize ( ModuleData & data)
virtualinherited

actions just before algorithms are finalized

Reimplemented in EL::Detail::AlgorithmStateModule, and EL::Detail::MemoryMonitorModule.

Definition at line 89 of file Module.cxx.

91 {
92 return ::StatusCode::SUCCESS;
93 }

◆ onInitialize()

StatusCode EL::Detail::Module::onInitialize ( ModuleData & data)
virtualinherited

action just before algorithms are initialized

This is typically used for any setup that this module needs to do.

Reimplemented in EL::Detail::AlgorithmStateModule, EL::Detail::FactoryPreloadModule, EL::Detail::FileExecutedModule, EL::Detail::MemoryMonitorModule, EL::Detail::TEventModule, and EL::Detail::WorkerConfigModule.

Definition at line 77 of file Module.cxx.

79 {
80 return ::StatusCode::SUCCESS;
81 }

◆ onNewInputFile()

StatusCode EL::Detail::GridReportingModule::onNewInputFile ( ModuleData & data)
overridevirtual

actions after opening a new input file

Reimplemented from EL::Detail::Module.

Definition at line 27 of file GridReportingModule.cxx.

29 {
30 if (std::find (m_files.begin(), m_files.end(), data.m_inputFileUrl) == m_files.end())
31 m_files.push_back (data.m_inputFileUrl);
32 return StatusCode::SUCCESS;
33 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
std::vector< std::string > m_files
the list of files we processed

◆ onWorkerEnd()

StatusCode EL::Detail::Module::onWorkerEnd ( ModuleData & data)
virtualinherited

action at the end of the worker job

This is mostly meant/used to print job summary statements at the very end of worker job, and actually have them show up at or at least near the end of any log file.

Reimplemented in EL::Detail::LeakCheckModule, EL::Detail::MemoryMonitorModule, and EL::Detail::StopwatchModule.

Definition at line 101 of file Module.cxx.

103 {
104 return ::StatusCode::SUCCESS;
105 }

◆ postCloseInputFile()

StatusCode EL::Detail::Module::postCloseInputFile ( ModuleData & data)
virtualinherited

actions after CloseInputFile is called on the algorithms

Right now that is only used to disconnect the TEvent object from the input file.

Reimplemented in EL::Detail::TEventModule.

Definition at line 49 of file Module.cxx.

51 {
52 return ::StatusCode::SUCCESS;
53 }

◆ postFileClose()

StatusCode EL::Detail::GridReportingModule::postFileClose ( ModuleData & data)
overridevirtual

action at end of the worker job

Executed just right before worker exit successfully at this stage all outputs have been created

Reimplemented from EL::Detail::Module.

Definition at line 46 of file GridReportingModule.cxx.

48 {
49 // createJobSummary
50 std::ofstream summaryfile("../AthSummary.txt");
51 if (summaryfile.is_open()) {
52 unsigned int nFiles = m_files.size();
53 summaryfile << "Files read: " << nFiles << std::endl;
54 for (auto& file : m_files)
55 summaryfile << " " << file << std::endl;
56 summaryfile << "Events Read: " << m_eventsProcessed << std::endl;
57 summaryfile.close();
58 }
59 else {
60 ANA_MSG_WARNING ("Failed to write summary file.");
61 }
62 return StatusCode::SUCCESS;
63 }
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
TFile * file

◆ postFinalize()

StatusCode EL::Detail::Module::postFinalize ( ModuleData & data)
virtualinherited

actions after algorithms have been finalized

This is usually used to calculate some job summary information that is to be stored it in the histogram output file.

Reimplemented in EL::Detail::EventCountModule, EL::Detail::FileExecutedModule, EL::Detail::LeakCheckModule, EL::Detail::StopwatchModule, and EL::Detail::TEventModule.

Definition at line 95 of file Module.cxx.

97 {
98 return ::StatusCode::SUCCESS;
99 }

◆ postFirstEvent()

StatusCode EL::Detail::Module::postFirstEvent ( ModuleData & data)
virtualinherited

action after processing first event

This is mostly meant to set up benchmarks that record per-event performance. While a lot of initialization happens during initialize() there is a fair amount of initialization that happens on the first event, so when recording per-event performance the first event is sort of "special" and may need to be omitted.

Reimplemented in EL::Detail::LeakCheckModule, and EL::Detail::MemoryMonitorModule.

Definition at line 55 of file Module.cxx.

57 {
58 return ::StatusCode::SUCCESS;
59 }

◆ preFileInitialize()

StatusCode EL::Detail::Module::preFileInitialize ( ModuleData & data)
virtualinherited

action before opening the first file in the worker job

This is mostly meant to allow loading the dictionaries before any files and associated information is loaded.

Definition at line 31 of file Module.cxx.

33 {
34 return ::StatusCode::SUCCESS;
35 }

◆ processInputs()

StatusCode EL::Detail::Module::processInputs ( ModuleData & data,
IInputModuleActions & actions )
virtualinherited

process all input files

This deviates slightly from the usual pattern for module functions in that I pass in the possible actions as an argument. See IInputModuleActions for details.

Reimplemented in EL::Detail::BatchInputModule, and EL::Detail::DirectInputModule.

Definition at line 83 of file Module.cxx.

85 {
86 return ::StatusCode::SUCCESS;
87 }

◆ reportInputFailure()

void EL::Detail::GridReportingModule::reportInputFailure ( ModuleData & data)
overridevirtual

report that we failed to open our input file

Reimplemented from EL::Detail::Module.

Definition at line 67 of file GridReportingModule.cxx.

69 {
70 ANA_MSG_FATAL ("encountered input error");
72 }
#define ANA_MSG_FATAL(xmsg)
Macro printing fatal messages.
static constexpr int EC_BADINPUT
the panda error code for bad input files

Member Data Documentation

◆ EC_BADINPUT

int EL::Detail::GridReportingModule::EC_BADINPUT = 223
staticconstexprprivate

the panda error code for bad input files

Definition at line 25 of file GridReportingModule.h.

◆ m_eventsProcessed

unsigned EL::Detail::GridReportingModule::m_eventsProcessed = 0
private

the number of events we processed

Definition at line 31 of file GridReportingModule.h.

◆ m_files

std::vector<std::string> EL::Detail::GridReportingModule::m_files
private

the list of files we processed

Definition at line 28 of file GridReportingModule.h.


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