31 exception <<
"ProductResolverBase::resolveProduct_: The product matching all criteria was already deleted\n" 33 <<
"Looking for module label: " <<
moduleLabel() <<
"\n" 36 <<
"This means there is a configuration error.\n" 37 <<
"The module which is asking for this data must be configured to state that it will read this data.";
43 template <
bool callResolver,
typename FUNC>
50 auto presentStatus =
status();
55 auto failedStatusSetter = [
this](
ProductStatus* presentStatus) {
59 *presentStatus = this->
status();
61 std::unique_ptr<ProductStatus, decltype(failedStatusSetter)> failedStatusGuard(&presentStatus, failedStatusSetter);
70 if(pd->wrapper()->isPresent()) {
81 if(not iFrom) {
return;}
88 }
else if(
original->hasIsProductEqual()) {
89 if(!
original->isProductEqual(iFrom.get())) {
92 <<
"ProductResolver::mergeTheProduct\n" 93 <<
"Two run/lumi products for the same run/lumi which should be equal are not\n" 94 <<
"Using the first, ignoring the second\n" 95 <<
"className = " << bd.className() <<
"\n" 96 <<
"moduleLabel = " << bd.moduleLabel() <<
"\n" 97 <<
"instance = " << bd.productInstanceName() <<
"\n" 98 <<
"process = " << bd.processName() <<
"\n";
103 <<
"ProductResolver::mergeTheProduct\n" 104 <<
"Run/lumi product has neither a mergeProduct nor isProductEqual function\n" 105 <<
"Using the first, ignoring the second in merge\n" 106 <<
"className = " << bd.className() <<
"\n" 107 <<
"moduleLabel = " << bd.moduleLabel() <<
"\n" 108 <<
"instance = " << bd.productInstanceName() <<
"\n" 109 <<
"process = " << bd.processName() <<
"\n";
119 return resolveProductImpl<true>([
this,&
principal,mcc]() {
133 aux_->postModuleDelayedGetSignal_.emit(*(iContext->
getStreamContext()), *iContext); }
136 if(
auto reader=principal.reader()) {
137 std::unique_lock<std::recursive_mutex> guard;
138 if(
auto sr =
reader->sharedResources().second) {
139 guard =std::unique_lock<std::recursive_mutex>(*sr);
154 std::unique_lock<std::recursive_mutex> guard;
155 if(
auto sr =
reader->sharedResources().second) {
156 guard =std::unique_lock<std::recursive_mutex>(*sr);
163 if(edp.get() !=
nullptr) {
174 bool skipCurrentProcess,
178 m_waitingTasks.add(waitTask);
180 bool expected =
false;
181 if( m_prefetchRequested.compare_exchange_strong(expected,
true) ) {
183 auto workToDo = [
this, mcc, &
principal, token] () {
187 resolveProductImpl<true>([
this,&
principal,mcc]() {
188 if(principal.branchType() !=
InEvent) {
return; }
189 if(
auto reader = principal.reader()) {
190 std::unique_lock<std::recursive_mutex> guard;
191 if(
auto sr =
reader->sharedResources().second) {
192 guard =std::unique_lock<std::recursive_mutex>(*sr);
201 this->m_waitingTasks.doneWaiting(std::current_exception());
204 this->m_waitingTasks.doneWaiting(
nullptr);
208 if(
auto reader = principal.reader()) {
209 if (
auto shared_res =
reader->sharedResources().first) {
210 queue = &(shared_res->serialQueueChain());
214 queue->
push(workToDo);
219 tbb::task::spawn(*
t);
226 m_prefetchRequested =
false;
227 m_waitingTasks.reset();
245 bool skipCurrentProcess,
248 if (!skipCurrentProcess) {
250 return resolveProductImpl<false>([](){
return;});
257 bool skipCurrentProcess,
261 if(not skipCurrentProcess) {
263 if( not mcc->parent().isAtEndTransition() ) {
267 m_waitingTasks.add(waitTask);
269 bool expected =
false;
270 if(worker_ and prefetchRequested_.compare_exchange_strong(expected,
true)) {
277 [
this](std::exception_ptr
const * iException) {
278 if(
nullptr != iException) {
279 m_waitingTasks.doneWaiting(*iException);
281 m_waitingTasks.doneWaiting(std::exception_ptr());
284 worker_->callWhenDoneAsync(waiting);
292 bool expected =
false;
293 if(prefetchRequested_.compare_exchange_strong(expected,
true)) {
294 m_waitingTasks.doneWaiting(std::exception_ptr());
301 m_waitingTasks.reset();
303 prefetchRequested_ =
false;
316 assert(worker_ !=
nullptr);
322 bool skipCurrentProcess,
325 if (!skipCurrentProcess and worker_) {
326 return resolveProductImpl<true>(
333 auto workCall = [
this,&
event,&parentContext,mcc] () {
338 *(aux_->eventSetup()),
352 std::ostringstream ost;
353 ost <<
"Calling produce method for unscheduled module " 354 << worker_->description().moduleName() <<
"/'" 355 << worker_->description().moduleLabel() <<
"'";
367 bool skipCurrentProcess,
372 if(skipCurrentProcess) {
return; }
373 waitingTasks_.add(waitTask);
374 bool expected =
false;
375 if(prefetchRequested_.compare_exchange_strong(expected,
true)) {
380 [
this](std::exception_ptr
const* iPtr)
385 resolveProductImpl<true>([iPtr]() {
387 std::rethrow_exception(*iPtr);
391 waitingTasks_.doneWaiting(std::current_exception());
394 waitingTasks_.doneWaiting(
nullptr);
401 *(aux_->eventSetup()),
411 prefetchRequested_ =
false;
412 waitingTasks_.reset();
447 if(not prod) {
return;}
467 <<
"It is actually of type " << typeID.className() <<
".\n";
487 auto presentStatus =
status();
549 realProduct_.setProvenance(provRetriever,ph,pid);
553 realProduct_.setProcessHistory(ph);
561 realProduct_.resetProductData_(deleteEarly);
570 <<
"AliasProductResolver::putProduct_() not implemented and should never be called.\n" 571 <<
"Contact a Framework developer\n";
576 <<
"AliasProductResolver::putOrMergeProduct_(std::unique_ptr<WrapperBase> edp) not implemented and should never be called.\n" 577 <<
"Contact a Framework developer\n";
583 provRetriever_ = provRetriever;
590 return provRetriever_? provRetriever_->branchIDToProvenance(bd_->originalBranchID()):
nullptr;
602 <<
"ParentProcessProductResolver::putProduct_() not implemented and should never be called.\n" 603 <<
"Contact a Framework developer\n";
608 <<
"ParentProcessProductResolver::putOrMergeProduct_(std::unique_ptr<WrapperBase> edp) not implemented and should never be called.\n" 609 <<
"Contact a Framework developer\n";
629 <<
"ParentProcessProductResolver::throwNullRealProduct RealProduct pointer not set in this context.\n" 630 <<
"Contact a Framework developer\n";
635 std::vector<bool>
const& ambiguous,
637 matchingHolders_(matchingHolders),
638 ambiguous_(ambiguous),
640 lastSkipCurrentCheckIndex_(lastCheckIndex_.
load()),
641 prefetchRequested_(
false),
642 skippingPrefetchRequested_(
false),
643 madeAtEnd_{madeAtEnd}
651 bool skipCurrentProcess,
655 return productResolver->
resolveProduct(principal, skipCurrentProcess, sra, mcc);
661 bool skipCurrentProcess,
666 const unsigned int choiceSize =
ambiguous_.size();
669 if( (not skipCurrentProcess) and (
madeAtEnd_ and mcc)) {
670 skipCurrentProcess = not mcc->parent().isAtEndTransition();
680 return tryResolver(checkCacheIndex, principal, skipCurrentProcess,
687 for(
unsigned int k : lookupProcessOrder) {
697 updateCacheIndex =
k;
710 bool skipCurrentProcess,
714 bool timeToMakeAtEnd =
true;
716 timeToMakeAtEnd = mcc->parent().isAtEndTransition();
720 if(not skipCurrentProcess and timeToMakeAtEnd) {
723 bool expected =
false;
730 bool expected =
false;
740 std::exception_ptr iExceptPtr)
const {
741 if( not iSkipCurrentProcess) {
755 unsigned int iResolverIndex,
759 bool iSkipCurrentProcess,
761 resolver_(iResolver),
762 principal_(iPrincipal),
765 serviceToken_(iToken),
766 index_(iResolverIndex),
767 skipCurrentProcess_(iSkipCurrentProcess){}
769 tbb::task*
execute()
override {
770 auto exceptPtr =exceptionPtr();
772 resolver_->prefetchFailed(index_, *principal_, skipCurrentProcess_, *exceptPtr);
774 if(not resolver_->dataValidFromResolver(index_, *principal_, skipCurrentProcess_)) {
775 resolver_->tryPrefetchResolverAsync(index_+1,
793 bool skipCurrentProcess_;
800 bool iSkipCurrentProcess,
801 std::exception_ptr iExceptPtr)
const {
803 auto k = lookupProcessOrder[iProcessingIndex];
805 setCache(iSkipCurrentProcess,
k, iExceptPtr);
812 bool iSkipCurrentProcess)
const {
814 auto k = lookupProcessOrder[iProcessingIndex];
819 setCache(iSkipCurrentProcess, k,
nullptr);
829 bool skipCurrentProcess,
834 auto index = iProcessingIndex;
836 const unsigned int choiceSize =
ambiguous_.size();
838 while(
index < lookupProcessOrder.size()) {
839 auto k = lookupProcessOrder[
index];
851 auto task =
new (tbb::task::allocate_root()) TryNextResolverWaitingTask(
860 task->increment_ref_count();
871 if(0 == task->decrement_ref_count()) {
872 tbb::task::spawn(*task);
879 setCache(skipCurrentProcess, newCacheIndex,
nullptr);
910 <<
"NoProcessProductResolver::unscheduledWasNotRun_() not implemented and should never be called.\n" 911 <<
"Contact a Framework developer\n";
916 <<
"NoProcessProductResolver::productUnavailable_() not implemented and should never be called.\n" 917 <<
"Contact a Framework developer\n";
922 <<
"NoProcessProductResolver::productResolved_() not implemented and should never be called.\n" 923 <<
"Contact a Framework developer\n";
928 <<
"NoProcessProductResolver::productWasDeleted_() not implemented and should never be called.\n" 929 <<
"Contact a Framework developer\n";
934 <<
"NoProcessProductResolver::productWasFetchedAndIsValid_() not implemented and should never be called.\n" 935 <<
"Contact a Framework developer\n";
940 <<
"NoProcessProductResolver::putProduct_() not implemented and should never be called.\n" 941 <<
"Contact a Framework developer\n";
946 <<
"NoProcessProductResolver::putOrMergeProduct_(std::unique_ptr<WrapperBase> edp) not implemented and should never be called.\n" 947 <<
"Contact a Framework developer\n";
952 <<
"NoProcessProductResolver::branchDescription_() not implemented and should never be called.\n" 953 <<
"Contact a Framework developer\n";
958 <<
"NoProcessProductResolver::resetBranchDescription_() not implemented and should never be called.\n" 959 <<
"Contact a Framework developer\n";
964 <<
"NoProcessProductResolver::provenance_() not implemented and should never be called.\n" 965 <<
"Contact a Framework developer\n";
970 <<
"NoProcessProductResolver::connectTo() not implemented and should never be called.\n" 971 <<
"Contact a Framework developer\n";
978 bool skipCurrentProcess,
985 ->resolveProduct(principal,
986 skipCurrentProcess, sra, mcc);
991 bool skipCurrentProcess,
996 ->prefetchAsync(waitTask,principal,
997 skipCurrentProcess, token, sra, mcc);
1019 <<
"SingleChoiceNoProcessProductResolver::unscheduledWasNotRun_() not implemented and should never be called.\n" 1020 <<
"Contact a Framework developer\n";
1025 <<
"SingleChoiceNoProcessProductResolver::productUnavailable_() not implemented and should never be called.\n" 1026 <<
"Contact a Framework developer\n";
1031 <<
"SingleChoiceNoProcessProductResolver::productResolved_() not implemented and should never be called.\n" 1032 <<
"Contact a Framework developer\n";
1037 <<
"SingleChoiceNoProcessProductResolver::productWasDeleted_() not implemented and should never be called.\n" 1038 <<
"Contact a Framework developer\n";
1043 <<
"SingleChoiceNoProcessProductResolver::productWasFetchedAndIsValid_() not implemented and should never be called.\n" 1044 <<
"Contact a Framework developer\n";
1050 <<
"SingleChoiceNoProcessProductResolver::putProduct_() not implemented and should never be called.\n" 1051 <<
"Contact a Framework developer\n";
1056 <<
"SingleChoiceNoProcessProductResolver::putOrMergeProduct_(std::unique_ptr<WrapperBase> edp) not implemented and should never be called.\n" 1057 <<
"Contact a Framework developer\n";
1062 <<
"SingleChoiceNoProcessProductResolver::branchDescription_() not implemented and should never be called.\n" 1063 <<
"Contact a Framework developer\n";
1068 <<
"SingleChoiceNoProcessProductResolver::resetBranchDescription_() not implemented and should never be called.\n" 1069 <<
"Contact a Framework developer\n";
1074 <<
"SingleChoiceNoProcessProductResolver::provenance_() not implemented and should never be called.\n" 1075 <<
"Contact a Framework developer\n";
1080 <<
"SingleChoiceNoProcessProductResolver::connectTo() not implemented and should never be called.\n" 1081 <<
"Contact a Framework developer\n";
void connectTo(ProductResolverBase const &iOther, Principal const *) final
Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
std::string const & branchName() const
std::string const & productInstanceName() const
std::unique_ptr< T, F > make_sentry(T *iObject, F iFunc)
NOTE: if iObject is null, then iFunc will not be called.
void resetProductData_(bool deleteEarly) override
Provenance const * provenance() const
void setProcessHistory(ProcessHistory const &ph)
unsigned int ProductResolverIndex
StreamContext const * getStreamContext() const
void checkType(WrapperBase const &prod) const
std::type_info const & dynamicTypeInfo() const
void prefetchAsync(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
unsigned int unsetIndexValue() const
void resetProductData_(bool deleteEarly) override
void prefetchAsync_(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
FunctorTask< F > * make_functor_task(ALLOC &&iAlloc, F f)
void setCache(bool skipCurrentProcess, ProductResolverIndex index, std::exception_ptr exceptionPtr) const
void add(WaitingTask *)
Adds task to the waiting list.
void setProcessHistory_(ProcessHistory const &ph) override
ProductStatus status() const
bool singleProduct_() const override
bool unscheduledWasNotRun_() const override
void putProduct_(std::unique_ptr< WrapperBase > edp) const override
void throwNullRealProduct() const
Resolution tryResolver(unsigned int index, Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
WrapperBase const * wrapper() const
WaitingTaskList skippingWaitingTasks_
bool singleProduct_() const override
void resetProductData_(bool deleteEarly) override
ProductProvenance const * productProvenance() const
void push(T &&iAction)
asynchronously pushes functor iAction into queue
Resolution resolveProduct(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
void setProvenance_(ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid) override
void reset()
Resets access to the resource so that added tasks will wait.
void connectTo(ProductResolverBase const &iOther, Principal const *) final
BranchDescription const & branchDescription_() const override
bool productResolved_() const final
static unsigned int kUnsetOffset
void resetProductData_(bool deleteEarly) override
std::string const & processName() const
void connectTo(ProductResolverBase const &, Principal const *) final
void putProduct_(std::unique_ptr< WrapperBase > edp) const override
void putOrMergeProduct_(std::unique_ptr< WrapperBase > prod) const final
void throwProductDeletedException() const
bool productUnavailable_() const final
ProductProvenance const * productProvenancePtr_() const override
static unsigned int kMissingOffset
bool productResolved_() const final
void putProduct(std::unique_ptr< WrapperBase > edp) const
WaitingTaskList waitingTasks_
void unsafe_setWrapper(std::unique_ptr< WrapperBase > iValue) const
void prefetchFailed(unsigned int iProcessingIndex, Principal const &principal, bool iSkipCurrentProcess, std::exception_ptr iExceptPtr) const
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
void setProvenance(ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid)
std::string const & className() const
std::atomic< unsigned int > lastSkipCurrentCheckIndex_
bool singleProduct_() const override
bool productWasDeleted() const
Provenance const * provenance_() const override
std::vector< unsigned int > const & lookupProcessOrder() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void putOrMergeProduct_(std::unique_ptr< WrapperBase > prod) const final
Provenance const * provenance_() const override
bool dataValidFromResolver(unsigned int iProcessingIndex, Principal const &principal, bool iSkipCurrentProcess) const
void setProvenance_(ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid) override
TypeID unwrappedTypeID() const
void resetProductData_(bool deleteEarly) override
void setProcessHistory_(ProcessHistory const &ph) override
ProductProvenance const * productProvenancePtr_() const override
bool isFromCurrentProcess() const final
bool productUnavailable_() const override
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) override
void mergeProduct(std::unique_ptr< WrapperBase > edp) const
ProductProvenance const * productProvenancePtr_() const override
void putOrMergeProduct_(std::unique_ptr< WrapperBase > prod) const final
std::atomic< bool > prefetchRequested_
ProductProvenance const * productProvenancePtr_() const override
bool productResolved_() const final
std::atomic< unsigned int > lastCheckIndex_
TypeWithDict const & unwrappedType() const
void setProvenance_(ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid) final
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::type_info const & unvalidatedTypeInfo() const
bool productWasDeleted_() const override
void putProduct_(std::unique_ptr< WrapperBase > edp) const override
virtual bool isFromCurrentProcess() const =0
Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
void setProduct(std::unique_ptr< WrapperBase > edp) const
void prefetchAsync_(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
NoProcessProductResolver(std::vector< ProductResolverIndex > const &matchingHolders, std::vector< bool > const &ambiguous, bool madeAtEnd)
std::atomic< bool > skippingPrefetchRequested_
std::atomic< ProductStatus > theStatus_
std::vector< bool > ambiguous_
Resolution resolveProductImpl(FUNC resolver) const
DelayedReader * reader() const
UnscheduledAuxiliary const * auxiliary() const
void resetProductData_(bool deleteEarly) override
static unsigned int kAmbiguousOffset
void setupUnscheduled(UnscheduledConfigurator const &) final
ProductStatus defaultStatus() const
bool productWasFetchedAndIsValid(bool iSkipCurrentProcess) const
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const final
void setProcessHistory_(ProcessHistory const &ph) override
BranchDescription const & branchDescription_() const override
bool productWasDeleted_() const final
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
bool productUnavailable_() const override
void addContext(std::string const &context)
bool singleProduct_() const override
std::vector< ProductResolverIndex > matchingHolders_
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) override
void tryPrefetchResolverAsync(unsigned int iProcessingIndex, Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc, ServiceToken token) const
BranchDescription const & branchDescription() const
Worker * findWorker(std::string const &iLabel) const
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
ProductProvenance const * productProvenancePtr_() const final
void putProduct_(std::unique_ptr< WrapperBase > edp) const override
void putOrMergeProduct_(std::unique_ptr< WrapperBase > prod) const final
void setProvenance_(ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid) override
void setProcessHistory_(ProcessHistory const &ph) override
void putProduct_(std::unique_ptr< WrapperBase > edp) const override
void setupUnscheduled(UnscheduledConfigurator const &) final
bool productResolved() const
ProductData const & getProductData() const
bool productWasDeleted_() const override
Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
void putOrMergeProduct_(std::unique_ptr< WrapperBase > prod) const final
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const override
void resetProductData_(bool deleteEarly) override
bool unscheduledWasNotRun_() const override
bool singleProduct_() const final
Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
void putOrMergeProduct(std::unique_ptr< WrapperBase > edp) const
void setProvenance_(ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid) override
static Resolution makeAmbiguous()
void setProcessHistory_(ProcessHistory const &ph) final
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const override
void prefetchAsync_(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
def branchType(schema, name)
std::string const & moduleLabel() const
WrapperBase * unsafe_wrapper() const
static HepMC::HEPEVT_Wrapper wrapper
void putProduct_(std::unique_ptr< WrapperBase > edp) const override
void prefetchAsync_(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
void setFailedStatus() const