32 namespace eventsetup {
38 eventSetupRecordIOVQueue->endIOVAsync(iEndTask);
45 unsigned int maxConcurrentIOVs,
50 std::shared_ptr<EventSetupProvider> returnValue(
94 std::vector<std::shared_ptr<const EventSetupImpl>>& eventSetupImpls) {
97 bool newEventSetupImpl =
false;
98 eventSetupImpls.clear();
105 eventSetupProvider->setAllValidityIntervals(syncValue);
113 eventSetupRecordIOVQueue->setNewIntervalForAnySubProcess();
121 eventSetupImpls.push_back(eventSetupProvider->eventSetupForInstance(syncValue, newEventSetupImpl));
125 eventSetupRecordIOVQueue->checkForNewIOVs(taskToStartAfterIOVInit, endIOVWaitingTasks, newEventSetupImpl);
132 if (eventSetupProvider->doWeNeedToWaitForIOVsToFinish(syncValue)) {
142 eventSetupProvider->forceCacheClear();
154 it->second.subProcessIndexes().push_back(subProcessIndex);
156 return it->second.provider();
160 return std::shared_ptr<DataProxyProvider>();
164 std::shared_ptr<DataProxyProvider>
const& component,
165 unsigned subProcessIndex) {
169 newElement->second.subProcessIndexes().push_back(subProcessIndex);
180 it->second.subProcessIndexes().push_back(subProcessIndex);
182 return it->second.finder();
186 return std::shared_ptr<EventSetupRecordIntervalFinder>();
190 std::shared_ptr<EventSetupRecordIntervalFinder>
const& component,
191 unsigned subProcessIndex) {
195 newElement->second.subProcessIndexes().push_back(subProcessIndex);
204 unsigned subProcessIndex,
205 unsigned precedingProcessIndex,
206 bool& firstProcessWithThisPSet,
207 bool& precedingHasMatchingPSet)
const {
210 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
212 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
213 if (iFound == subProcessIndexes.end()) {
217 if (iFound == subProcessIndexes.begin()) {
218 firstProcessWithThisPSet =
true;
219 precedingHasMatchingPSet =
false;
221 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
222 if (iFoundPreceding == iFound) {
223 firstProcessWithThisPSet =
false;
224 precedingHasMatchingPSet =
false;
226 firstProcessWithThisPSet =
false;
227 precedingHasMatchingPSet =
true;
233 <<
"Subprocess index not found. This should never happen\n" 234 <<
"Please report this to a Framework Developer\n";
238 unsigned subProcessIndex,
239 unsigned precedingProcessIndex)
const {
242 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
244 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
245 if (iFound == subProcessIndexes.end()) {
249 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
250 if (iFoundPreceding == iFound) {
253 return iFoundPreceding == subProcessIndexes.begin();
257 <<
"Subprocess index not found. This should never happen\n" 258 <<
"Please report this to a Framework Developer\n";
263 unsigned subProcessIndex,
264 unsigned precedingProcessIndex)
const {
267 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
269 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
270 if (iFound == subProcessIndexes.end()) {
274 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
275 if (iFoundPreceding == iFound) {
278 return (++iFoundPreceding) == iFound;
282 <<
"Subprocess index not found. This should never happen\n" 283 <<
"Please report this to a Framework Developer\n";
288 unsigned subProcessIndex,
289 unsigned precedingProcessIndex)
const {
292 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
294 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
295 if (iFound == subProcessIndexes.end()) {
299 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
300 if (iFoundPreceding == iFound) {
307 <<
"Subprocess index not found. This should never happen\n" 308 <<
"Please report this to a Framework Developer\n";
313 unsigned subProcessIndex,
314 unsigned precedingProcessIndex)
const {
317 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
319 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
320 if (iFound == subProcessIndexes.end()) {
324 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
325 if (iFoundPreceding == iFound) {
332 <<
"Subprocess index not found. This should never happen\n" 333 <<
"Please report this to a Framework Developer\n";
338 unsigned subProcessIndex)
const {
341 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
343 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
344 if (iFound == subProcessIndexes.end()) {
347 return it->second.pset();
350 <<
"Subprocess index not found. This should never happen\n" 351 <<
"Please report this to a Framework Developer\n";
359 if (esProvider != esProviderEnd)
361 for (; esProvider != esProviderEnd; ++esProvider) {
369 std::set<ParameterSetIDHolder> sharingCheckDone;
376 std::map<EventSetupRecordKey, std::vector<ComponentDescription const*>> referencedESProducers;
382 for (
auto precedingESProvider =
providers_.begin(); precedingESProvider != esProvider; ++precedingESProvider) {
383 (*esProvider)->checkESProducerSharing(**precedingESProvider, sharingCheckDone, referencedESProducers, *
this);
386 (*esProvider)->resetRecordToProxyPointers();
389 eventSetupProvider->clearInitializationData();
394 std::set<EventSetupRecordKey>
keys;
396 provider->fillKeys(
keys);
413 oneapi::tbb::task_group& iGroup,
419 std::vector<std::shared_ptr<const EventSetupImpl>> dummyEventSetupImpls;
422 WaitingTaskHolder waitingTaskHolder(iGroup, &waitUntilIOVInitializationCompletes);
427 syncValue, waitingTaskHolder, dummyWaitingTaskList, dummyEventSetupImpls);
428 dummyWaitingTaskList.
doneWaiting(std::exception_ptr{});
430 dummyWaitingTaskList.
doneWaiting(std::exception_ptr{});
431 waitingTaskHolder.
doneWaiting(std::current_exception());
436 }
while (not waitUntilIOVInitializationCompletes.
done());
438 if (waitUntilIOVInitializationCompletes.
exceptionPtr() !=
nullptr) {
439 std::rethrow_exception(*(waitUntilIOVInitializationCompletes.
exceptionPtr()));
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)
std::exception_ptr const * exceptionPtr() const
Returns exception thrown by dependent task.
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_