53 #define xstr(s) str(s)
61 bool oneTimeInitializationImpl() {
64 static std::unique_ptr<edm::ThreadsController> tsiPtr = std::make_unique<edm::ThreadsController>(1);
74 bool oneTimeInitialization() {
75 static const bool s_init{oneTimeInitializationImpl()};
84 : globalControl_(oneapi::tbb::global_control::max_allowed_parallelism, 1),
86 espController_(std::make_unique<eventsetup::EventSetupsController>()),
90 (void)oneTimeInitialization();
94 auto psetPtr =
desc.parameterSet();
102 auto procDesc =
desc.processDesc();
107 auto& serviceSets = procDesc->getServicesPSets();
115 std::shared_ptr<CommonParams> common(items.
initMisc(*psetPtr));
122 auto nConcurrentLumis = 1U;
123 auto nConcurrentRuns = 1U;
128 esp_->add(std::dynamic_pointer_cast<eventsetup::DataProxyProvider>(
esHelper_));
129 esp_->add(std::dynamic_pointer_cast<EventSetupRecordIntervalFinder>(
esHelper_));
137 auto psetid = emptyPSet.
id();
153 produce.moduleLabel_,
156 twd.friendlyClassName(),
157 produce.instanceLabel_,
164 dataProducts_.emplace_back(product, std::unique_ptr<WrapperBase>());
165 preg_->addProduct(product);
184 auto ep = std::make_shared<EventPrincipal>(
preg_,
211 throw cms::Exception(
"LogicError") <<
"Products must be declared to the TestProcessor::Config object\n"
212 "with a call to the function \'produces\' BEFORE passing the\n"
213 "TestProcessor::Config object to the TestProcessor constructor";
223 return schedule_->totalEventsPassed() > 0;
235 arena_.execute([
this, iNum]() {
264 std::shared_ptr<edm::LuminosityBlockPrincipal>
lumi;
265 arena_.execute([
this, &lumi]() {
289 arena_.execute([
this, iNum]() {
314 std::shared_ptr<edm::RunPrincipal> rp;
315 arena_.execute([
this, &rp]() {
346 auto pbp =
arena_.execute([
this]() {
394 }
while (not task.
done());
405 actReg_->preallocateSignal_(bounds);
420 actReg_->postBeginJobSignal_();
432 std::vector<edm::SubProcess> emptyList;
437 beginGlobalTransitionAsync<Traits>(
441 }
while (not globalWaitTask.
done());
443 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
460 auto const& es =
esp_->eventSetupImpl();
464 std::vector<edm::SubProcess> emptyList;
468 beginGlobalTransitionAsync<Traits>(
472 }
while (not globalWaitTask.
done());
474 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
491 }
while (not streamLoopWaitTask.
done());
493 std::rethrow_exception(*(streamLoopWaitTask.
exceptionPtr()));
511 auto const& es =
esp_->eventSetupImpl();
515 std::vector<edm::SubProcess> emptyList;
519 beginGlobalTransitionAsync<Traits>(
523 }
while (not globalWaitTask.
done());
525 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
543 }
while (not streamLoopWaitTask.
done());
545 std::rethrow_exception(*(streamLoopWaitTask.
exceptionPtr()));
555 pep->clearEventPrincipal();
556 pep->fillEventPrincipal(
569 auto r = pep->getProductResolver(
p.first.branchID());
583 }
while (not waitTask.
done());
599 auto const& es =
esp_->eventSetupImpl();
603 std::vector<edm::SubProcess> emptyList;
621 }
while (not streamLoopWaitTask.
done());
623 std::rethrow_exception(*(streamLoopWaitTask.
exceptionPtr()));
638 }
while (not globalWaitTask.
done());
640 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
644 return lumiPrincipal;
648 std::shared_ptr<RunPrincipal> rp;
660 auto const& es =
esp_->eventSetupImpl();
664 std::vector<edm::SubProcess> emptyList;
682 }
while (not streamLoopWaitTask.
done());
684 std::rethrow_exception(*(streamLoopWaitTask.
exceptionPtr()));
699 }
while (not globalWaitTask.
done());
701 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
715 std::vector<edm::SubProcess> emptyList;
729 }
while (not globalWaitTask.
done());
731 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
735 return &processBlockPrincipal;
746 "Multiple exceptions were thrown while executing endJob. An exception message follows for each.\n");
756 c.
call([actReg]() { actReg->preEndJobSignal_(); });
758 c.
call([actReg]() { actReg->postEndJobSignal_(); });
std::shared_ptr< ActivityRegistry > actReg_
void put(std::pair< edm::EDPutTokenT< T >, std::unique_ptr< T >> &&iPut)
std::unique_ptr< Schedule > initSchedule(ParameterSet ¶meterSet, bool hasSubprocesses, PreallocationConfiguration const &iAllocConfig, ProcessContext const *, ProcessBlockHelperBase &processBlockHelper)
std::shared_ptr< LuminosityBlockPrincipal > endLuminosityBlock()
std::shared_ptr< ActivityRegistry > actReg_
ProcessBlockPrincipal const * endProcessBlock()
edm::test::ProcessBlock testBeginProcessBlockImpl()
const edm::EventSetup & c
static PluginManager & configure(const Config &)
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
std::unique_ptr< ExceptionToActionTable const > act_table_
edm::test::LuminosityBlock testBeginLuminosityBlockImpl(edm::LuminosityBlockNumber_t iNum, std::pair< edm::test::ESPutTokenT< T >, std::unique_ptr< T >> &&iPut, U &&...iArgs)
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
std::vector< std::pair< edm::BranchDescription, std::unique_ptr< WrapperBase > > > dataProducts_
ParameterSetID id() const
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
unsigned int numberOfRuns() const
bool registerProcessHistory(ProcessHistory const &processHistory)
LuminosityBlockNumber_t lumiNumber_
unsigned long long EventNumber_t
edm::test::LuminosityBlock testEndLuminosityBlockImpl()
void ensureAvailableAccelerators(edm::ParameterSet const ¶meterSet)
unsigned int numberOfThreads() const
EventNumber_t eventNumber_
ProcessContext processContext_
unsigned int LuminosityBlockNumber_t
void beginLuminosityBlock()
oneapi::tbb::task_group taskGroup_
void emplace_back(Args &&...args)
PreallocationConfiguration preallocations_
void validateTopLevelParameterSets(ParameterSet *processParameterSet)
~TestProcessor() noexcept(false)
void synchronousEventSetupForInstance(IOVSyncValue const &syncValue, oneapi::tbb::task_group &iGroup, eventsetup::EventSetupsController &espController)
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
void setEventNumber(edm::EventNumber_t)
std::shared_ptr< BranchIDListHelper > branchIDListHelper_
PluginManager::Config config()
std::shared_ptr< EventSetupTestHelper > esHelper_
std::shared_ptr< CommonParams > initMisc(ParameterSet ¶meterSet)
std::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper_
Timestamp const & beginTime() const
std::string labelOfTestModule_
std::unique_ptr< eventsetup::EventSetupsController > espController_
edm::test::Event testImpl()
std::shared_ptr< eventsetup::EventSetupProvider > esp_
std::vector< ProduceEntry > const & produceEntries() const
Timestamp const & endTime() const
std::vector< ESProduceEntry > const & esProduceEntries() const
void teardownProcessing()
std::unique_ptr< Schedule > schedule_
std::shared_ptr< ProcessConfiguration const > processConfiguration_
ServiceToken serviceToken_
edm::test::ProcessBlock testEndProcessBlockImpl()
unsigned int numberOfLuminosityBlocks() const
ProcessBlockPrincipal & processBlockPrincipal() const
void insert(std::unique_ptr< ProcessBlockPrincipal >)
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
bool beginProcessBlockCalled_
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
moduleRegistry_(new ModuleRegistry())
std::shared_ptr< ProcessConfiguration const > processConfiguration() const
void setLuminosityBlockNumber(edm::LuminosityBlockNumber_t)
PrincipalCache principalCache_
ServiceToken initServices(std::vector< ParameterSet > &servicePSets, ParameterSet &processPSet, ServiceToken const &iToken, serviceregistry::ServiceLegacy iLegacy, bool associate)
std::shared_ptr< ProductRegistry > preg_
edm::test::Run testBeginRunImpl(edm::RunNumber_t iNum, std::pair< edm::test::ESPutTokenT< T >, std::unique_ptr< T >> &&iPut, U &&...iArgs)
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
std::unique_ptr< ExceptionToActionTable const > act_table_
ServiceToken addCPRandTNS(ParameterSet const ¶meterSet, ServiceToken const &token)
static EventNumber_t maxEventNumber()
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
oneapi::tbb::task_arena arena_
edm::test::Run testEndRunImpl()
void setRunNumber(edm::RunNumber_t)
std::unique_ptr< HistoryAppender > historyAppender_
unsigned int numberOfStreams() const
std::shared_ptr< SignallingProductRegistry const > preg() const
TestProcessor(Config const &iConfig, ServiceToken iToken=ServiceToken())
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()
void call(std::function< void(void)>)
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
std::exception_ptr const * exceptionPtr() const
Returns exception thrown by dependent task.
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
static ParentageRegistry * instance()
std::shared_ptr< ProcessBlockHelper > processBlockHelper_
ProcessHistoryRegistry processHistoryRegistry_
ParameterSet const & registerIt()
std::shared_ptr< RunPrincipal > endRun()
std::string const & pythonConfiguration() const
bool insertMapped(value_type const &v)
std::vector< std::string > const & extraProcesses() const
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const