88 testESSource_(testESSource) {}
93 throw cms::Exception(
"TestFailure") <<
"TestESSourceTestProxy::getImpl," 94 <<
" functions in mutex should not run concurrently";
115 edm::LogAbsolute(
"TestESSourceTestProxy::initializeForNewIOV") <<
"TestESSourceTestProxy::initializeForNewIOV";
123 iterations_(
pset.getParameter<unsigned
int>(
"iterations")),
125 expectedNumberOfConcurrentIOVs_(
pset.getParameter<unsigned
int>(
"expectedNumberOfConcurrentIOVs")),
126 checkIOVInitialization_(
pset.getParameter<
bool>(
"checkIOVInitialization")) {
127 std::vector<unsigned int>
temp(
pset.getParameter<std::vector<unsigned int>>(
"firstValidLumis"));
132 findingRecord<ESTestRecordI>();
133 usingRecord<ESTestRecordI>();
140 std::vector<unsigned int> emptyVector;
141 desc.add<
unsigned int>(
"iterations", 10 * 1000 * 1000);
142 desc.add<
bool>(
"checkIOVInitialization",
false);
143 desc.add<
unsigned int>(
"expectedNumberOfConcurrentIOVs", 0);
144 desc.add<std::vector<unsigned int>>(
"firstValidLumis", emptyVector);
151 std::lock_guard<std::mutex> guard(
mutex_);
157 throw cms::Exception(
"TestFailure") <<
"TestESSource::setIntervalFor," 158 <<
" unexpected number of IOV initializations";
164 throw cms::Exception(
"TestFailure") <<
"TestESSource::setIntervalFor," 165 <<
" functions in mutex should not run concurrently";
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()) {
198 unsigned int iovIndex) {
200 throw cms::Exception(
"TestFailure") <<
"TestESSource::registerProxies," 201 <<
" unexpected number of concurrent IOVs";
206 keyedProxiesVector.emplace_back(dataKey, std::make_shared<TestESSourceTestProxy>(
this));
208 return keyedProxiesVector;
213 <<
"Start TestESSource::initConcurrentIOVs " << nConcurrentIOVs <<
" " <<
key.name();
214 if (EventSetupRecordKey::makeKey<ESTestRecordI>() !=
key) {
215 throw cms::Exception(
"TestFailure") <<
"TestESSource::initConcurrentIOVs," 216 <<
" unexpected EventSetupRecordKey";
219 throw cms::Exception(
"TestFailure") <<
"TestESSource::initConcurrentIOVs," 220 <<
" unexpected number of concurrent IOVs";
230 sum += stepSize *
cos(
i * stepSize);
232 edm::LogAbsolute(
"TestESSource::busyWait") <<
"Stop TestESSource::busyWait " <<
msg <<
" " << sum;
const IOVSyncValue & last() const
LuminosityBlockNumber_t luminosityBlockNumber() const
const IOVSyncValue & first() const
std::set< edm::IOVSyncValue > setOfIOV_
unsigned int iovIndex() const
unsigned int expectedNumberOfConcurrentIOVs_
static const IOVSyncValue & endOfTime()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned long long cacheIdentifier() const
std::pair< Time_t, Time_t > ValidityInterval
unsigned int nConcurrentIOVs_
void const * getAfterPrefetchImpl() const override
TestESSourceTestProxy(TestESSource *testESSource)
void initializeForNewIOV() override
edm::SerialTaskQueue queue_
std::atomic< unsigned int > count1_
TestESSource(edm::ParameterSet const &)
ValidityInterval validityInterval() const
std::atomic< unsigned int > count_
void initConcurrentIOVs(EventSetupRecordKey const &, unsigned int nConcurrentIOVs) override
void addDefault(ParameterSetDescription const &psetDescription)
bool isConcurrentFinder() const override
void prefetch(edm::eventsetup::DataKey const &, edm::EventSetupRecordDetails) override
unsigned int iovStartLumi_
Cos< T >::type cos(const T &t)
bool checkIOVInitialization_
void busyWait(char const *msg) const
std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >> KeyedProxiesVector
void setIntervalFor(EventSetupRecordKey const &, edm::IOVSyncValue const &, edm::ValidityInterval &) override
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
unsigned long long cacheIdentifier_
static EventNumber_t maxEventNumber()
const unsigned int iterations_
static const ValidityInterval & invalidInterval()
Log< level::System, true > LogAbsolute
KeyedProxiesVector registerProxies(EventSetupRecordKey const &, unsigned int iovIndex) override
std::atomic< unsigned int > count2_
TestESSource * testESSource_