ATLAS Offline Software
SharedWriterTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAMPTOOLS_SHAREDWRITERTOOL_H
6 #define ATHENAMPTOOLS_SHAREDWRITERTOOL_H
7 
8 #include "AthenaMPToolBase.h"
9 
10 class IConversionSvc;
11 
12 class SharedWriterTool final : public AthenaMPToolBase
13 {
14  public:
15  SharedWriterTool(const std::string& type
16  , const std::string& name
17  , const IInterface* parent);
18 
19  virtual ~SharedWriterTool() override;
20 
21  virtual StatusCode initialize() override;
22  virtual StatusCode finalize() override;
23 
24  // _________IAthenaMPTool_________
25  virtual int makePool ATLAS_NOT_THREAD_SAFE (int maxevt, int nprocs, const std::string& topdir) override;
26  virtual StatusCode exec ATLAS_NOT_THREAD_SAFE () override;
27 
28  virtual void subProcessLogs(std::vector<std::string>&) override;
30 
31  // _____ Actual working horses ________
32  virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> bootstrap_func() override;
33  virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> exec_func() override;
34  virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> fin_func() override;
35 
36  private:
40 
41  // Properties
42  Gaudi::Property<bool> m_nMotherProcess{
43  this, "MotherProcess", false,
44  "Expect mother process to write event data. The default is false."};
45  Gaudi::Property<bool> m_debug{
46  this, "Debug", false,
47  "Are we running in debug mode? The default is false"};
48 
49  int m_rankId; // Each worker has its own unique RankID from the range (0,...,m_nprocs-1)
50 
52  IConversionSvc* m_cnvSvc;
53 
54 };
55 
56 #endif
SharedWriterTool
Definition: SharedWriterTool.h:13
SharedWriterTool::fin_func
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > fin_func() override
Definition: SharedWriterTool.cxx:287
SharedWriterTool::exec_func
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > exec_func() override
Definition: SharedWriterTool.cxx:244
SharedWriterTool::m_sharedRankQueue
AthenaInterprocess::SharedQueue * m_sharedRankQueue
Definition: SharedWriterTool.h:51
SharedWriterTool::SharedWriterTool
SharedWriterTool(const SharedWriterTool &)
SharedWriterTool::operator=
SharedWriterTool & operator=(const SharedWriterTool &)
SharedWriterTool::finalize
virtual StatusCode finalize() override
Definition: SharedWriterTool.cxx:43
SharedWriterTool::SharedWriterTool
SharedWriterTool()
AthenaMPToolBase
Definition: AthenaMPToolBase.h:25
SharedWriterTool::~SharedWriterTool
virtual ~SharedWriterTool() override
Definition: SharedWriterTool.cxx:29
SharedWriterTool::generateOutputReport
virtual AthenaMP::AllWorkerOutputs_ptr generateOutputReport() override
Definition: SharedWriterTool.cxx:129
SharedWriterTool::m_rankId
int m_rankId
Definition: SharedWriterTool.h:49
SharedWriterTool::m_cnvSvc
IConversionSvc * m_cnvSvc
Definition: SharedWriterTool.h:52
LHEonly.nprocs
nprocs
Definition: LHEonly.py:17
AthenaInterprocess::SharedQueue
Definition: SharedQueue.h:21
SharedWriterTool::initialize
virtual StatusCode initialize() override
Definition: SharedWriterTool.cxx:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArG4FSStartPointFilter.exec
exec
Definition: LArG4FSStartPointFilter.py:103
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SharedWriterTool::m_nMotherProcess
Gaudi::Property< bool > m_nMotherProcess
Definition: SharedWriterTool.h:42
SharedWriterTool::bootstrap_func
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > bootstrap_func() override
Definition: SharedWriterTool.cxx:135
SharedWriterTool::m_debug
Gaudi::Property< bool > m_debug
Definition: SharedWriterTool.h:45
AthenaMPToolBase.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthenaMP::AllWorkerOutputs_ptr
std::unique_ptr< AllWorkerOutputs > AllWorkerOutputs_ptr
Definition: IAthenaMPTool.h:28
SharedWriterTool::ATLAS_NOT_THREAD_SAFE
virtual StatusCode exec ATLAS_NOT_THREAD_SAFE() override
SharedWriterTool::subProcessLogs
virtual void subProcessLogs(std::vector< std::string > &) override
Definition: SharedWriterTool.cxx:121
SharedWriterTool::ATLAS_NOT_THREAD_SAFE
virtual int makePool ATLAS_NOT_THREAD_SAFE(int maxevt, int nprocs, const std::string &topdir) override