CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::LuminosityBlockProcessingStatus Class Reference

#include <LuminosityBlockProcessingStatus.h>

Public Member Functions

bool cleaningUpAfterException () const
 
bool continuingLumi () const
 
bool didGlobalBeginSucceed () const
 
WaitingTaskListendIOVWaitingTasks ()
 
void endLumi ()
 
EventSetupImpl const & eventSetupImpl (unsigned subProcessIndex) const
 
std::vector< std::shared_ptr< const EventSetupImpl > > & eventSetupImpls ()
 
std::vector< std::shared_ptr< const EventSetupImpl > > const & eventSetupImpls () const
 
void globalBeginDidSucceed ()
 
void haveContinuedLumi ()
 
bool haveStartedNextLumi () const
 
bool isLumiEnding () const
 
edm::Timestamp const & lastTimestamp () const
 
 LuminosityBlockProcessingStatus (EventProcessor *iEP, unsigned int iNStreams, std::shared_ptr< void > iRunResource)
 
 LuminosityBlockProcessingStatus (LuminosityBlockProcessingStatus const &)=delete
 
std::shared_ptr< LuminosityBlockPrincipal > & lumiPrincipal ()
 
void needToContinueLumi ()
 
const IOVSyncValue nextSyncValue () const
 
void noExceptionHappened ()
 
LuminosityBlockProcessingStatus const & operator= (LuminosityBlockProcessingStatus const &)=delete
 
void resetResources ()
 
void resumeGlobalLumiQueue ()
 
std::shared_ptr< void > const & runResource () const
 
void setEndTime ()
 
void setNextSyncValue (IOVSyncValue iValue)
 
void setResumer (LimitedTaskQueue::Resumer iResumer)
 
void startNextLumi ()
 
void startProcessingEvents ()
 
void stopProcessingEvents ()
 
bool streamFinishedLumi ()
 
void updateLastTimestamp (edm::Timestamp const &iTime)
 
bool wasEventProcessingStopped () const
 
 ~LuminosityBlockProcessingStatus ()
 

Private Attributes

bool cleaningUpAfterException_ {true}
 
bool continuingLumi_ {false}
 
WaitingTaskList endIOVWaitingTasks_
 
edm::Timestamp endTime_ {}
 
std::atomic< char > endTimeSetStatus_ {0}
 
EventProcessoreventProcessor_ = nullptr
 
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_
 
bool globalBeginSucceeded_ {false}
 
LimitedTaskQueue::Resumer globalLumiQueueResumer_
 
bool lumiEnding_
 
std::shared_ptr< LuminosityBlockPrincipallumiPrincipal_
 
IOVSyncValue nextSyncValue_
 
std::atomic< unsigned int > nStreamsStillProcessingLumi_ {0}
 
std::shared_ptr< void > run_
 
bool startedNextLumi_ {false}
 
bool stopProcessingEvents_ {false}
 

Detailed Description

Definition at line 41 of file LuminosityBlockProcessingStatus.h.

Constructor & Destructor Documentation

◆ LuminosityBlockProcessingStatus() [1/2]

edm::LuminosityBlockProcessingStatus::LuminosityBlockProcessingStatus ( EventProcessor iEP,
unsigned int  iNStreams,
std::shared_ptr< void >  iRunResource 
)
inline

Definition at line 43 of file LuminosityBlockProcessingStatus.h.

44  : run_(std::move(iRunResource)), eventProcessor_(iEP), nStreamsStillProcessingLumi_(iNStreams) {}

◆ LuminosityBlockProcessingStatus() [2/2]

edm::LuminosityBlockProcessingStatus::LuminosityBlockProcessingStatus ( LuminosityBlockProcessingStatus const &  )
delete

◆ ~LuminosityBlockProcessingStatus()

edm::LuminosityBlockProcessingStatus::~LuminosityBlockProcessingStatus ( )
inline

Definition at line 49 of file LuminosityBlockProcessingStatus.h.

49 { endIOVWaitingTasks_.doneWaiting(std::exception_ptr{}); }

References edm::WaitingTaskList::doneWaiting(), and endIOVWaitingTasks_.

Member Function Documentation

◆ cleaningUpAfterException()

bool edm::LuminosityBlockProcessingStatus::cleaningUpAfterException ( ) const
inline

Definition at line 91 of file LuminosityBlockProcessingStatus.h.

91 { return cleaningUpAfterException_; }

References cleaningUpAfterException_.

◆ continuingLumi()

bool edm::LuminosityBlockProcessingStatus::continuingLumi ( ) const
inline

Definition at line 80 of file LuminosityBlockProcessingStatus.h.

80 { return continuingLumi_; }

References continuingLumi_.

Referenced by edm::EventProcessor::readNextEventForStream().

◆ didGlobalBeginSucceed()

bool edm::LuminosityBlockProcessingStatus::didGlobalBeginSucceed ( ) const
inline

Definition at line 87 of file LuminosityBlockProcessingStatus.h.

87 { return globalBeginSucceeded_; }

References globalBeginSucceeded_.

◆ endIOVWaitingTasks()

WaitingTaskList& edm::LuminosityBlockProcessingStatus::endIOVWaitingTasks ( )
inline

Definition at line 69 of file LuminosityBlockProcessingStatus.h.

69 { return endIOVWaitingTasks_; }

References endIOVWaitingTasks_.

◆ endLumi()

void edm::LuminosityBlockProcessingStatus::endLumi ( )
inline

◆ eventSetupImpl()

EventSetupImpl const& edm::LuminosityBlockProcessingStatus::eventSetupImpl ( unsigned  subProcessIndex) const
inline

Definition at line 62 of file LuminosityBlockProcessingStatus.h.

62  {
63  return *eventSetupImpls_.at(subProcessIndex);
64  }

References eventSetupImpls_.

◆ eventSetupImpls() [1/2]

std::vector<std::shared_ptr<const EventSetupImpl> >& edm::LuminosityBlockProcessingStatus::eventSetupImpls ( )
inline

Definition at line 66 of file LuminosityBlockProcessingStatus.h.

66 { return eventSetupImpls_; }

References eventSetupImpls_.

◆ eventSetupImpls() [2/2]

std::vector<std::shared_ptr<const EventSetupImpl> > const& edm::LuminosityBlockProcessingStatus::eventSetupImpls ( ) const
inline

Definition at line 67 of file LuminosityBlockProcessingStatus.h.

67 { return eventSetupImpls_; }

References eventSetupImpls_.

◆ globalBeginDidSucceed()

void edm::LuminosityBlockProcessingStatus::globalBeginDidSucceed ( )
inline

Definition at line 88 of file LuminosityBlockProcessingStatus.h.

88 { globalBeginSucceeded_ = true; }

References globalBeginSucceeded_.

◆ haveContinuedLumi()

void edm::LuminosityBlockProcessingStatus::haveContinuedLumi ( )
inline

Definition at line 81 of file LuminosityBlockProcessingStatus.h.

81 { continuingLumi_ = false; }

References continuingLumi_.

Referenced by edm::EventProcessor::readNextEventForStream().

◆ haveStartedNextLumi()

bool edm::LuminosityBlockProcessingStatus::haveStartedNextLumi ( ) const
inline

Definition at line 84 of file LuminosityBlockProcessingStatus.h.

84 { return startedNextLumi_; }

References startedNextLumi_.

◆ isLumiEnding()

bool edm::LuminosityBlockProcessingStatus::isLumiEnding ( ) const
inline

Definition at line 77 of file LuminosityBlockProcessingStatus.h.

77 { return lumiEnding_; }

References lumiEnding_.

◆ lastTimestamp()

edm::Timestamp const& edm::LuminosityBlockProcessingStatus::lastTimestamp ( ) const
inline

Definition at line 99 of file LuminosityBlockProcessingStatus.h.

99 { return endTime_; }

References endTime_.

◆ lumiPrincipal()

std::shared_ptr<LuminosityBlockPrincipal>& edm::LuminosityBlockProcessingStatus::lumiPrincipal ( )
inline

◆ needToContinueLumi()

void edm::LuminosityBlockProcessingStatus::needToContinueLumi ( )
inline

Definition at line 82 of file LuminosityBlockProcessingStatus.h.

82 { continuingLumi_ = true; }

References continuingLumi_.

◆ nextSyncValue()

const IOVSyncValue edm::LuminosityBlockProcessingStatus::nextSyncValue ( ) const
inline

Definition at line 103 of file LuminosityBlockProcessingStatus.h.

103 { return nextSyncValue_; }

References nextSyncValue_.

◆ noExceptionHappened()

void edm::LuminosityBlockProcessingStatus::noExceptionHappened ( )
inline

Definition at line 90 of file LuminosityBlockProcessingStatus.h.

90 { cleaningUpAfterException_ = false; }

References cleaningUpAfterException_.

◆ operator=()

LuminosityBlockProcessingStatus const& edm::LuminosityBlockProcessingStatus::operator= ( LuminosityBlockProcessingStatus const &  )
delete

◆ resetResources()

void LuminosityBlockProcessingStatus::resetResources ( )

Definition at line 20 of file LuminosityBlockProcessingStatus.cc.

20  {
21  endIOVWaitingTasks_.doneWaiting(std::exception_ptr{});
22  for (auto& iter : eventSetupImpls_) {
23  iter.reset();
24  }
26  run_.reset();
27  }

References edm::WaitingTaskList::doneWaiting(), endIOVWaitingTasks_, eventSetupImpls_, resumeGlobalLumiQueue(), and run_.

◆ resumeGlobalLumiQueue()

void edm::LuminosityBlockProcessingStatus::resumeGlobalLumiQueue ( )
inline

Definition at line 54 of file LuminosityBlockProcessingStatus.h.

54  {
55  //free lumi for next usage
56  lumiPrincipal_.reset();
58  }

References globalLumiQueueResumer_, lumiPrincipal_, and edm::LimitedTaskQueue::Resumer::resume().

Referenced by resetResources().

◆ runResource()

std::shared_ptr<void> const& edm::LuminosityBlockProcessingStatus::runResource ( ) const
inline

Definition at line 105 of file LuminosityBlockProcessingStatus.h.

105 { return run_; }

References run_.

◆ setEndTime()

void LuminosityBlockProcessingStatus::setEndTime ( )

Definition at line 29 of file LuminosityBlockProcessingStatus.cc.

29  {
30  if (2 != endTimeSetStatus_) {
31  //not already set
32  char expected = 0;
33  if (endTimeSetStatus_.compare_exchange_strong(expected, 1)) {
34  lumiPrincipal_->setEndTime(endTime_);
35  endTimeSetStatus_.store(2);
36  } else {
37  //wait until time is set
38  while (2 != endTimeSetStatus_.load()) {
39  }
40  }
41  }
42  }

References endTime_, endTimeSetStatus_, and lumiPrincipal_.

◆ setNextSyncValue()

void edm::LuminosityBlockProcessingStatus::setNextSyncValue ( IOVSyncValue  iValue)
inline

◆ setResumer()

void edm::LuminosityBlockProcessingStatus::setResumer ( LimitedTaskQueue::Resumer  iResumer)
inline

Definition at line 53 of file LuminosityBlockProcessingStatus.h.

53 { globalLumiQueueResumer_ = std::move(iResumer); }

References globalLumiQueueResumer_, and eostools::move().

◆ startNextLumi()

void edm::LuminosityBlockProcessingStatus::startNextLumi ( )
inline

Definition at line 85 of file LuminosityBlockProcessingStatus.h.

85 { startedNextLumi_ = true; }

References startedNextLumi_.

◆ startProcessingEvents()

void edm::LuminosityBlockProcessingStatus::startProcessingEvents ( )
inline

Definition at line 75 of file LuminosityBlockProcessingStatus.h.

75 { stopProcessingEvents_ = false; }

References stopProcessingEvents_.

◆ stopProcessingEvents()

void edm::LuminosityBlockProcessingStatus::stopProcessingEvents ( )
inline

◆ streamFinishedLumi()

bool edm::LuminosityBlockProcessingStatus::streamFinishedLumi ( )
inline

Definition at line 71 of file LuminosityBlockProcessingStatus.h.

71 { return 0 == (--nStreamsStillProcessingLumi_); }

References nStreamsStillProcessingLumi_.

◆ updateLastTimestamp()

void edm::LuminosityBlockProcessingStatus::updateLastTimestamp ( edm::Timestamp const &  iTime)
inline

Definition at line 94 of file LuminosityBlockProcessingStatus.h.

94  {
95  if (iTime > endTime_) {
96  endTime_ = iTime;
97  }
98  }

References endTime_.

◆ wasEventProcessingStopped()

bool edm::LuminosityBlockProcessingStatus::wasEventProcessingStopped ( ) const
inline

Member Data Documentation

◆ cleaningUpAfterException_

bool edm::LuminosityBlockProcessingStatus::cleaningUpAfterException_ {true}
private

◆ continuingLumi_

bool edm::LuminosityBlockProcessingStatus::continuingLumi_ {false}
private

◆ endIOVWaitingTasks_

WaitingTaskList edm::LuminosityBlockProcessingStatus::endIOVWaitingTasks_
private

◆ endTime_

edm::Timestamp edm::LuminosityBlockProcessingStatus::endTime_ {}
private

◆ endTimeSetStatus_

std::atomic<char> edm::LuminosityBlockProcessingStatus::endTimeSetStatus_ {0}
private

Definition at line 121 of file LuminosityBlockProcessingStatus.h.

Referenced by setEndTime().

◆ eventProcessor_

EventProcessor* edm::LuminosityBlockProcessingStatus::eventProcessor_ = nullptr
private

Definition at line 117 of file LuminosityBlockProcessingStatus.h.

◆ eventSetupImpls_

std::vector<std::shared_ptr<const EventSetupImpl> > edm::LuminosityBlockProcessingStatus::eventSetupImpls_
private

◆ globalBeginSucceeded_

bool edm::LuminosityBlockProcessingStatus::globalBeginSucceeded_ {false}
private

◆ globalLumiQueueResumer_

LimitedTaskQueue::Resumer edm::LuminosityBlockProcessingStatus::globalLumiQueueResumer_
private

Definition at line 113 of file LuminosityBlockProcessingStatus.h.

Referenced by resumeGlobalLumiQueue(), and setResumer().

◆ lumiEnding_

bool edm::LuminosityBlockProcessingStatus::lumiEnding_
private
Initial value:
{
false}

Definition at line 123 of file LuminosityBlockProcessingStatus.h.

Referenced by endLumi(), and isLumiEnding().

◆ lumiPrincipal_

std::shared_ptr<LuminosityBlockPrincipal> edm::LuminosityBlockProcessingStatus::lumiPrincipal_
private

◆ nextSyncValue_

IOVSyncValue edm::LuminosityBlockProcessingStatus::nextSyncValue_
private

Definition at line 118 of file LuminosityBlockProcessingStatus.h.

Referenced by nextSyncValue(), and setNextSyncValue().

◆ nStreamsStillProcessingLumi_

std::atomic<unsigned int> edm::LuminosityBlockProcessingStatus::nStreamsStillProcessingLumi_ {0}
private

Definition at line 119 of file LuminosityBlockProcessingStatus.h.

Referenced by streamFinishedLumi().

◆ run_

std::shared_ptr<void> edm::LuminosityBlockProcessingStatus::run_
private

Definition at line 112 of file LuminosityBlockProcessingStatus.h.

Referenced by resetResources(), and runResource().

◆ startedNextLumi_

bool edm::LuminosityBlockProcessingStatus::startedNextLumi_ {false}
private

Definition at line 126 of file LuminosityBlockProcessingStatus.h.

Referenced by haveStartedNextLumi(), and startNextLumi().

◆ stopProcessingEvents_

bool edm::LuminosityBlockProcessingStatus::stopProcessingEvents_ {false}
private
edm::LuminosityBlockProcessingStatus::startedNextLumi_
bool startedNextLumi_
Definition: LuminosityBlockProcessingStatus.h:126
edm::LuminosityBlockProcessingStatus::nStreamsStillProcessingLumi_
std::atomic< unsigned int > nStreamsStillProcessingLumi_
Definition: LuminosityBlockProcessingStatus.h:119
edm::LuminosityBlockProcessingStatus::endTimeSetStatus_
std::atomic< char > endTimeSetStatus_
Definition: LuminosityBlockProcessingStatus.h:121
edm::LuminosityBlockProcessingStatus::continuingLumi_
bool continuingLumi_
Definition: LuminosityBlockProcessingStatus.h:125
edm::LuminosityBlockProcessingStatus::run_
std::shared_ptr< void > run_
Definition: LuminosityBlockProcessingStatus.h:112
edm::LuminosityBlockProcessingStatus::eventSetupImpls_
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_
Definition: LuminosityBlockProcessingStatus.h:115
edm::LuminosityBlockProcessingStatus::lumiEnding_
bool lumiEnding_
Definition: LuminosityBlockProcessingStatus.h:123
edm::LuminosityBlockProcessingStatus::cleaningUpAfterException_
bool cleaningUpAfterException_
Definition: LuminosityBlockProcessingStatus.h:128
edm::LuminosityBlockProcessingStatus::globalBeginSucceeded_
bool globalBeginSucceeded_
Definition: LuminosityBlockProcessingStatus.h:127
edm::WaitingTaskList::doneWaiting
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
Definition: WaitingTaskList.cc:169
edm::LuminosityBlockProcessingStatus::globalLumiQueueResumer_
LimitedTaskQueue::Resumer globalLumiQueueResumer_
Definition: LuminosityBlockProcessingStatus.h:113
edm::LuminosityBlockProcessingStatus::lumiPrincipal_
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
Definition: LuminosityBlockProcessingStatus.h:114
edm::LuminosityBlockProcessingStatus::endIOVWaitingTasks_
WaitingTaskList endIOVWaitingTasks_
Definition: LuminosityBlockProcessingStatus.h:116
edm::LuminosityBlockProcessingStatus::stopProcessingEvents_
bool stopProcessingEvents_
Definition: LuminosityBlockProcessingStatus.h:122
edm::LuminosityBlockProcessingStatus::endTime_
edm::Timestamp endTime_
Definition: LuminosityBlockProcessingStatus.h:120
edm::LuminosityBlockProcessingStatus::nextSyncValue_
IOVSyncValue nextSyncValue_
Definition: LuminosityBlockProcessingStatus.h:118
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::LuminosityBlockProcessingStatus::resumeGlobalLumiQueue
void resumeGlobalLumiQueue()
Definition: LuminosityBlockProcessingStatus.h:54
edm::LimitedTaskQueue::Resumer::resume
bool resume()
Definition: LimitedTaskQueue.h:94
edm::LuminosityBlockProcessingStatus::eventProcessor_
EventProcessor * eventProcessor_
Definition: LuminosityBlockProcessingStatus.h:117