CMS 3D CMS Logo

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

#include <RunProcessingStatus.h>

Public Member Functions

bool cleaningUpAfterException () const
 
bool didGlobalBeginSucceed () const
 
bool endingEventSetupSucceeded () const
 
WaitingTaskListendIOVWaitingTasks ()
 
WaitingTaskListendIOVWaitingTasksEndRun ()
 
EventSetupImpl const & eventSetupImpl (unsigned subProcessIndex) const
 
EventSetupImpl const & eventSetupImplEndRun (unsigned subProcessIndex) const
 
std::vector< std::shared_ptr< const EventSetupImpl > > & eventSetupImpls ()
 
std::vector< std::shared_ptr< const EventSetupImpl > > const & eventSetupImpls () const
 
std::vector< std::shared_ptr< const EventSetupImpl > > & eventSetupImplsEndRun ()
 
std::vector< std::shared_ptr< const EventSetupImpl > > const & eventSetupImplsEndRun () const
 
void globalBeginDidSucceed ()
 
WaitingTaskHolderglobalEndRunHolder ()
 
WaitingTaskHolderholderOfTaskInProcessRuns ()
 
edm::Timestamp const & lastTimestamp () const
 
RunProcessingStatus const & operator= (RunProcessingStatus const &)=delete
 
void resetBeginResources ()
 
void resetEndResources ()
 
void resumeGlobalRunQueue ()
 
std::shared_ptr< RunPrincipal > & runPrincipal ()
 
 RunProcessingStatus (unsigned int iNStreams, WaitingTaskHolder const &holder)
 
 RunProcessingStatus (RunProcessingStatus const &)=delete
 
void setCleaningUpAfterException (bool val)
 
void setEndingEventSetupSucceeded (bool val)
 
void setEndTime ()
 
void setGlobalEndRunHolder (WaitingTaskHolder holder)
 
void setHolderOfTaskInProcessRuns (WaitingTaskHolder const &holder)
 
void setResumer (LimitedTaskQueue::Resumer iResumer)
 
void setRunPrincipal (std::shared_ptr< RunPrincipal > val)
 
void setStopBeforeProcessingRun (bool val)
 
bool stopBeforeProcessingRun () const
 
bool streamFinishedBeginRun ()
 
bool streamFinishedRun ()
 
void updateLastTimestamp (edm::Timestamp const &iTime)
 

Private Attributes

bool cleaningUpAfterException_ {false}
 
bool endingEventSetupSucceeded_ {true}
 
WaitingTaskList endIOVWaitingTasks_
 
WaitingTaskList endIOVWaitingTasksEndRun_
 
edm::Timestamp endTime_ {}
 
std::atomic< char > endTimeSetStatus_ {0}
 
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_
 
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImplsEndRun_
 
bool globalBeginSucceeded_ {false}
 
WaitingTaskHolder globalEndRunHolder_
 
LimitedTaskQueue::Resumer globalRunQueueResumer_
 
WaitingTaskHolder holderOfTaskInProcessRuns_
 
std::atomic< unsigned int > nStreamsStillProcessingBeginRun_
 
std::atomic< unsigned int > nStreamsStillProcessingRun_
 
std::shared_ptr< RunPrincipalrunPrincipal_
 
bool stopBeforeProcessingRun_ {false}
 

Detailed Description

Description: Keep status information about one Run transition

Definition at line 32 of file RunProcessingStatus.h.

Constructor & Destructor Documentation

◆ RunProcessingStatus() [1/2]

edm::RunProcessingStatus::RunProcessingStatus ( unsigned int  iNStreams,
WaitingTaskHolder const &  holder 
)

Definition at line 13 of file RunProcessingStatus.cc.

16  nStreamsStillProcessingRun_(iNStreams) {}
std::atomic< unsigned int > nStreamsStillProcessingBeginRun_
std::atomic< unsigned int > nStreamsStillProcessingRun_
WaitingTaskHolder holderOfTaskInProcessRuns_

◆ RunProcessingStatus() [2/2]

edm::RunProcessingStatus::RunProcessingStatus ( RunProcessingStatus const &  )
delete

Member Function Documentation

◆ cleaningUpAfterException()

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

Definition at line 94 of file RunProcessingStatus.h.

References cleaningUpAfterException_.

◆ didGlobalBeginSucceed()

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

Definition at line 91 of file RunProcessingStatus.h.

References globalBeginSucceeded_.

◆ endingEventSetupSucceeded()

bool edm::RunProcessingStatus::endingEventSetupSucceeded ( ) const
inline

Definition at line 100 of file RunProcessingStatus.h.

References endingEventSetupSucceeded_.

◆ endIOVWaitingTasks()

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

Definition at line 66 of file RunProcessingStatus.h.

References endIOVWaitingTasks_.

66 { return endIOVWaitingTasks_; }
WaitingTaskList endIOVWaitingTasks_

◆ endIOVWaitingTasksEndRun()

WaitingTaskList& edm::RunProcessingStatus::endIOVWaitingTasksEndRun ( )
inline

Definition at line 73 of file RunProcessingStatus.h.

References endIOVWaitingTasksEndRun_.

73 { return endIOVWaitingTasksEndRun_; }
WaitingTaskList endIOVWaitingTasksEndRun_

◆ eventSetupImpl()

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

Definition at line 55 of file RunProcessingStatus.h.

References eventSetupImpls_.

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

55  {
56  return *eventSetupImpls_.at(subProcessIndex);
57  }
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_

◆ eventSetupImplEndRun()

EventSetupImpl const& edm::RunProcessingStatus::eventSetupImplEndRun ( unsigned  subProcessIndex) const
inline

Definition at line 59 of file RunProcessingStatus.h.

References eventSetupImplsEndRun_.

59  {
60  return *eventSetupImplsEndRun_.at(subProcessIndex);
61  }
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImplsEndRun_

◆ eventSetupImpls() [1/2]

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

Definition at line 63 of file RunProcessingStatus.h.

References eventSetupImpls_.

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

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

◆ eventSetupImpls() [2/2]

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

Definition at line 64 of file RunProcessingStatus.h.

References eventSetupImpls_.

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

◆ eventSetupImplsEndRun() [1/2]

std::vector<std::shared_ptr<const EventSetupImpl> >& edm::RunProcessingStatus::eventSetupImplsEndRun ( )
inline

Definition at line 68 of file RunProcessingStatus.h.

References eventSetupImplsEndRun_.

68 { return eventSetupImplsEndRun_; }
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImplsEndRun_

◆ eventSetupImplsEndRun() [2/2]

std::vector<std::shared_ptr<const EventSetupImpl> > const& edm::RunProcessingStatus::eventSetupImplsEndRun ( ) const
inline

Definition at line 69 of file RunProcessingStatus.h.

References eventSetupImplsEndRun_.

69  {
71  }
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImplsEndRun_

◆ globalBeginDidSucceed()

void edm::RunProcessingStatus::globalBeginDidSucceed ( )
inline

Definition at line 92 of file RunProcessingStatus.h.

References globalBeginSucceeded_.

◆ globalEndRunHolder()

WaitingTaskHolder& edm::RunProcessingStatus::globalEndRunHolder ( )
inline

Definition at line 76 of file RunProcessingStatus.h.

References globalEndRunHolder_.

76 { return globalEndRunHolder_; }
WaitingTaskHolder globalEndRunHolder_

◆ holderOfTaskInProcessRuns()

WaitingTaskHolder& edm::RunProcessingStatus::holderOfTaskInProcessRuns ( )
inline

Definition at line 39 of file RunProcessingStatus.h.

References holderOfTaskInProcessRuns_.

WaitingTaskHolder holderOfTaskInProcessRuns_

◆ lastTimestamp()

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

Definition at line 87 of file RunProcessingStatus.h.

References endTime_.

87 { return endTime_; }

◆ operator=()

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

◆ resetBeginResources()

void edm::RunProcessingStatus::resetBeginResources ( )

Definition at line 18 of file RunProcessingStatus.cc.

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

18  {
19  endIOVWaitingTasks_.doneWaiting(std::exception_ptr{});
20  for (auto& iter : eventSetupImpls_) {
21  iter.reset();
22  }
23  }
WaitingTaskList endIOVWaitingTasks_
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_

◆ resetEndResources()

void edm::RunProcessingStatus::resetEndResources ( )

Definition at line 25 of file RunProcessingStatus.cc.

References edm::WaitingTaskList::doneWaiting(), endIOVWaitingTasksEndRun_, and eventSetupImplsEndRun_.

25  {
26  endIOVWaitingTasksEndRun_.doneWaiting(std::exception_ptr{});
27  for (auto& iter : eventSetupImplsEndRun_) {
28  iter.reset();
29  }
30  }
WaitingTaskList endIOVWaitingTasksEndRun_
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 > > eventSetupImplsEndRun_

◆ resumeGlobalRunQueue()

void edm::RunProcessingStatus::resumeGlobalRunQueue ( )
inline

Definition at line 43 of file RunProcessingStatus.h.

References globalRunQueueResumer_, edm::LimitedTaskQueue::Resumer::resume(), and runPrincipal_.

43  {
44  //free run for next usage
45  runPrincipal_.reset();
47  }
LimitedTaskQueue::Resumer globalRunQueueResumer_
std::shared_ptr< RunPrincipal > runPrincipal_

◆ runPrincipal()

std::shared_ptr<RunPrincipal>& edm::RunProcessingStatus::runPrincipal ( )
inline

◆ setCleaningUpAfterException()

void edm::RunProcessingStatus::setCleaningUpAfterException ( bool  val)
inline

◆ setEndingEventSetupSucceeded()

void edm::RunProcessingStatus::setEndingEventSetupSucceeded ( bool  val)
inline

◆ setEndTime()

void edm::RunProcessingStatus::setEndTime ( )

Definition at line 32 of file RunProcessingStatus.cc.

References endTime_, endTimeSetStatus_, kSet, and runPrincipal_.

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

◆ setGlobalEndRunHolder()

void edm::RunProcessingStatus::setGlobalEndRunHolder ( WaitingTaskHolder  holder)
inline

Definition at line 75 of file RunProcessingStatus.h.

References globalEndRunHolder_, and eostools::move().

75 { globalEndRunHolder_ = std::move(holder); }
WaitingTaskHolder globalEndRunHolder_
def move(src, dest)
Definition: eostools.py:511

◆ setHolderOfTaskInProcessRuns()

void edm::RunProcessingStatus::setHolderOfTaskInProcessRuns ( WaitingTaskHolder const &  holder)
inline

Definition at line 40 of file RunProcessingStatus.h.

References holderOfTaskInProcessRuns_.

40 { holderOfTaskInProcessRuns_ = holder; }
WaitingTaskHolder holderOfTaskInProcessRuns_

◆ setResumer()

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

Definition at line 42 of file RunProcessingStatus.h.

References globalRunQueueResumer_, and eostools::move().

42 { globalRunQueueResumer_ = std::move(iResumer); }
LimitedTaskQueue::Resumer globalRunQueueResumer_
def move(src, dest)
Definition: eostools.py:511

◆ setRunPrincipal()

void edm::RunProcessingStatus::setRunPrincipal ( std::shared_ptr< RunPrincipal val)
inline

Definition at line 50 of file RunProcessingStatus.h.

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

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

◆ setStopBeforeProcessingRun()

void edm::RunProcessingStatus::setStopBeforeProcessingRun ( bool  val)
inline

◆ stopBeforeProcessingRun()

bool edm::RunProcessingStatus::stopBeforeProcessingRun ( ) const
inline

Definition at line 97 of file RunProcessingStatus.h.

References stopBeforeProcessingRun_.

◆ streamFinishedBeginRun()

bool edm::RunProcessingStatus::streamFinishedBeginRun ( )
inline

Definition at line 78 of file RunProcessingStatus.h.

References nStreamsStillProcessingBeginRun_.

78 { return 0 == (--nStreamsStillProcessingBeginRun_); }
std::atomic< unsigned int > nStreamsStillProcessingBeginRun_

◆ streamFinishedRun()

bool edm::RunProcessingStatus::streamFinishedRun ( )
inline

Definition at line 79 of file RunProcessingStatus.h.

References nStreamsStillProcessingRun_.

79 { return 0 == (--nStreamsStillProcessingRun_); }
std::atomic< unsigned int > nStreamsStillProcessingRun_

◆ updateLastTimestamp()

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

Definition at line 82 of file RunProcessingStatus.h.

References endTime_.

82  {
83  if (iTime > endTime_) {
84  endTime_ = iTime;
85  }
86  }

Member Data Documentation

◆ cleaningUpAfterException_

bool edm::RunProcessingStatus::cleaningUpAfterException_ {false}
private

Definition at line 117 of file RunProcessingStatus.h.

Referenced by cleaningUpAfterException(), and setCleaningUpAfterException().

◆ endingEventSetupSucceeded_

bool edm::RunProcessingStatus::endingEventSetupSucceeded_ {true}
private

◆ endIOVWaitingTasks_

WaitingTaskList edm::RunProcessingStatus::endIOVWaitingTasks_
private

Definition at line 108 of file RunProcessingStatus.h.

Referenced by endIOVWaitingTasks(), and resetBeginResources().

◆ endIOVWaitingTasksEndRun_

WaitingTaskList edm::RunProcessingStatus::endIOVWaitingTasksEndRun_
private

Definition at line 110 of file RunProcessingStatus.h.

Referenced by endIOVWaitingTasksEndRun(), and resetEndResources().

◆ endTime_

edm::Timestamp edm::RunProcessingStatus::endTime_ {}
private

Definition at line 114 of file RunProcessingStatus.h.

Referenced by lastTimestamp(), setEndTime(), and updateLastTimestamp().

◆ endTimeSetStatus_

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

Definition at line 115 of file RunProcessingStatus.h.

Referenced by setEndTime().

◆ eventSetupImpls_

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

Definition at line 107 of file RunProcessingStatus.h.

Referenced by eventSetupImpl(), eventSetupImpls(), and resetBeginResources().

◆ eventSetupImplsEndRun_

std::vector<std::shared_ptr<const EventSetupImpl> > edm::RunProcessingStatus::eventSetupImplsEndRun_
private

◆ globalBeginSucceeded_

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

Definition at line 116 of file RunProcessingStatus.h.

Referenced by didGlobalBeginSucceed(), and globalBeginDidSucceed().

◆ globalEndRunHolder_

WaitingTaskHolder edm::RunProcessingStatus::globalEndRunHolder_
private

Definition at line 111 of file RunProcessingStatus.h.

Referenced by globalEndRunHolder(), and setGlobalEndRunHolder().

◆ globalRunQueueResumer_

LimitedTaskQueue::Resumer edm::RunProcessingStatus::globalRunQueueResumer_
private

Definition at line 105 of file RunProcessingStatus.h.

Referenced by resumeGlobalRunQueue(), and setResumer().

◆ holderOfTaskInProcessRuns_

WaitingTaskHolder edm::RunProcessingStatus::holderOfTaskInProcessRuns_
private

◆ nStreamsStillProcessingBeginRun_

std::atomic<unsigned int> edm::RunProcessingStatus::nStreamsStillProcessingBeginRun_
private

Definition at line 112 of file RunProcessingStatus.h.

Referenced by streamFinishedBeginRun().

◆ nStreamsStillProcessingRun_

std::atomic<unsigned int> edm::RunProcessingStatus::nStreamsStillProcessingRun_
private

Definition at line 113 of file RunProcessingStatus.h.

Referenced by streamFinishedRun().

◆ runPrincipal_

std::shared_ptr<RunPrincipal> edm::RunProcessingStatus::runPrincipal_
private

◆ stopBeforeProcessingRun_

bool edm::RunProcessingStatus::stopBeforeProcessingRun_ {false}
private

Definition at line 118 of file RunProcessingStatus.h.

Referenced by setStopBeforeProcessingRun(), and stopBeforeProcessingRun().