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);
184 auto ep = std::make_shared<EventPrincipal>(
preg_,
214 throw cms::Exception(
"LogicError") <<
"Products must be declared to the TestProcessor::Config object\n" 215 "with a call to the function \'produces\' BEFORE passing the\n" 216 "TestProcessor::Config object to the TestProcessor constructor";
226 return schedule_->totalEventsPassed() > 0;
238 arena_.execute([
this, iNum]() {
267 std::shared_ptr<edm::LuminosityBlockPrincipal>
lumi;
292 arena_.execute([
this, iNum]() {
316 std::shared_ptr<edm::RunPrincipal> rp;
317 arena_.execute([
this, &rp]() {
348 auto pbp =
arena_.execute([
this]() {
420 actReg_->postBeginJobSignal_();
432 std::vector<edm::SubProcess> emptyList;
437 beginGlobalTransitionAsync<Traits>(
439 globalWaitTask.wait();
453 auto const& es =
esp_->eventSetupImpl();
457 std::vector<edm::SubProcess> emptyList;
461 beginGlobalTransitionAsync<Traits>(
463 globalWaitTask.wait();
476 streamLoopWaitTask.wait();
493 auto const& es =
esp_->eventSetupImpl();
497 std::vector<edm::SubProcess> emptyList;
501 beginGlobalTransitionAsync<Traits>(
503 globalWaitTask.wait();
518 streamLoopWaitTask.wait();
527 pep->clearEventPrincipal();
528 pep->fillEventPrincipal(
541 auto r = pep->getProductResolver(
p.first.branchID());
566 auto const& es =
esp_->eventSetupImpl();
570 std::vector<edm::SubProcess> emptyList;
586 streamLoopWaitTask.wait();
598 globalWaitTask.wait();
601 lumiPrincipal->setRunPrincipal(std::shared_ptr<RunPrincipal>());
602 return lumiPrincipal;
613 runPrincipal->endTime());
616 auto const& es =
esp_->eventSetupImpl();
620 std::vector<edm::SubProcess> emptyList;
636 streamLoopWaitTask.wait();
648 globalWaitTask.wait();
659 std::vector<edm::SubProcess> emptyList;
671 globalWaitTask.wait();
674 return &processBlockPrincipal;
685 "Multiple exceptions were thrown while executing endJob. An exception message follows for each.\n");
695 c.call([actReg]() { actReg->preEndJobSignal_(); });
697 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()
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
edm::test::LuminosityBlock testEndLuminosityBlockImpl()
void ensureAvailableAccelerators(edm::ParameterSet const ¶meterSet)
EventNumber_t eventNumber_
std::shared_ptr< RunPrincipal > getAvailableRunPrincipalPtr()
std::string const & pythonConfiguration() const
std::shared_ptr< RunPrincipal > runPrincipal_
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
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 setLuminosityBlockNumber(edm::LuminosityBlockNumber_t)
unsigned int numberOfLuminosityBlocks() const
PrincipalCache principalCache_
ProcessBlockPrincipal const * endProcessBlock()
std::shared_ptr< ProductRegistry > preg_
std::unique_ptr< ExceptionToActionTable const > act_table_
static EventNumber_t maxEventNumber()
oneapi::tbb::task_arena arena_
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)