44 #include "tbb/task_scheduler_init.h" 46 #define xstr(s) str(s) 62 bool oneTimeInitializationImpl() {
66 static std::unique_ptr<tbb::task_scheduler_init> tsiPtr = std::make_unique<tbb::task_scheduler_init>(1);
76 bool oneTimeInitialization() {
77 static const bool s_init{ oneTimeInitializationImpl()};
86 espController_(
std::make_unique<eventsetup::EventSetupsController>()),
91 (void) oneTimeInitialization();
101 auto procDesc = desc.processDesc();
106 auto& serviceSets = procDesc->getServicesPSets();
121 esp_->add( std::dynamic_pointer_cast<eventsetup::DataProxyProvider>(
esHelper_));
122 esp_->add( std::dynamic_pointer_cast<EventSetupRecordIntervalFinder>(
esHelper_));
127 auto nConcurrentLumis = 1
U;
128 auto nConcurrentRuns = 1
U;
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);
209 <<
"Products must be declared to the TestProcessor::Config object\n" 210 "with a call to the function \'produces\' BEFORE passing the\n" 211 "TestProcessor::Config object to the TestProcessor constructor";
267 actReg_->preallocateSignal_(bounds);
280 actReg_->postBeginJobSignal_();
303 std::vector<edm::SubProcess> emptyList;
307 globalWaitTask->increment_ref_count();
315 globalWaitTask->wait_for_all();
316 if(globalWaitTask->exceptionPtr() !=
nullptr) {
317 std::rethrow_exception(* (globalWaitTask->exceptionPtr()) );
323 streamLoopWaitTask->increment_ref_count();
327 beginStreamsTransitionAsync<Traits>(streamLoopWaitTask.get(),
336 streamLoopWaitTask->wait_for_all();
337 if(streamLoopWaitTask->exceptionPtr() !=
nullptr) {
338 std::rethrow_exception(* (streamLoopWaitTask->exceptionPtr()) );
359 std::vector<edm::SubProcess> emptyList;
363 globalWaitTask->increment_ref_count();
371 globalWaitTask->wait_for_all();
372 if(globalWaitTask->exceptionPtr() !=
nullptr) {
373 std::rethrow_exception(* (globalWaitTask->exceptionPtr()) );
379 streamLoopWaitTask->increment_ref_count();
383 beginStreamsTransitionAsync<Traits>(streamLoopWaitTask.get(),
392 streamLoopWaitTask->wait_for_all();
393 if(streamLoopWaitTask->exceptionPtr() !=
nullptr) {
394 std::rethrow_exception(* (streamLoopWaitTask->exceptionPtr()) );
405 pep->clearEventPrincipal();
420 auto r = pep->getProductResolver(
p.first.branchID());
421 r->putProduct(std::unique_ptr<WrapperBase>());
428 waitTask->increment_ref_count();
433 waitTask->wait_for_all();
434 if(waitTask->exceptionPtr() !=
nullptr) {
435 std::rethrow_exception(* (waitTask->exceptionPtr()) );
448 lumiPrincipal->endTime());
453 std::vector<edm::SubProcess> emptyList;
458 streamLoopWaitTask->increment_ref_count();
472 streamLoopWaitTask->wait_for_all();
473 if(streamLoopWaitTask->exceptionPtr() !=
nullptr) {
474 std::rethrow_exception(* (streamLoopWaitTask->exceptionPtr()) );
479 globalWaitTask->increment_ref_count();
490 globalWaitTask->wait_for_all();
491 if(globalWaitTask->exceptionPtr() !=
nullptr) {
492 std::rethrow_exception(* (globalWaitTask->exceptionPtr()) );
512 std::vector<edm::SubProcess> emptyList;
517 streamLoopWaitTask->increment_ref_count();
531 streamLoopWaitTask->wait_for_all();
532 if(streamLoopWaitTask->exceptionPtr() !=
nullptr) {
533 std::rethrow_exception(* (streamLoopWaitTask->exceptionPtr()) );
538 globalWaitTask->increment_ref_count();
549 globalWaitTask->wait_for_all();
550 if(globalWaitTask->exceptionPtr() !=
nullptr) {
551 std::rethrow_exception(* (globalWaitTask->exceptionPtr()) );
562 ExceptionCollector c(
"Multiple exceptions were thrown while executing endJob. An exception message follows for each.\n");
572 c.
call([actReg](){actReg->preEndJobSignal_();});
574 c.
call([actReg](){actReg->postEndJobSignal_();});
std::shared_ptr< ActivityRegistry > actReg_
void insert(std::shared_ptr< RunPrincipal > rp)
void put(std::pair< edm::EDPutTokenT< T >, std::unique_ptr< T >> &&iPut)
std::shared_ptr< ActivityRegistry > actReg_
static PluginManager & configure(const Config &)
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
std::unique_ptr< ExceptionToActionTable const > act_table_
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
ParameterSetID id() const
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
unsigned int numberOfRuns() const
bool registerProcessHistory(ProcessHistory const &processHistory)
LuminosityBlockNumber_t lumiNumber_
unsigned long long EventNumber_t
unsigned int numberOfThreads() const
EventNumber_t eventNumber_
ProcessContext processContext_
unsigned int LuminosityBlockNumber_t
void beginLuminosityBlock()
void endLuminosityBlock()
void emplace_back(Args &&...args)
PreallocationConfiguration preallocations_
void validateTopLevelParameterSets(ParameterSet *processParameterSet)
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::unique_ptr< edm::EmptyWaitingTask, waitingtask::TaskDestroyer > make_empty_waiting_task()
Create an EmptyWaitingTask which will properly be destroyed.
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_
unsigned int numberOfLuminosityBlocks() const
TestProcessor(Config const &iConfig)
std::shared_ptr< edm::ParameterSet > parameterSet() const
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
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_
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
void setRunNumber(edm::RunNumber_t)
std::unique_ptr< HistoryAppender > historyAppender_
unsigned int numberOfStreams() const
std::shared_ptr< SignallingProductRegistry const > preg() const
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()
void call(std::function< void(void)>)
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
static ParentageRegistry * instance()
ProcessHistoryRegistry processHistoryRegistry_
std::unique_ptr< Schedule > initSchedule(ParameterSet ¶meterSet, bool hasSubprocesses, PreallocationConfiguration const &iAllocConfig, ProcessContext const *)
ParameterSet const & registerIt()
std::vector< std::pair< edm::BranchDescription, std::unique_ptr< WrapperBase > > > dataProducts_
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
def operate(timelog, memlog, json_f, num)