54 #define xstr(s) str(s) 62 bool oneTimeInitializationImpl() {
65 static std::unique_ptr<edm::ThreadsController> tsiPtr = std::make_unique<edm::ThreadsController>(1);
75 bool oneTimeInitialization() {
76 static const bool s_init{oneTimeInitializationImpl()};
85 : globalControl_(oneapi::tbb::global_control::max_allowed_parallelism, 1),
87 espController_(
std::make_unique<eventsetup::EventSetupsController>()),
91 (
void)oneTimeInitialization();
95 auto psetPtr =
desc.parameterSet();
103 auto procDesc =
desc.processDesc();
108 auto& serviceSets = procDesc->getServicesPSets();
116 std::shared_ptr<CommonParams>
common(
items.initMisc(*psetPtr));
123 auto nConcurrentLumis = 1
U;
124 auto nConcurrentRuns = 1
U;
129 esp_->add(std::dynamic_pointer_cast<eventsetup::DataProxyProvider>(
esHelper_));
130 esp_->add(std::dynamic_pointer_cast<EventSetupRecordIntervalFinder>(
esHelper_));
138 auto psetid = emptyPSet.
id();
154 produce.moduleLabel_,
157 twd.friendlyClassName(),
158 produce.instanceLabel_,
165 dataProducts_.emplace_back(product, std::unique_ptr<WrapperBase>());
166 preg_->addProduct(product);
185 auto ep = std::make_shared<EventPrincipal>(
preg_,
212 throw cms::Exception(
"LogicError") <<
"Products must be declared to the TestProcessor::Config object\n" 213 "with a call to the function \'produces\' BEFORE passing the\n" 214 "TestProcessor::Config object to the TestProcessor constructor";
224 return schedule_->totalEventsPassed() > 0;
236 arena_.execute([
this, iNum]() {
265 std::shared_ptr<edm::LuminosityBlockPrincipal>
lumi;
290 arena_.execute([
this, iNum]() {
315 std::shared_ptr<edm::RunPrincipal> rp;
316 arena_.execute([
this, &rp]() {
347 auto pbp =
arena_.execute([
this]() {
419 actReg_->postBeginJobSignal_();
431 std::vector<edm::SubProcess> emptyList;
436 beginGlobalTransitionAsync<Traits>(
438 globalWaitTask.wait();
454 auto const& es =
esp_->eventSetupImpl();
458 std::vector<edm::SubProcess> emptyList;
462 beginGlobalTransitionAsync<Traits>(
464 globalWaitTask.wait();
477 streamLoopWaitTask.wait();
494 auto const& es =
esp_->eventSetupImpl();
498 std::vector<edm::SubProcess> emptyList;
502 beginGlobalTransitionAsync<Traits>(
504 globalWaitTask.wait();
519 streamLoopWaitTask.wait();
528 pep->clearEventPrincipal();
529 pep->fillEventPrincipal(
542 auto r = pep->getProductResolver(
p.first.branchID());
567 auto const& es =
esp_->eventSetupImpl();
571 std::vector<edm::SubProcess> emptyList;
587 streamLoopWaitTask.wait();
599 globalWaitTask.wait();
602 return lumiPrincipal;
606 std::shared_ptr<RunPrincipal> rp;
618 auto const& es =
esp_->eventSetupImpl();
622 std::vector<edm::SubProcess> emptyList;
638 streamLoopWaitTask.wait();
650 globalWaitTask.wait();
663 std::vector<edm::SubProcess> emptyList;
675 globalWaitTask.wait();
678 return &processBlockPrincipal;
689 "Multiple exceptions were thrown while executing endJob. An exception message follows for each.\n");
699 c.call([actReg]() { actReg->preEndJobSignal_(); });
701 c.call([actReg]() { actReg->postEndJobSignal_(); });
void put(std::pair< edm::EDPutTokenT< T >, std::unique_ptr< T >> &&iPut)
std::shared_ptr< LuminosityBlockPrincipal > endLuminosityBlock()
std::shared_ptr< ActivityRegistry > actReg_
edm::test::ProcessBlock testBeginProcessBlockImpl()
Timestamp const & endTime() const
static PluginManager & configure(const Config &)
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
std::vector< std::pair< edm::BranchDescription, std::unique_ptr< WrapperBase > > > dataProducts_
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
bool registerProcessHistory(ProcessHistory const &processHistory)
LuminosityBlockNumber_t lumiNumber_
unsigned long long EventNumber_t
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const
edm::test::LuminosityBlock testEndLuminosityBlockImpl()
void ensureAvailableAccelerators(edm::ParameterSet const ¶meterSet)
EventNumber_t eventNumber_
std::string const & pythonConfiguration() const
ProcessContext processContext_
edm::test::Run testBeginRunImpl(edm::RunNumber_t iNum, std::pair< edm::test::ESPutTokenT< T >, std::unique_ptr< T >> &&iPut, U &&... iArgs)
unsigned int LuminosityBlockNumber_t
void beginLuminosityBlock()
oneapi::tbb::task_group taskGroup_
PreallocationConfiguration preallocations_
TEMPL(T2) struct Divides void
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)
ProcessBlockPrincipal & processBlockPrincipal() const
std::vector< std::string > const & extraProcesses() const
unsigned int numberOfThreads() const
void setEventNumber(edm::EventNumber_t)
std::shared_ptr< BranchIDListHelper > branchIDListHelper_
ParameterSetID id() const
Timestamp const & beginTime() const
ParameterSet const & registerIt()
PluginManager::Config config()
std::shared_ptr< EventSetupTestHelper > esHelper_
std::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper_
std::string labelOfTestModule_
std::unique_ptr< eventsetup::EventSetupsController > espController_
edm::test::Event testImpl()
std::shared_ptr< eventsetup::EventSetupProvider > esp_
unsigned int numberOfStreams() const
void teardownProcessing()
std::unique_ptr< Schedule > schedule_
std::shared_ptr< ProcessConfiguration const > processConfiguration_
ServiceToken serviceToken_
edm::test::LuminosityBlock testBeginLuminosityBlockImpl(edm::LuminosityBlockNumber_t iNum, std::pair< edm::test::ESPutTokenT< T >, std::unique_ptr< T >> &&iPut, U &&... iArgs)
edm::test::ProcessBlock testEndProcessBlockImpl()
unsigned int numberOfRuns() const
void insert(std::unique_ptr< ProcessBlockPrincipal >)
std::vector< ProduceEntry > const & produceEntries() const
std::vector< ESProduceEntry > const & esProduceEntries() const
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
bool beginProcessBlockCalled_
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
void setLuminosityBlockNumber(edm::LuminosityBlockNumber_t)
unsigned int numberOfLuminosityBlocks() const
PrincipalCache principalCache_
ProcessBlockPrincipal const * endProcessBlock()
std::shared_ptr< ProductRegistry > preg_
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
std::unique_ptr< ExceptionToActionTable const > act_table_
static EventNumber_t maxEventNumber()
oneapi::tbb::task_arena arena_
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
edm::test::Run testEndRunImpl()
void setRunNumber(edm::RunNumber_t)
std::unique_ptr< HistoryAppender > historyAppender_
void emplace_back(Args &&... args)
TestProcessor(Config const &iConfig, ServiceToken iToken=ServiceToken())
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
static ParentageRegistry * instance()
std::shared_ptr< ProcessBlockHelper > processBlockHelper_
ProcessHistoryRegistry processHistoryRegistry_
std::shared_ptr< RunPrincipal > endRun()
bool insertMapped(value_type const &v)