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
 
void endLumi ()
 
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)
 
std::shared_ptr< LuminosityBlockPrincipal > & lumiPrincipal ()
 
void needToContinueLumi ()
 
const IOVSyncValue nextSyncValue () const
 
void noExceptionHappened ()
 
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
 

Private Attributes

bool cleaningUpAfterException_ {true}
 
bool continuingLumi_ {false}
 
edm::Timestamp endTime_ {}
 
std::atomic< char > endTimeSetStatus_ {0}
 
EventProcessoreventProcessor_ = nullptr
 
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 39 of file LuminosityBlockProcessingStatus.h.

Constructor & Destructor Documentation

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

Definition at line 41 of file LuminosityBlockProcessingStatus.h.

Member Function Documentation

bool edm::LuminosityBlockProcessingStatus::cleaningUpAfterException ( ) const
inline
bool edm::LuminosityBlockProcessingStatus::continuingLumi ( ) const
inline
bool edm::LuminosityBlockProcessingStatus::didGlobalBeginSucceed ( ) const
inline
void edm::LuminosityBlockProcessingStatus::endLumi ( )
inline
void edm::LuminosityBlockProcessingStatus::globalBeginDidSucceed ( )
inline
void edm::LuminosityBlockProcessingStatus::haveContinuedLumi ( )
inline
bool edm::LuminosityBlockProcessingStatus::haveStartedNextLumi ( ) const
inline
bool edm::LuminosityBlockProcessingStatus::isLumiEnding ( ) const
inline
edm::Timestamp const& edm::LuminosityBlockProcessingStatus::lastTimestamp ( ) const
inline

Definition at line 81 of file LuminosityBlockProcessingStatus.h.

References endTime_.

std::shared_ptr<LuminosityBlockPrincipal>& edm::LuminosityBlockProcessingStatus::lumiPrincipal ( )
inline
void edm::LuminosityBlockProcessingStatus::needToContinueLumi ( )
inline
const IOVSyncValue edm::LuminosityBlockProcessingStatus::nextSyncValue ( ) const
inline
void edm::LuminosityBlockProcessingStatus::noExceptionHappened ( )
inline
void edm::LuminosityBlockProcessingStatus::resumeGlobalLumiQueue ( )
inline

Definition at line 47 of file LuminosityBlockProcessingStatus.h.

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

47  {
48  //free lumi for next usage
49  lumiPrincipal_.reset();
51  }
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
std::shared_ptr<void> const& edm::LuminosityBlockProcessingStatus::runResource ( ) const
inline

Definition at line 87 of file LuminosityBlockProcessingStatus.h.

References run_, and setEndTime().

87 { return run_; }
void LuminosityBlockProcessingStatus::setEndTime ( )

Definition at line 20 of file LuminosityBlockProcessingStatus.cc.

References endTime_, endTimeSetStatus_, and lumiPrincipal_.

Referenced by runResource().

20  {
21  if (2 != endTimeSetStatus_) {
22  //not already set
23  char expected = 0;
24  if (endTimeSetStatus_.compare_exchange_strong(expected, 1)) {
25  lumiPrincipal_->setEndTime(endTime_);
26  endTimeSetStatus_.store(2);
27  } else {
28  //wait until time is set
29  while (2 != endTimeSetStatus_.load()) {
30  }
31  }
32  }
33  }
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
void edm::LuminosityBlockProcessingStatus::setNextSyncValue ( IOVSyncValue  iValue)
inline
void edm::LuminosityBlockProcessingStatus::setResumer ( LimitedTaskQueue::Resumer  iResumer)
inline

Definition at line 46 of file LuminosityBlockProcessingStatus.h.

References globalLumiQueueResumer_, and eostools::move().

46 { globalLumiQueueResumer_ = std::move(iResumer); }
def move(src, dest)
Definition: eostools.py:511
void edm::LuminosityBlockProcessingStatus::startNextLumi ( )
inline
void edm::LuminosityBlockProcessingStatus::startProcessingEvents ( )
inline
void edm::LuminosityBlockProcessingStatus::stopProcessingEvents ( )
inline
bool edm::LuminosityBlockProcessingStatus::streamFinishedLumi ( )
inline

Definition at line 53 of file LuminosityBlockProcessingStatus.h.

References nStreamsStillProcessingLumi_.

53 { return 0 == (--nStreamsStillProcessingLumi_); }
std::atomic< unsigned int > nStreamsStillProcessingLumi_
void edm::LuminosityBlockProcessingStatus::updateLastTimestamp ( edm::Timestamp const &  iTime)
inline

Definition at line 76 of file LuminosityBlockProcessingStatus.h.

References endTime_.

76  {
77  if (iTime > endTime_) {
78  endTime_ = iTime;
79  }
80  }
bool edm::LuminosityBlockProcessingStatus::wasEventProcessingStopped ( ) const
inline

Member Data Documentation

bool edm::LuminosityBlockProcessingStatus::cleaningUpAfterException_ {true}
private
bool edm::LuminosityBlockProcessingStatus::continuingLumi_ {false}
private
edm::Timestamp edm::LuminosityBlockProcessingStatus::endTime_ {}
private
std::atomic<char> edm::LuminosityBlockProcessingStatus::endTimeSetStatus_ {0}
private

Definition at line 101 of file LuminosityBlockProcessingStatus.h.

Referenced by setEndTime().

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

Definition at line 97 of file LuminosityBlockProcessingStatus.h.

bool edm::LuminosityBlockProcessingStatus::globalBeginSucceeded_ {false}
private
LimitedTaskQueue::Resumer edm::LuminosityBlockProcessingStatus::globalLumiQueueResumer_
private

Definition at line 96 of file LuminosityBlockProcessingStatus.h.

Referenced by resumeGlobalLumiQueue(), and setResumer().

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

Definition at line 103 of file LuminosityBlockProcessingStatus.h.

Referenced by endLumi(), and isLumiEnding().

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

Definition at line 98 of file LuminosityBlockProcessingStatus.h.

Referenced by nextSyncValue(), and setNextSyncValue().

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

Definition at line 99 of file LuminosityBlockProcessingStatus.h.

Referenced by streamFinishedLumi().

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

Definition at line 95 of file LuminosityBlockProcessingStatus.h.

Referenced by runResource().

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

Definition at line 106 of file LuminosityBlockProcessingStatus.h.

Referenced by haveStartedNextLumi(), and startNextLumi().

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