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 const &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.

◆ LuminosityBlockProcessingStatus() [2/2]

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

◆ ~LuminosityBlockProcessingStatus()

edm::LuminosityBlockProcessingStatus::~LuminosityBlockProcessingStatus ( )
inline

Definition at line 49 of file LuminosityBlockProcessingStatus.h.

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

49 { endIOVWaitingTasks_.doneWaiting(std::exception_ptr{}); }
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.

Member Function Documentation

◆ cleaningUpAfterException()

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

◆ continuingLumi()

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

◆ didGlobalBeginSucceed()

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

◆ endIOVWaitingTasks()

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

◆ endLumi()

void edm::LuminosityBlockProcessingStatus::endLumi ( )
inline

◆ eventSetupImpl()

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

Definition at line 62 of file LuminosityBlockProcessingStatus.h.

References eventSetupImpls_.

62  {
63  return *eventSetupImpls_.at(subProcessIndex);
64  }
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_

◆ eventSetupImpls() [1/2]

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

Definition at line 66 of file LuminosityBlockProcessingStatus.h.

References eventSetupImpls_.

66 { return eventSetupImpls_; }
std::vector< std::shared_ptr< const EventSetupImpl > > 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.

References eventSetupImpls_.

67 { return eventSetupImpls_; }
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_

◆ globalBeginDidSucceed()

void edm::LuminosityBlockProcessingStatus::globalBeginDidSucceed ( )
inline

◆ haveContinuedLumi()

void edm::LuminosityBlockProcessingStatus::haveContinuedLumi ( )
inline

◆ haveStartedNextLumi()

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

◆ isLumiEnding()

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

◆ lastTimestamp()

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

Definition at line 99 of file LuminosityBlockProcessingStatus.h.

References endTime_.

◆ lumiPrincipal()

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

◆ needToContinueLumi()

void edm::LuminosityBlockProcessingStatus::needToContinueLumi ( )
inline

◆ nextSyncValue()

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

◆ noExceptionHappened()

void edm::LuminosityBlockProcessingStatus::noExceptionHappened ( )
inline

◆ operator=()

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

◆ resetResources()

void LuminosityBlockProcessingStatus::resetResources ( )

Definition at line 20 of file LuminosityBlockProcessingStatus.cc.

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

20  {
21  endIOVWaitingTasks_.doneWaiting(std::exception_ptr{});
22  for (auto& iter : eventSetupImpls_) {
23  iter.reset();
24  }
26  run_.reset();
27  }
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_

◆ resumeGlobalLumiQueue()

void edm::LuminosityBlockProcessingStatus::resumeGlobalLumiQueue ( )
inline

Definition at line 54 of file LuminosityBlockProcessingStatus.h.

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

Referenced by resetResources().

54  {
55  //free lumi for next usage
56  lumiPrincipal_.reset();
58  }
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_

◆ runResource()

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

Definition at line 105 of file LuminosityBlockProcessingStatus.h.

References run_.

105 { return run_; }

◆ setEndTime()

void LuminosityBlockProcessingStatus::setEndTime ( )

Definition at line 29 of file LuminosityBlockProcessingStatus.cc.

References endTime_, endTimeSetStatus_, and lumiPrincipal_.

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  }
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_

◆ setNextSyncValue()

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

◆ setResumer()

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

Definition at line 53 of file LuminosityBlockProcessingStatus.h.

References globalLumiQueueResumer_, and eostools::move().

53 { globalLumiQueueResumer_ = std::move(iResumer); }
def move(src, dest)
Definition: eostools.py:511

◆ startNextLumi()

void edm::LuminosityBlockProcessingStatus::startNextLumi ( )
inline

◆ startProcessingEvents()

void edm::LuminosityBlockProcessingStatus::startProcessingEvents ( )
inline

◆ stopProcessingEvents()

void edm::LuminosityBlockProcessingStatus::stopProcessingEvents ( )
inline

◆ streamFinishedLumi()

bool edm::LuminosityBlockProcessingStatus::streamFinishedLumi ( )
inline

Definition at line 71 of file LuminosityBlockProcessingStatus.h.

References nStreamsStillProcessingLumi_.

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

◆ updateLastTimestamp()

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

Definition at line 94 of file LuminosityBlockProcessingStatus.h.

References endTime_.

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

◆ 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