ATLAS Offline Software
EvtRangeScatterer.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_EVTRANGESCATTERER_H
6 #define ATHENAMPTOOLS_EVTRANGESCATTERER_H
7 
8 #include "AthenaMPToolBase.h"
9 #include "yampl/Exceptions.h"
10 #include <map>
11 
12 typedef std::map<pid_t,std::string> Pid2RangeID;
13 
14 namespace yampl {
15  class ISocket;
16 }
17 
18 class EvtRangeScatterer final : public AthenaMPToolBase
19 {
20  public:
21  EvtRangeScatterer(const std::string& type
22  , const std::string& name
23  , const IInterface* parent);
24 
25  virtual ~EvtRangeScatterer() override;
26 
27  virtual StatusCode initialize() override;
28  virtual StatusCode finalize() override;
29 
30  // _________IAthenaMPTool_________
31  virtual int makePool ATLAS_NOT_THREAD_SAFE (int maxevt, int nprocs, const std::string& topdir) override;
32  virtual StatusCode exec ATLAS_NOT_THREAD_SAFE () override;
33 
34  virtual void subProcessLogs(std::vector<std::string>&) override;
36 
37  // _____ Actual working horses ________
38  virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> bootstrap_func() override;
39  virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> exec_func() override;
40  virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> fin_func() override;
41 
42  private:
46 
47  // Get rid of
48  // 1. Leading and trailing spaces
49  // 2. Leading "u\'" and trailing "\'"
50  void trimRangeStrings(std::string&);
51 
52  // Helper functuion for receiving new messages from the socket2Processor channel
53  // If this is an output file report, then it is forwarded to the pilot and an empty string is returned to the caller
54  std::string getNewRangeRequest (yampl::ISocket* socket2Processor
55  , yampl::ISocket* socket2Pilot
56  , int& procReportPending);
57 
58  // Poll the failed PID queue to see if any of the Processors has failed
60  , yampl::ISocket* socket2Pilot
61  , int& procReportPending);
62 
63  StringProperty m_processorChannel;
64  StringProperty m_eventRangeChannel;
66  Pid2RangeID m_pid2RangeID; // Current RangeID-s by PIDs
67 };
68 
69 #endif
pid_t
int32_t pid_t
Definition: FPGATrackSimTypes.h:19
EvtRangeScatterer::subProcessLogs
virtual void subProcessLogs(std::vector< std::string > &) override
Definition: EvtRangeScatterer.cxx:100
EvtRangeScatterer::initialize
virtual StatusCode initialize() override
Definition: EvtRangeScatterer.cxx:44
EvtRangeScatterer::getNewRangeRequest
std::string getNewRangeRequest(yampl::ISocket *socket2Processor, yampl::ISocket *socket2Pilot, int &procReportPending)
Definition: EvtRangeScatterer.cxx:476
EvtRangeScatterer::pollFailedPidQueue
pid_t pollFailedPidQueue(AthenaInterprocess::SharedQueue *sharedFailedPidQueue, yampl::ISocket *socket2Pilot, int &procReportPending)
Definition: EvtRangeScatterer.cxx:530
EvtRangeScatterer::generateOutputReport
virtual AthenaMP::AllWorkerOutputs_ptr generateOutputReport() override
Definition: EvtRangeScatterer.cxx:108
AthenaMPToolBase
Definition: AthenaMPToolBase.h:25
EvtRangeScatterer::trimRangeStrings
void trimRangeStrings(std::string &)
Definition: EvtRangeScatterer.cxx:443
EvtRangeScatterer::ATLAS_NOT_THREAD_SAFE
virtual int makePool ATLAS_NOT_THREAD_SAFE(int maxevt, int nprocs, const std::string &topdir) override
EvtRangeScatterer::finalize
virtual StatusCode finalize() override
Definition: EvtRangeScatterer.cxx:54
EvtRangeScatterer::~EvtRangeScatterer
virtual ~EvtRangeScatterer() override
Definition: EvtRangeScatterer.cxx:40
EvtRangeScatterer::m_doCaching
bool m_doCaching
Definition: EvtRangeScatterer.h:65
EvtRangeScatterer::fin_func
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > fin_func() override
Definition: EvtRangeScatterer.cxx:433
LHEonly.nprocs
nprocs
Definition: LHEonly.py:17
EvtRangeScatterer::m_eventRangeChannel
StringProperty m_eventRangeChannel
Definition: EvtRangeScatterer.h:64
AthenaInterprocess::SharedQueue
Definition: SharedQueue.h:21
EvtRangeScatterer::exec_func
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > exec_func() override
Definition: EvtRangeScatterer.cxx:190
EvtRangeScatterer::EvtRangeScatterer
EvtRangeScatterer()
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArG4FSStartPointFilter.exec
exec
Definition: LArG4FSStartPointFilter.py:103
EvtRangeScatterer::bootstrap_func
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > bootstrap_func() override
Definition: EvtRangeScatterer.cxx:114
EvtRangeScatterer::operator=
EvtRangeScatterer & operator=(const EvtRangeScatterer &)
EvtRangeScatterer::ATLAS_NOT_THREAD_SAFE
virtual StatusCode exec ATLAS_NOT_THREAD_SAFE() override
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AthenaMPToolBase.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
yampl
Definition: EvtRangeProcessor.h:19
EvtRangeScatterer::m_processorChannel
StringProperty m_processorChannel
Definition: EvtRangeScatterer.h:63
EvtRangeScatterer::m_pid2RangeID
Pid2RangeID m_pid2RangeID
Definition: EvtRangeScatterer.h:66
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
EvtRangeScatterer::EvtRangeScatterer
EvtRangeScatterer(const EvtRangeScatterer &)
AthenaMP::AllWorkerOutputs_ptr
std::unique_ptr< AllWorkerOutputs > AllWorkerOutputs_ptr
Definition: IAthenaMPTool.h:28
EvtRangeScatterer
Definition: EvtRangeScatterer.h:19
Pid2RangeID
std::map< pid_t, std::string > Pid2RangeID
Definition: EvtRangeScatterer.h:12