33 namespace eventsetup {
39 eventSetupRecordIOVQueue->endIOVAsync(iEndTask);
46 unsigned int maxConcurrentIOVs,
51 std::shared_ptr<EventSetupProvider> returnValue(
95 std::vector<std::shared_ptr<const EventSetupImpl>>& eventSetupImpls) {
98 bool newEventSetupImpl =
false;
99 eventSetupImpls.clear();
106 eventSetupProvider->setAllValidityIntervals(syncValue);
114 eventSetupRecordIOVQueue->setNewIntervalForAnySubProcess();
122 eventSetupImpls.push_back(eventSetupProvider->eventSetupForInstance(syncValue, newEventSetupImpl));
126 eventSetupRecordIOVQueue->checkForNewIOVs(taskToStartAfterIOVInit, endIOVWaitingTasks, newEventSetupImpl);
133 if (eventSetupProvider->doWeNeedToWaitForIOVsToFinish(syncValue)) {
143 eventSetupProvider->forceCacheClear();
155 it->second.subProcessIndexes().push_back(subProcessIndex);
157 return it->second.provider();
161 return std::shared_ptr<DataProxyProvider>();
165 std::shared_ptr<DataProxyProvider>
const& component,
166 unsigned subProcessIndex) {
170 newElement->second.subProcessIndexes().push_back(subProcessIndex);
181 it->second.subProcessIndexes().push_back(subProcessIndex);
183 return it->second.finder();
187 return std::shared_ptr<EventSetupRecordIntervalFinder>();
191 std::shared_ptr<EventSetupRecordIntervalFinder>
const& component,
192 unsigned subProcessIndex) {
196 newElement->second.subProcessIndexes().push_back(subProcessIndex);
205 unsigned subProcessIndex,
206 unsigned precedingProcessIndex,
207 bool& firstProcessWithThisPSet,
208 bool& precedingHasMatchingPSet)
const {
211 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
213 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
214 if (iFound == subProcessIndexes.end()) {
218 if (iFound == subProcessIndexes.begin()) {
219 firstProcessWithThisPSet =
true;
220 precedingHasMatchingPSet =
false;
222 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
223 if (iFoundPreceding == iFound) {
224 firstProcessWithThisPSet =
false;
225 precedingHasMatchingPSet =
false;
227 firstProcessWithThisPSet =
false;
228 precedingHasMatchingPSet =
true;
234 <<
"Subprocess index not found. This should never happen\n" 235 <<
"Please report this to a Framework Developer\n";
239 unsigned subProcessIndex,
240 unsigned precedingProcessIndex)
const {
243 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
245 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
246 if (iFound == subProcessIndexes.end()) {
250 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
251 if (iFoundPreceding == iFound) {
254 return iFoundPreceding == subProcessIndexes.begin();
258 <<
"Subprocess index not found. This should never happen\n" 259 <<
"Please report this to a Framework Developer\n";
264 unsigned subProcessIndex,
265 unsigned precedingProcessIndex)
const {
268 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
270 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
271 if (iFound == subProcessIndexes.end()) {
275 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
276 if (iFoundPreceding == iFound) {
279 return (++iFoundPreceding) == iFound;
283 <<
"Subprocess index not found. This should never happen\n" 284 <<
"Please report this to a Framework Developer\n";
289 unsigned subProcessIndex,
290 unsigned precedingProcessIndex)
const {
293 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
295 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
296 if (iFound == subProcessIndexes.end()) {
300 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
301 if (iFoundPreceding == iFound) {
308 <<
"Subprocess index not found. This should never happen\n" 309 <<
"Please report this to a Framework Developer\n";
314 unsigned subProcessIndex,
315 unsigned precedingProcessIndex)
const {
318 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
320 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
321 if (iFound == subProcessIndexes.end()) {
325 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
326 if (iFoundPreceding == iFound) {
333 <<
"Subprocess index not found. This should never happen\n" 334 <<
"Please report this to a Framework Developer\n";
339 unsigned subProcessIndex)
const {
342 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
344 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
345 if (iFound == subProcessIndexes.end()) {
348 return it->second.pset();
351 <<
"Subprocess index not found. This should never happen\n" 352 <<
"Please report this to a Framework Developer\n";
360 if (esProvider != esProviderEnd)
362 for (; esProvider != esProviderEnd; ++esProvider) {
370 std::set<ParameterSetIDHolder> sharingCheckDone;
377 std::map<EventSetupRecordKey, std::vector<ComponentDescription const*>> referencedESProducers;
383 for (
auto precedingESProvider =
providers_.begin(); precedingESProvider != esProvider; ++precedingESProvider) {
384 (*esProvider)->checkESProducerSharing(**precedingESProvider, sharingCheckDone, referencedESProducers, *
this);
387 (*esProvider)->resetRecordToProxyPointers();
390 eventSetupProvider->clearInitializationData();
395 std::set<EventSetupRecordKey>
keys;
397 provider->fillKeys(
keys);
414 oneapi::tbb::task_group& iGroup,
420 std::vector<std::shared_ptr<const EventSetupImpl>> dummyEventSetupImpls;
423 WaitingTaskHolder waitingTaskHolder(iGroup, &waitUntilIOVInitializationCompletes);
428 syncValue, waitingTaskHolder, dummyWaitingTaskList, dummyEventSetupImpls);
429 dummyWaitingTaskList.
doneWaiting(std::exception_ptr{});
431 dummyWaitingTaskList.
doneWaiting(std::exception_ptr{});
432 waitingTaskHolder.
doneWaiting(std::current_exception());
435 waitUntilIOVInitializationCompletes.wait();
std::shared_ptr< EventSetupRecordIntervalFinder > getESSourceAndRegisterProcess(ParameterSet const &pset, unsigned subProcessIndex)
void addRecProvider(EventSetupRecordProvider *recProvider)
void checkESProducerSharing()
std::vector< propagate_const< std::unique_ptr< EventSetupRecordIOVQueue > > > eventSetupRecordIOVQueues_
void putESSource(ParameterSet const &pset, std::shared_ptr< EventSetupRecordIntervalFinder > const &component, unsigned subProcessIndex)
ParameterSet const * getESProducerPSet(ParameterSetID const &psetID, unsigned subProcessIndex) const
void putESProducer(ParameterSet const &pset, std::shared_ptr< DataProxyProvider > const &component, unsigned subProcessIndex)
bool isMatchingESSource(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
std::unique_ptr< EventSetupProvider > makeEventSetupProvider(ParameterSet const ¶ms, unsigned subProcessIndex, ActivityRegistry *activityRegistry)
bool mustFinishConfiguration_
void lookForMatches(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex, bool &firstProcessWithThisPSet, bool &precedingHasMatchingPSet) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool hasNonconcurrentFinder() const
void synchronousEventSetupForInstance(IOVSyncValue const &syncValue, oneapi::tbb::task_group &iGroup, eventsetup::EventSetupsController &espController)
bool isLastMatch(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
std::shared_ptr< DataProxyProvider > getESProducerAndRegisterProcess(ParameterSet const &pset, unsigned subProcessIndex)
void fillEventSetupProvider(EventSetupsController &esController, EventSetupProvider &cp, ParameterSet ¶ms)
void doneWaiting(std::exception_ptr iExcept)
void fillRecordsNotAllowingConcurrentIOVs(EventSetupProvider const &)
std::multimap< ParameterSetID, ESSourceInfo > essources_
bool isMatchingESProducer(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
std::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &, ActivityRegistry *, ParameterSet const *eventSetupPset=nullptr, unsigned int maxConcurrentIOVs=0, bool dumpOptions=false)
void initializeEventSetupRecordIOVQueues()
void eventSetupForInstanceAsync(IOVSyncValue const &, WaitingTaskHolder const &taskToStartAfterIOVInit, WaitingTaskList &endIOVWaitingTasks, std::vector< std::shared_ptr< const EventSetupImpl >> &)
void readConfigurationParameters(ParameterSet const *eventSetupPset, unsigned int maxConcurrentIOVs, bool dumpOptions)
void finishConfiguration()
bool hasNonconcurrentFinder_
bool isFirstMatch(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
void endIOVsAsync(edm::WaitingTaskHolder iEndTask)
bool doWeNeedToWaitForIOVsToFinish(IOVSyncValue const &) const
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)
unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const &, bool printInfoMsg=false) const
NumberOfConcurrentIOVs numberOfConcurrentIOVs_