52 #define xstr(s) str(s)
60 bool oneTimeInitializationImpl() {
63 static std::unique_ptr<edm::ThreadsController> tsiPtr = std::make_unique<edm::ThreadsController>(1);
73 bool oneTimeInitialization() {
74 static const bool s_init{oneTimeInitializationImpl()};
83 : globalControl_(tbb::global_control::max_allowed_parallelism, 1),
85 espController_(std::make_unique<eventsetup::EventSetupsController>()),
89 (void)oneTimeInitialization();
93 auto psetPtr =
desc.parameterSet();
99 auto procDesc =
desc.processDesc();
104 auto& serviceSets = procDesc->getServicesPSets();
112 std::shared_ptr<CommonParams> common(items.
initMisc(*psetPtr));
119 auto nConcurrentLumis = 1U;
120 auto nConcurrentRuns = 1U;
125 esp_->add(std::dynamic_pointer_cast<eventsetup::DataProxyProvider>(
esHelper_));
126 esp_->add(std::dynamic_pointer_cast<EventSetupRecordIntervalFinder>(
esHelper_));
134 auto psetid = emptyPSet.
id();
150 produce.moduleLabel_,
153 twd.friendlyClassName(),
154 produce.instanceLabel_,
161 dataProducts_.emplace_back(product, std::unique_ptr<WrapperBase>());
162 preg_->addProduct(product);
181 auto ep = std::make_shared<EventPrincipal>(
preg_,
208 throw cms::Exception(
"LogicError") <<
"Products must be declared to the TestProcessor::Config object\n"
209 "with a call to the function \'produces\' BEFORE passing the\n"
210 "TestProcessor::Config object to the TestProcessor constructor";
220 return schedule_->totalEventsPassed() > 0;
232 arena_.execute([
this, iNum]() {
261 std::shared_ptr<edm::LuminosityBlockPrincipal>
lumi;
262 arena_.execute([
this, &lumi]() {
286 arena_.execute([
this, iNum]() {
311 std::shared_ptr<edm::RunPrincipal> rp;
312 arena_.execute([
this, &rp]() {
343 auto pbp =
arena_.execute([
this]() {
391 }
while (not task.
done());
402 actReg_->preallocateSignal_(bounds);
417 actReg_->postBeginJobSignal_();
429 std::vector<edm::SubProcess> emptyList;
434 beginGlobalTransitionAsync<Traits>(
438 }
while (not globalWaitTask.
done());
440 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
457 auto const& es =
esp_->eventSetupImpl();
461 std::vector<edm::SubProcess> emptyList;
465 beginGlobalTransitionAsync<Traits>(
469 }
while (not globalWaitTask.
done());
471 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
488 }
while (not streamLoopWaitTask.
done());
490 std::rethrow_exception(*(streamLoopWaitTask.
exceptionPtr()));
508 auto const& es =
esp_->eventSetupImpl();
512 std::vector<edm::SubProcess> emptyList;
516 beginGlobalTransitionAsync<Traits>(
520 }
while (not globalWaitTask.
done());
522 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
540 }
while (not streamLoopWaitTask.
done());
542 std::rethrow_exception(*(streamLoopWaitTask.
exceptionPtr()));
552 pep->clearEventPrincipal();
553 pep->fillEventPrincipal(
566 auto r = pep->getProductResolver(
p.first.branchID());
580 }
while (not waitTask.
done());
596 auto const& es =
esp_->eventSetupImpl();
600 std::vector<edm::SubProcess> emptyList;
618 }
while (not streamLoopWaitTask.
done());
620 std::rethrow_exception(*(streamLoopWaitTask.
exceptionPtr()));
635 }
while (not globalWaitTask.
done());
637 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
641 return lumiPrincipal;
645 std::shared_ptr<RunPrincipal> rp;
657 auto const& es =
esp_->eventSetupImpl();
661 std::vector<edm::SubProcess> emptyList;
679 }
while (not streamLoopWaitTask.
done());
681 std::rethrow_exception(*(streamLoopWaitTask.
exceptionPtr()));
696 }
while (not globalWaitTask.
done());
698 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
712 std::vector<edm::SubProcess> emptyList;
726 }
while (not globalWaitTask.
done());
728 std::rethrow_exception(*(globalWaitTask.
exceptionPtr()));
732 return &processBlockPrincipal;
743 "Multiple exceptions were thrown while executing endJob. An exception message follows for each.\n");
753 c.
call([actReg]() { actReg->preEndJobSignal_(); });
755 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()
unsigned int numberOfThreads() const
EventNumber_t eventNumber_
ProcessContext processContext_
unsigned int LuminosityBlockNumber_t
void beginLuminosityBlock()
tbb::task_group taskGroup_
void emplace_back(Args &&...args)
PreallocationConfiguration preallocations_
void validateTopLevelParameterSets(ParameterSet *processParameterSet)
~TestProcessor() noexcept(false)
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_
void synchronousEventSetupForInstance(IOVSyncValue const &syncValue, tbb::task_group &iGroup, eventsetup::EventSetupsController &espController)
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
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