ATLAS Offline Software
Public Member Functions | List of all members
EL::Detail::PostClosedOutputsModule Class Referencefinal

Module enabling to perform checks/actions on outputs once files are all closed. More...

#include <PostClosedOutputsModule.h>

Inheritance diagram for EL::Detail::PostClosedOutputsModule:
Collaboration diagram for EL::Detail::PostClosedOutputsModule:

Public Member Functions

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

Detailed Description

Module enabling to perform checks/actions on outputs once files are all closed.

Definition at line 21 of file PostClosedOutputsModule.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::MemoryMonitorModule, EL::Detail::AlgorithmMemoryModule, EL::Detail::AlgorithmTimerModule, 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::Module::onExecute ( ModuleData data)
virtualinherited

actions just before execute is called on algorithms

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

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

Definition at line 71 of file Module.cxx.

73  {
74  return ::StatusCode::SUCCESS;
75  }

◆ 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::TEventModule, EL::Detail::AlgorithmStateModule, EL::Detail::MemoryMonitorModule, EL::Detail::FileExecutedModule, EL::Detail::FactoryPreloadModule, and EL::Detail::WorkerConfigModule.

Definition at line 77 of file Module.cxx.

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

◆ onNewInputFile()

StatusCode EL::Detail::Module::onNewInputFile ( ModuleData data)
virtualinherited

actions after opening a new input file

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

Definition at line 37 of file Module.cxx.

39  {
40  return ::StatusCode::SUCCESS;
41  }

◆ 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::MemoryMonitorModule, EL::Detail::StopwatchModule, and EL::Detail::LeakCheckModule.

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::PostClosedOutputsModule::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 24 of file PostClosedOutputsModule.cxx.

26  {
27  // get executable if user provided one
28  std::string postCloseExec = data.m_worker->metaData()->castString (Job::optWorkerPostClosedOutputsExecutable, "");
29 
30  if (!postCloseExec.size()){
31  // user did not provide an excutable to be called after all outputs are closed
32  ANA_MSG_DEBUG ("PostClosedOutputsModule: no additionnal checks/actions performed after all outputs are closed");
33  return StatusCode::SUCCESS;
34  }
35 
36  // user provided an executable to be used
37  // loop over all outputs
38  for (auto & output : data.m_outputs){
39  std::string outputLabel = output.first;
40  std::string outputFileName = output.second.finalFileName();
41 
42  if (!outputFileName.size()){
43  ANA_MSG_WARNING ("PostClosedOutputsModule: empty outputFileName skipping outputLabel = "+outputLabel);
44  continue;
45  }
46 
47  // for instance execute a script checking that root files are not corrupted
48  std::string cmdLineToExecute = postCloseExec+" "+outputLabel+" "+outputFileName;
49 
50  ANA_MSG_INFO ("PostClosedOutputsModule: execute command line = '" << cmdLineToExecute << "'");
51  RCU::Shell::exec (cmdLineToExecute.c_str());
52  }
53  return StatusCode::SUCCESS;
54  }

◆ 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::TEventModule, EL::Detail::FileExecutedModule, EL::Detail::LeakCheckModule, EL::Detail::StopwatchModule, and EL::Detail::EventCountModule.

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::MemoryMonitorModule, and EL::Detail::LeakCheckModule.

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::Module::reportInputFailure ( ModuleData data)
virtualinherited

report that we failed to open our input file

Reimplemented in EL::Detail::GridReportingModule.

Definition at line 61 of file Module.cxx.

63  {}

The documentation for this class was generated from the following files:
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
outputLabel
const std::string outputLabel
Definition: OverlapRemovalTester.cxx:69
EL::Job::optWorkerPostClosedOutputsExecutable
static const std::string optWorkerPostClosedOutputsExecutable
Optionnal executable to be provided by the user that will be called, by the worker,...
Definition: Job.h:283
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
ANA_MSG_WARNING
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:292
merge.output
output
Definition: merge.py:17
RCU::Shell::exec
void exec(const std::string &cmd)
effects: execute the given command guarantee: strong failures: out of memory II failures: system fail...
Definition: ShellExec.cxx:29
AthenaPoolExample_Copy.outputFileName
string outputFileName
Definition: AthenaPoolExample_Copy.py:40
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288