CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< LuminosityBlockPrincipal
lumiPrincipal_
 
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

edm::LuminosityBlockProcessingStatus::LuminosityBlockProcessingStatus ( EventProcessor iEP,
unsigned int  iNStreams,
std::shared_ptr< void >  iRunResource 
)
inline
edm::LuminosityBlockProcessingStatus::LuminosityBlockProcessingStatus ( LuminosityBlockProcessingStatus const &  )
delete
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

bool edm::LuminosityBlockProcessingStatus::cleaningUpAfterException ( ) const
inline
bool edm::LuminosityBlockProcessingStatus::continuingLumi ( ) const
inline
bool edm::LuminosityBlockProcessingStatus::didGlobalBeginSucceed ( ) const
inline
WaitingTaskList& edm::LuminosityBlockProcessingStatus::endIOVWaitingTasks ( )
inline
void edm::LuminosityBlockProcessingStatus::endLumi ( )
inline
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_
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_
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_
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 99 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

Definition at line 103 of file LuminosityBlockProcessingStatus.h.

References nextSyncValue_.

void edm::LuminosityBlockProcessingStatus::noExceptionHappened ( )
inline
LuminosityBlockProcessingStatus const& edm::LuminosityBlockProcessingStatus::operator= ( LuminosityBlockProcessingStatus const &  )
delete
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_
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_
std::shared_ptr<void> const& edm::LuminosityBlockProcessingStatus::runResource ( ) const
inline

Definition at line 105 of file LuminosityBlockProcessingStatus.h.

References run_.

105 { return run_; }
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_
void edm::LuminosityBlockProcessingStatus::setNextSyncValue ( IOVSyncValue const &  iValue)
inline
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
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 71 of file LuminosityBlockProcessingStatus.h.

References nStreamsStillProcessingLumi_.

71 { return 0 == (--nStreamsStillProcessingLumi_); }
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  }
bool edm::LuminosityBlockProcessingStatus::wasEventProcessingStopped ( ) const
inline

Member Data Documentation

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

Definition at line 121 of file LuminosityBlockProcessingStatus.h.

Referenced by setEndTime().

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

Definition at line 117 of file LuminosityBlockProcessingStatus.h.

std::vector<std::shared_ptr<const EventSetupImpl> > edm::LuminosityBlockProcessingStatus::eventSetupImpls_
private
bool edm::LuminosityBlockProcessingStatus::globalBeginSucceeded_ {false}
private
LimitedTaskQueue::Resumer edm::LuminosityBlockProcessingStatus::globalLumiQueueResumer_
private

Definition at line 113 of file LuminosityBlockProcessingStatus.h.

Referenced by resumeGlobalLumiQueue(), and setResumer().

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

Definition at line 123 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 118 of file LuminosityBlockProcessingStatus.h.

Referenced by nextSyncValue(), and setNextSyncValue().

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

Definition at line 119 of file LuminosityBlockProcessingStatus.h.

Referenced by streamFinishedLumi().

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

Definition at line 112 of file LuminosityBlockProcessingStatus.h.

Referenced by resetResources(), and runResource().

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

Definition at line 126 of file LuminosityBlockProcessingStatus.h.

Referenced by haveStartedNextLumi(), and startNextLumi().

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