55 #define xstr(s) str(s) 63 bool oneTimeInitializationImpl() {
66 static std::unique_ptr<edm::ThreadsController> tsiPtr = std::make_unique<edm::ThreadsController>(1);
76 bool oneTimeInitialization() {
77 static const bool s_init{oneTimeInitializationImpl()};
86 : globalControl_(oneapi::tbb::global_control::max_allowed_parallelism, 1),
91 (
void)oneTimeInitialization();
95 auto psetPtr =
desc.parameterSet();
105 auto procDesc =
desc.processDesc();
110 auto& serviceSets = procDesc->getServicesPSets();
118 std::shared_ptr<CommonParams>
common(
items.initMisc(*psetPtr));
125 auto nConcurrentLumis = 1
U;
126 auto nConcurrentRuns = 1
U;
131 esp_->add(std::dynamic_pointer_cast<eventsetup::DataProxyProvider>(
esHelper_));
132 esp_->add(std::dynamic_pointer_cast<EventSetupRecordIntervalFinder>(
esHelper_));
140 auto psetid = emptyPSet.
id();
156 produce.moduleLabel_,
159 twd.friendlyClassName(),
160 produce.instanceLabel_,
167 dataProducts_.emplace_back(product, std::unique_ptr<WrapperBase>());
168 preg_->addProduct(product);
187 auto ep = std::make_shared<EventPrincipal>(
preg_,
217 throw cms::Exception(
"LogicError") <<
"Products must be declared to the TestProcessor::Config object\n" 218 "with a call to the function \'produces\' BEFORE passing the\n" 219 "TestProcessor::Config object to the TestProcessor constructor";
229 return schedule_->totalEventsPassed() > 0;
241 arena_.execute([
this, iNum]() {
270 std::shared_ptr<edm::LuminosityBlockPrincipal>
lumi;
295 arena_.execute([
this, iNum]() {
319 std::shared_ptr<edm::RunPrincipal> rp;
320 arena_.execute([
this, &rp]() {
351 auto pbp =
arena_.execute([
this]() {
423 actReg_->postBeginJobSignal_();
435 std::vector<edm::SubProcess> emptyList;
440 beginGlobalTransitionAsync<Traits>(
442 globalWaitTask.wait();
456 auto const& es =
esp_->eventSetupImpl();
460 std::vector<edm::SubProcess> emptyList;
464 beginGlobalTransitionAsync<Traits>(
466 globalWaitTask.wait();
479 streamLoopWaitTask.wait();
496 auto const& es =
esp_->eventSetupImpl();
500 std::vector<edm::SubProcess> emptyList;
504 beginGlobalTransitionAsync<Traits>(
506 globalWaitTask.wait();
521 streamLoopWaitTask.wait();
530 pep->clearEventPrincipal();
531 pep->fillEventPrincipal(
544 auto r = pep->getProductResolver(
p.first.branchID());
569 auto const& es =
esp_->eventSetupImpl();
573 std::vector<edm::SubProcess> emptyList;
589 streamLoopWaitTask.wait();
601 globalWaitTask.wait();
604 lumiPrincipal->setRunPrincipal(std::shared_ptr<RunPrincipal>());
605 return lumiPrincipal;
616 runPrincipal->endTime());
619 auto const& es =
esp_->eventSetupImpl();
623 std::vector<edm::SubProcess> emptyList;
639 streamLoopWaitTask.wait();
651 globalWaitTask.wait();
662 std::vector<edm::SubProcess> emptyList;
674 globalWaitTask.wait();
677 return &processBlockPrincipal;
688 "Multiple exceptions were thrown while executing endJob. An exception message follows for each.\n");
698 c.call([actReg]() { actReg->preEndJobSignal_(); });
700 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
std::unique_ptr< edm::ModuleTypeResolverMaker const > makeModuleTypeResolverMaker(edm::ParameterSet const &pset)
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::unique_ptr< ModuleTypeResolverMaker const > moduleTypeResolverMaker_
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)