CMS 3D CMS Logo

RunProcessingStatus.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_RunProcessingStatus_h
2 #define FWCore_Framework_RunProcessingStatus_h
3 //
4 // Package: FWCore/Framework
5 // Class : RunProcessingStatus
6 //
12 //
13 // Original Author: W. David Dagenhart
14 // Created: 1 Oct 2021
15 //
16 
22 
23 #include <atomic>
24 #include <memory>
25 #include <vector>
26 
27 namespace edm {
28 
29  class EventSetupImpl;
30  class RunPrincipal;
31 
33  public:
34  RunProcessingStatus(unsigned int iNStreams, WaitingTaskHolder const& holder);
35 
37  RunProcessingStatus const& operator=(RunProcessingStatus const&) = delete;
38 
41 
44  //free run for next usage
45  runPrincipal_.reset();
47  }
48 
49  std::shared_ptr<RunPrincipal>& runPrincipal() { return runPrincipal_; }
50  void setRunPrincipal(std::shared_ptr<RunPrincipal> val) { runPrincipal_ = std::move(val); }
51 
52  void resetBeginResources();
53  void resetEndResources();
54 
55  EventSetupImpl const& eventSetupImpl(unsigned subProcessIndex) const {
56  return *eventSetupImpls_.at(subProcessIndex);
57  }
58 
59  EventSetupImpl const& eventSetupImplEndRun(unsigned subProcessIndex) const {
60  return *eventSetupImplsEndRun_.at(subProcessIndex);
61  }
62 
63  std::vector<std::shared_ptr<const EventSetupImpl>>& eventSetupImpls() { return eventSetupImpls_; }
64  std::vector<std::shared_ptr<const EventSetupImpl>> const& eventSetupImpls() const { return eventSetupImpls_; }
65 
67 
68  std::vector<std::shared_ptr<const EventSetupImpl>>& eventSetupImplsEndRun() { return eventSetupImplsEndRun_; }
69  std::vector<std::shared_ptr<const EventSetupImpl>> const& eventSetupImplsEndRun() const {
71  }
72 
74 
77 
79  bool streamFinishedRun() { return 0 == (--nStreamsStillProcessingRun_); }
80 
81  //These should only be called while in the InputSource's task queue
82  void updateLastTimestamp(edm::Timestamp const& iTime) {
83  if (iTime > endTime_) {
84  endTime_ = iTime;
85  }
86  }
87  edm::Timestamp const& lastTimestamp() const { return endTime_; }
88 
89  void setEndTime();
90 
93 
96 
99 
102 
103  private:
106  std::shared_ptr<RunPrincipal> runPrincipal_;
107  std::vector<std::shared_ptr<const EventSetupImpl>> eventSetupImpls_;
109  std::vector<std::shared_ptr<const EventSetupImpl>> eventSetupImplsEndRun_;
112  std::atomic<unsigned int> nStreamsStillProcessingBeginRun_;
113  std::atomic<unsigned int> nStreamsStillProcessingRun_;
115  std::atomic<char> endTimeSetStatus_{0};
120  };
121 } // namespace edm
122 
123 #endif
void setCleaningUpAfterException(bool val)
EventSetupImpl const & eventSetupImplEndRun(unsigned subProcessIndex) const
std::vector< std::shared_ptr< const EventSetupImpl > > & eventSetupImplsEndRun()
WaitingTaskList endIOVWaitingTasks_
RunProcessingStatus(unsigned int iNStreams, WaitingTaskHolder const &holder)
void setRunPrincipal(std::shared_ptr< RunPrincipal > val)
WaitingTaskList endIOVWaitingTasksEndRun_
WaitingTaskHolder & globalEndRunHolder()
std::atomic< unsigned int > nStreamsStillProcessingBeginRun_
std::shared_ptr< RunPrincipal > & runPrincipal()
LimitedTaskQueue::Resumer globalRunQueueResumer_
void setGlobalEndRunHolder(WaitingTaskHolder holder)
std::vector< std::shared_ptr< const EventSetupImpl > > const & eventSetupImplsEndRun() const
WaitingTaskHolder globalEndRunHolder_
void setResumer(LimitedTaskQueue::Resumer iResumer)
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_
edm::Timestamp const & lastTimestamp() const
std::atomic< char > endTimeSetStatus_
void setHolderOfTaskInProcessRuns(WaitingTaskHolder const &holder)
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImplsEndRun_
WaitingTaskList & endIOVWaitingTasks()
void setEndingEventSetupSucceeded(bool val)
void updateLastTimestamp(edm::Timestamp const &iTime)
std::atomic< unsigned int > nStreamsStillProcessingRun_
EventSetupImpl const & eventSetupImpl(unsigned subProcessIndex) const
WaitingTaskHolder holderOfTaskInProcessRuns_
WaitingTaskHolder & holderOfTaskInProcessRuns()
std::vector< std::shared_ptr< const EventSetupImpl > > & eventSetupImpls()
RunProcessingStatus const & operator=(RunProcessingStatus const &)=delete
HLT enums.
void setStopBeforeProcessingRun(bool val)
std::shared_ptr< RunPrincipal > runPrincipal_
WaitingTaskList & endIOVWaitingTasksEndRun()
std::vector< std::shared_ptr< const EventSetupImpl > > const & eventSetupImpls() const
def move(src, dest)
Definition: eostools.py:511