CMS 3D CMS Logo

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

#include <NumberOfConcurrentIOVs.h>

Public Member Functions

void clear ()
 
void fillRecordsNotAllowingConcurrentIOVs (EventSetupProvider const &)
 
 NumberOfConcurrentIOVs ()
 
unsigned int numberOfConcurrentIOVs (EventSetupRecordKey const &, bool printInfoMsg=false) const
 
void readConfigurationParameters (ParameterSet const *eventSetupPset, unsigned int maxConcurrentIOVs, bool dumpOptions)
 

Private Attributes

std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
 
unsigned int maxConcurrentIOVs_ = 1
 
unsigned int numberConcurrentIOVs_
 
std::set< EventSetupRecordKeyrecordsNotAllowingConcurrentIOVs_
 

Detailed Description

Description: Calculates and holds the number of concurrent intervals of validity allowed for each record in the EventSetup.

Usage: Used internally by the Framework

Definition at line 35 of file NumberOfConcurrentIOVs.h.

Constructor & Destructor Documentation

◆ NumberOfConcurrentIOVs()

edm::eventsetup::NumberOfConcurrentIOVs::NumberOfConcurrentIOVs ( )

Member Function Documentation

◆ clear()

void edm::eventsetup::NumberOfConcurrentIOVs::clear ( void  )

Definition at line 77 of file NumberOfConcurrentIOVs.cc.

References forceNumberOfConcurrentIOVs_, numberConcurrentIOVs_, recordsNotAllowingConcurrentIOVs_, and edm::eventsetup::swap().

Referenced by edm::eventsetup::EventSetupsController::finishConfiguration().

77  {
78  // Mark this as invalid
80 
81  // Free up memory
83  std::vector<std::pair<EventSetupRecordKey, unsigned int>>().swap(forceNumberOfConcurrentIOVs_);
84  }
std::set< EventSetupRecordKey > recordsNotAllowingConcurrentIOVs_
void swap(DataKey &a, DataKey &b)
Definition: DataKey.h:85
std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_

◆ fillRecordsNotAllowingConcurrentIOVs()

void edm::eventsetup::NumberOfConcurrentIOVs::fillRecordsNotAllowingConcurrentIOVs ( EventSetupProvider const &  eventSetupProvider)

Definition at line 45 of file NumberOfConcurrentIOVs.cc.

References edm::eventsetup::EventSetupProvider::fillRecordsNotAllowingConcurrentIOVs(), and recordsNotAllowingConcurrentIOVs_.

Referenced by edm::eventsetup::EventSetupsController::finishConfiguration().

45  {
46  eventSetupProvider.fillRecordsNotAllowingConcurrentIOVs(recordsNotAllowingConcurrentIOVs_);
47  }
std::set< EventSetupRecordKey > recordsNotAllowingConcurrentIOVs_

◆ numberOfConcurrentIOVs()

unsigned int edm::eventsetup::NumberOfConcurrentIOVs::numberOfConcurrentIOVs ( EventSetupRecordKey const &  eventSetupKey,
bool  printInfoMsg = false 
) const

Definition at line 49 of file NumberOfConcurrentIOVs.cc.

References cms::cuda::assert(), forceNumberOfConcurrentIOVs_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, maxConcurrentIOVs_, SiStripPI::min, edm::eventsetup::EventSetupRecordKey::name(), numberConcurrentIOVs_, and recordsNotAllowingConcurrentIOVs_.

Referenced by edm::eventsetup::EventSetupsController::initializeEventSetupRecordIOVQueues().

50  {
54  std::make_pair(eventSetupKey, 0u),
55  [](auto const& left, auto const& right) { return left.first < right.first; });
56  if (iter != forceNumberOfConcurrentIOVs_.end() && iter->first == eventSetupKey) {
57  if (printInfoMsg && iter->second > maxConcurrentIOVs_) {
58  LogInfo("Configuration") << "For record " << eventSetupKey.name() << " you have configured " << iter->second
59  << " concurrent IOVs.\n"
60  << "But you cannot have more concurrent IOVs than lumis or streams.\n"
61  << "There will not be more than " << maxConcurrentIOVs_ << " concurrent IOVs.\n";
62  }
63  return std::min(iter->second, maxConcurrentIOVs_);
64  }
66  return 1;
67  }
68  if (printInfoMsg && numberConcurrentIOVs_ > maxConcurrentIOVs_) {
69  LogInfo("Configuration") << "For record " << eventSetupKey.name() << " you have configured "
70  << numberConcurrentIOVs_ << " concurrent IOVs.\n"
71  << "But you cannot have more concurrent IOVs than lumis or streams.\n"
72  << "There will not be more than " << maxConcurrentIOVs_ << " concurrent IOVs.\n";
73  }
74  return numberConcurrentIOVs_;
75  }
assert(be >=bs)
std::set< EventSetupRecordKey > recordsNotAllowingConcurrentIOVs_
std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
Log< level::Info, false > LogInfo

◆ readConfigurationParameters()

void edm::eventsetup::NumberOfConcurrentIOVs::readConfigurationParameters ( ParameterSet const *  eventSetupPset,
unsigned int  maxConcurrentIOVs,
bool  dumpOptions 
)

Definition at line 19 of file NumberOfConcurrentIOVs.cc.

References edm::eventsetup::heterocontainer::HCTypeTag::findType(), forceNumberOfConcurrentIOVs_, edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), maxConcurrentIOVs_, numberConcurrentIOVs_, muonDTDigis_cfi::pset, align_cfg::recordName, and jetUpdater_cfi::sort.

Referenced by edm::eventsetup::EventSetupsController::makeProvider().

21  {
22  if (eventSetupPset) { // this condition is false for SubProcesses
23  maxConcurrentIOVs_ = maxConcurrentIOVs;
24  numberConcurrentIOVs_ = eventSetupPset->getUntrackedParameter<unsigned int>("numberOfConcurrentIOVs");
25  if (numberConcurrentIOVs_ == 0 || numberConcurrentIOVs_ > maxConcurrentIOVs) {
26  numberConcurrentIOVs_ = maxConcurrentIOVs;
27  }
28  if (dumpOptions) {
29  LogAbsolute("Options") << "Number of Concurrent IOVs = " << numberConcurrentIOVs_;
30  }
31 
32  ParameterSet const& pset(eventSetupPset->getUntrackedParameterSet("forceNumberOfConcurrentIOVs"));
33  std::vector<std::string> recordNames = pset.getParameterNames();
34  forceNumberOfConcurrentIOVs_.reserve(recordNames.size());
35  for (auto const& recordName : recordNames) {
37  forceNumberOfConcurrentIOVs_.emplace_back(recordKey, pset.getUntrackedParameter<unsigned int>(recordName));
38  }
41  [](auto const& left, auto const& right) { return left.first < right.first; });
42  }
43  }
std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
Log< level::System, true > LogAbsolute
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:121

Member Data Documentation

◆ forceNumberOfConcurrentIOVs_

std::vector<std::pair<EventSetupRecordKey, unsigned int> > edm::eventsetup::NumberOfConcurrentIOVs::forceNumberOfConcurrentIOVs_
private

◆ maxConcurrentIOVs_

unsigned int edm::eventsetup::NumberOfConcurrentIOVs::maxConcurrentIOVs_ = 1
private

Definition at line 78 of file NumberOfConcurrentIOVs.h.

Referenced by numberOfConcurrentIOVs(), and readConfigurationParameters().

◆ numberConcurrentIOVs_

unsigned int edm::eventsetup::NumberOfConcurrentIOVs::numberConcurrentIOVs_
private

◆ recordsNotAllowingConcurrentIOVs_

std::set<EventSetupRecordKey> edm::eventsetup::NumberOfConcurrentIOVs::recordsNotAllowingConcurrentIOVs_
private