CMS 3D CMS Logo

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

#include <LuminosityBlockProcessingStatus.h>

Public Types

enum  EventProcessingState { EventProcessingState::kProcessing, EventProcessingState::kPauseForFileTransition, EventProcessingState::kStopLumi }
 

Public Member Functions

bool cleaningUpAfterException () const
 
bool didGlobalBeginSucceed () const
 
WaitingTaskListendIOVWaitingTasks ()
 
EventProcessingState eventProcessingState () const
 
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 globalEndRunHolderDoneWaiting ()
 
bool haveStartedNextLumiOrEndedRun () const
 
edm::Timestamp const & lastTimestamp () const
 
 LuminosityBlockProcessingStatus (unsigned int iNStreams)
 
 LuminosityBlockProcessingStatus (LuminosityBlockProcessingStatus const &)=delete
 
std::shared_ptr< LuminosityBlockPrincipal > & lumiPrincipal ()
 
LuminosityBlockProcessingStatus const & operator= (LuminosityBlockProcessingStatus const &)=delete
 
void resetResources ()
 
void resumeGlobalLumiQueue ()
 
void setCleaningUpAfterException (bool value)
 
void setEndTime ()
 
void setEventProcessingState (EventProcessingState val)
 
void setGlobalEndRunHolder (WaitingTaskHolder)
 
void setLumiPrincipal (std::shared_ptr< LuminosityBlockPrincipal > val)
 
void setResumer (LimitedTaskQueue::Resumer iResumer)
 
void startNextLumiOrEndRun ()
 
bool streamFinishedLumi ()
 
void updateLastTimestamp (edm::Timestamp const &iTime)
 
 ~LuminosityBlockProcessingStatus ()
 

Private Attributes

bool cleaningUpAfterException_ {false}
 
WaitingTaskList endIOVWaitingTasks_
 
edm::Timestamp endTime_ {}
 
std::atomic< char > endTimeSetStatus_ {0}
 
EventProcessingState eventProcessingState_ {EventProcessingState::kProcessing}
 
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_
 
bool globalBeginSucceeded_ {false}
 
edm::WaitingTaskHolder globalEndRunHolder_
 
LimitedTaskQueue::Resumer globalLumiQueueResumer_
 
std::shared_ptr< LuminosityBlockPrincipallumiPrincipal_
 
std::atomic< unsigned int > nStreamsStillProcessingLumi_ {0}
 
bool startedNextLumiOrEndedRun_ {false}
 

Detailed Description

Description: Keep status information about one LuminosityBlock transition

Usage: <usage>

Definition at line 40 of file LuminosityBlockProcessingStatus.h.

Member Enumeration Documentation

◆ EventProcessingState

Enumerator
kProcessing 
kPauseForFileTransition 
kStopLumi 

Definition at line 86 of file LuminosityBlockProcessingStatus.h.

86 { kProcessing, kPauseForFileTransition, kStopLumi };

Constructor & Destructor Documentation

◆ LuminosityBlockProcessingStatus() [1/2]

edm::LuminosityBlockProcessingStatus::LuminosityBlockProcessingStatus ( unsigned int  iNStreams)
inline

Definition at line 42 of file LuminosityBlockProcessingStatus.h.

42 : nStreamsStillProcessingLumi_(iNStreams) {}

◆ LuminosityBlockProcessingStatus() [2/2]

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

◆ ~LuminosityBlockProcessingStatus()

edm::LuminosityBlockProcessingStatus::~LuminosityBlockProcessingStatus ( )
inline

Definition at line 47 of file LuminosityBlockProcessingStatus.h.

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

47 { 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

◆ didGlobalBeginSucceed()

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

◆ endIOVWaitingTasks()

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

◆ eventProcessingState()

EventProcessingState edm::LuminosityBlockProcessingStatus::eventProcessingState ( ) const
inline

◆ eventSetupImpl()

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

Definition at line 61 of file LuminosityBlockProcessingStatus.h.

References eventSetupImpls_.

61  {
62  return *eventSetupImpls_.at(subProcessIndex);
63  }
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 65 of file LuminosityBlockProcessingStatus.h.

References eventSetupImpls_.

65 { 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 66 of file LuminosityBlockProcessingStatus.h.

References eventSetupImpls_.

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

◆ globalBeginDidSucceed()

void edm::LuminosityBlockProcessingStatus::globalBeginDidSucceed ( )
inline

◆ globalEndRunHolderDoneWaiting()

void edm::LuminosityBlockProcessingStatus::globalEndRunHolderDoneWaiting ( )
inline

Definition at line 71 of file LuminosityBlockProcessingStatus.h.

References edm::WaitingTaskHolder::doneWaiting(), and globalEndRunHolder_.

71 { globalEndRunHolder_.doneWaiting(std::exception_ptr{}); }
void doneWaiting(std::exception_ptr iExcept)

◆ haveStartedNextLumiOrEndedRun()

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

◆ lastTimestamp()

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

Definition at line 81 of file LuminosityBlockProcessingStatus.h.

References endTime_.

◆ lumiPrincipal()

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

◆ operator=()

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

◆ resetResources()

void edm::LuminosityBlockProcessingStatus::resetResources ( )

Definition at line 17 of file LuminosityBlockProcessingStatus.cc.

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

17  {
18  endIOVWaitingTasks_.doneWaiting(std::exception_ptr{});
19  for (auto& iter : eventSetupImpls_) {
20  iter.reset();
21  }
23  }
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 50 of file LuminosityBlockProcessingStatus.h.

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

Referenced by resetResources().

50  {
51  //free lumi for next usage
52  lumiPrincipal_.reset();
54  }
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_

◆ setCleaningUpAfterException()

void edm::LuminosityBlockProcessingStatus::setCleaningUpAfterException ( bool  value)
inline

◆ setEndTime()

void edm::LuminosityBlockProcessingStatus::setEndTime ( )

Definition at line 29 of file LuminosityBlockProcessingStatus.cc.

References endTime_, endTimeSetStatus_, kSet, and lumiPrincipal_.

29  {
30  constexpr char kUnset = 0;
31  constexpr char kSetting = 1;
32  constexpr char kSet = 2;
33 
34  if (endTimeSetStatus_ != kSet) {
35  //not already set
36  char expected = kUnset;
37  if (endTimeSetStatus_.compare_exchange_strong(expected, kSetting)) {
38  lumiPrincipal_->setEndTime(endTime_);
39  endTimeSetStatus_.store(kSet);
40  } else {
41  //wait until time is set
42  while (endTimeSetStatus_.load() != kSet) {
43  }
44  }
45  }
46  }
const char * kSet
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_

◆ setEventProcessingState()

void edm::LuminosityBlockProcessingStatus::setEventProcessingState ( EventProcessingState  val)
inline

◆ setGlobalEndRunHolder()

void edm::LuminosityBlockProcessingStatus::setGlobalEndRunHolder ( WaitingTaskHolder  holder)

Definition at line 25 of file LuminosityBlockProcessingStatus.cc.

References globalEndRunHolder_, and eostools::move().

25  {
27  }
def move(src, dest)
Definition: eostools.py:511

◆ setLumiPrincipal()

void edm::LuminosityBlockProcessingStatus::setLumiPrincipal ( std::shared_ptr< LuminosityBlockPrincipal val)
inline

Definition at line 59 of file LuminosityBlockProcessingStatus.h.

References lumiPrincipal_, eostools::move(), and heppy_batch::val.

std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
def move(src, dest)
Definition: eostools.py:511

◆ setResumer()

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

Definition at line 49 of file LuminosityBlockProcessingStatus.h.

References globalLumiQueueResumer_, and eostools::move().

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

◆ startNextLumiOrEndRun()

void edm::LuminosityBlockProcessingStatus::startNextLumiOrEndRun ( )
inline

◆ streamFinishedLumi()

bool edm::LuminosityBlockProcessingStatus::streamFinishedLumi ( )
inline

Definition at line 73 of file LuminosityBlockProcessingStatus.h.

References nStreamsStillProcessingLumi_.

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

◆ updateLastTimestamp()

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  }

Member Data Documentation

◆ cleaningUpAfterException_

bool edm::LuminosityBlockProcessingStatus::cleaningUpAfterException_ {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 108 of file LuminosityBlockProcessingStatus.h.

Referenced by setEndTime().

◆ eventProcessingState_

EventProcessingState edm::LuminosityBlockProcessingStatus::eventProcessingState_ {EventProcessingState::kProcessing}
private

◆ eventSetupImpls_

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

◆ globalBeginSucceeded_

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

◆ globalEndRunHolder_

edm::WaitingTaskHolder edm::LuminosityBlockProcessingStatus::globalEndRunHolder_
private

◆ globalLumiQueueResumer_

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

Definition at line 101 of file LuminosityBlockProcessingStatus.h.

Referenced by resumeGlobalLumiQueue(), and setResumer().

◆ lumiPrincipal_

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

◆ nStreamsStillProcessingLumi_

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

Definition at line 106 of file LuminosityBlockProcessingStatus.h.

Referenced by streamFinishedLumi().

◆ startedNextLumiOrEndedRun_

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