101 <<
"TestESConcurrentSourceTestProxy::getImpl '" << iKey.
name().
value()
117 <<
"TestESConcurrentSourceTestProxy::initializeForNewIOV";
124 count_setIntervalFor_(0),
125 count_initializeForNewIOV_(0),
126 iterations_(
pset.getParameter<unsigned
int>(
"iterations")),
128 expectedNumberOfConcurrentIOVs_(
pset.getParameter<unsigned
int>(
"expectedNumberOfConcurrentIOVs")),
129 checkIOVInitialization_(
pset.getParameter<
bool>(
"checkIOVInitialization")) {
130 std::vector<unsigned int>
temp(
pset.getParameter<std::vector<unsigned int>>(
"firstValidLumis"));
135 findingRecord<ESTestRecordI>();
136 usingRecord<ESTestRecordI>();
145 std::vector<unsigned int> emptyVector;
146 desc.add<
unsigned int>(
"iterations", 10 * 1000 * 1000);
147 desc.add<
bool>(
"checkIOVInitialization",
false);
148 desc.add<
unsigned int>(
"expectedNumberOfConcurrentIOVs", 0);
149 desc.add<std::vector<unsigned int>>(
"firstValidLumis", emptyVector);
161 throw cms::Exception(
"TestFailure") <<
"TestESConcurrentSource::setIntervalFor," 162 <<
" unexpected number of IOV initializations";
175 std::pair<std::set<edm::IOVSyncValue>::iterator, std::set<edm::IOVSyncValue>::iterator> itFound =
178 if (itFound.first == itFound.second) {
179 if (itFound.first ==
setOfIOV_.begin()) {
200 throw cms::Exception(
"TestFailure") <<
"TestESConcurrentSource::registerProxies," 201 <<
" unexpected number of concurrent IOVs";
208 keyedProxiesVector.emplace_back(dataKey, std::make_shared<TestESConcurrentSourceTestProxy>(
this));
213 keyedProxiesVector.emplace_back(dataKey, std::make_shared<TestESConcurrentSourceTestProxy>(
this));
216 return keyedProxiesVector;
221 <<
"Start TestESConcurrentSource::initConcurrentIOVs " << nConcurrentIOVs <<
" " <<
key.name();
222 if (EventSetupRecordKey::makeKey<ESTestRecordI>() !=
key) {
223 throw cms::Exception(
"TestFailure") <<
"TestESConcurrentSource::initConcurrentIOVs," 224 <<
" unexpected EventSetupRecordKey";
227 throw cms::Exception(
"TestFailure") <<
"TestESConcurrentSource::initConcurrentIOVs," 228 <<
" unexpected number of concurrent IOVs";
234 edm::LogAbsolute(
"TestESConcurrentSource::busyWait") <<
"Start TestESConcurrentSource::busyWait " <<
msg;
238 sum += stepSize *
cos(
i * stepSize);
241 <<
"Stop TestESConcurrentSource::busyWait " <<
msg <<
" " << sum;
const IOVSyncValue & last() const
void initializeForNewIOV() override
void busyWait(char const *msg) const
LuminosityBlockNumber_t luminosityBlockNumber() const
std::atomic< unsigned int > count_
const IOVSyncValue & first() const
unsigned int iovIndex() const
static const IOVSyncValue & endOfTime()
TestESConcurrentSource(edm::ParameterSet const &)
unsigned long long cacheIdentifier() const
std::pair< Time_t, Time_t > ValidityInterval
bool isConcurrentFinder() const override
TestESConcurrentSourceTestProxy(TestESConcurrentSource *TestESConcurrentSource)
void prefetch(edm::eventsetup::DataKey const &, edm::EventSetupRecordDetails) override
ValidityInterval validityInterval() const
std::atomic< unsigned int > count_initializeForNewIOV_
void addDefault(ParameterSetDescription const &psetDescription)
unsigned int nConcurrentIOVs_
unsigned int iovStartLumi_
Cos< T >::type cos(const T &t)
std::atomic< unsigned int > count_setIntervalFor_
KeyedProxiesVector registerProxies(EventSetupRecordKey const &, unsigned int iovIndex) override
void setIntervalFor(EventSetupRecordKey const &, edm::IOVSyncValue const &, edm::ValidityInterval &) override
std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >> KeyedProxiesVector
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
const unsigned int iterations_
unsigned long long cacheIdentifier_
bool checkIOVInitialization_
unsigned int expectedNumberOfConcurrentIOVs_
std::set< edm::IOVSyncValue > setOfIOV_
static EventNumber_t maxEventNumber()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~TestESConcurrentSource() override
static const ValidityInterval & invalidInterval()
Log< level::System, true > LogAbsolute
void initConcurrentIOVs(EventSetupRecordKey const &, unsigned int nConcurrentIOVs) override
std::atomic< unsigned int > maxCount_
TestESConcurrentSource * testESConcurrentSource_
const NameTag & name() const
void const * getAfterPrefetchImpl() const override
const char * value() const