50 #define xstr(s) str(s)
58 bool oneTimeInitializationImpl() {
61 static std::unique_ptr<edm::ThreadsController> tsiPtr = std::make_unique<edm::ThreadsController>(1);
71 bool oneTimeInitialization() {
72 static const bool s_init{oneTimeInitializationImpl()};
81 : globalControl_(tbb::global_control::max_allowed_parallelism, 1),
83 espController_(
std::make_unique<eventsetup::EventSetupsController>()),
87 (
void)oneTimeInitialization();
91 auto psetPtr =
desc.parameterSet();
97 auto procDesc =
desc.processDesc();
102 auto& serviceSets = procDesc->getServicesPSets();
110 std::shared_ptr<CommonParams>
common(
items.initMisc(*psetPtr));
117 auto nConcurrentLumis = 1
U;
118 auto nConcurrentRuns = 1
U;
124 esp_->add(std::dynamic_pointer_cast<eventsetup::DataProxyProvider>(
esHelper_));
125 esp_->add(std::dynamic_pointer_cast<EventSetupRecordIntervalFinder>(
esHelper_));
133 auto psetid = emptyPSet.
id();
149 produce.moduleLabel_,
152 twd.friendlyClassName(),
153 produce.instanceLabel_,
160 dataProducts_.emplace_back(product, std::unique_ptr<WrapperBase>());
161 preg_->addProduct(product);
178 auto ep = std::make_shared<EventPrincipal>(
preg_,
205 throw cms::Exception(
"LogicError") <<
"Products must be declared to the TestProcessor::Config object\n"
206 "with a call to the function \'produces\' BEFORE passing the\n"
207 "TestProcessor::Config object to the TestProcessor constructor";
217 return schedule_->totalEventsPassed() > 0;
229 arena_.execute([
this, iNum]() {
258 std::shared_ptr<edm::LuminosityBlockPrincipal>
lumi;
283 arena_.execute([
this, iNum]() {
308 std::shared_ptr<edm::RunPrincipal> rp;
309 arena_.execute([
this, &rp]() {
340 auto pbp =
arena_.execute([
this]() {
395 actReg_->preallocateSignal_(bounds);
410 actReg_->postBeginJobSignal_();
422 std::vector<edm::SubProcess> emptyList;
427 globalWaitTask->increment_ref_count();
429 beginGlobalTransitionAsync<Traits>(
432 globalWaitTask->wait_for_all();
433 if (globalWaitTask->exceptionPtr() !=
nullptr) {
434 std::rethrow_exception(*(globalWaitTask->exceptionPtr()));
451 auto const& es =
esp_->eventSetupImpl();
455 std::vector<edm::SubProcess> emptyList;
459 globalWaitTask->increment_ref_count();
460 beginGlobalTransitionAsync<Traits>(
462 globalWaitTask->wait_for_all();
463 if (globalWaitTask->exceptionPtr() !=
nullptr) {
464 std::rethrow_exception(*(globalWaitTask->exceptionPtr()));
470 streamLoopWaitTask->increment_ref_count();
473 beginStreamsTransitionAsync<Traits>(streamLoopWaitTask.get(),
480 streamLoopWaitTask->wait_for_all();
481 if (streamLoopWaitTask->exceptionPtr() !=
nullptr) {
482 std::rethrow_exception(*(streamLoopWaitTask->exceptionPtr()));
500 auto const& es =
esp_->eventSetupImpl();
504 std::vector<edm::SubProcess> emptyList;
508 globalWaitTask->increment_ref_count();
509 beginGlobalTransitionAsync<Traits>(
511 globalWaitTask->wait_for_all();
512 if (globalWaitTask->exceptionPtr() !=
nullptr) {
513 std::rethrow_exception(*(globalWaitTask->exceptionPtr()));
519 streamLoopWaitTask->increment_ref_count();
523 beginStreamsTransitionAsync<Traits>(streamLoopWaitTask.get(),
530 streamLoopWaitTask->wait_for_all();
531 if (streamLoopWaitTask->exceptionPtr() !=
nullptr) {
532 std::rethrow_exception(*(streamLoopWaitTask->exceptionPtr()));
542 pep->clearEventPrincipal();
543 pep->fillEventPrincipal(
556 auto r = pep->getProductResolver(
p.first.branchID());
557 r->putProduct(std::unique_ptr<WrapperBase>());
564 waitTask->increment_ref_count();
569 waitTask->wait_for_all();
570 if (waitTask->exceptionPtr() !=
nullptr) {
571 std::rethrow_exception(*(waitTask->exceptionPtr()));
585 auto const& es =
esp_->eventSetupImpl();
589 std::vector<edm::SubProcess> emptyList;
594 streamLoopWaitTask->increment_ref_count();
606 streamLoopWaitTask->wait_for_all();
607 if (streamLoopWaitTask->exceptionPtr() !=
nullptr) {
608 std::rethrow_exception(*(streamLoopWaitTask->exceptionPtr()));
613 globalWaitTask->increment_ref_count();
616 endGlobalTransitionAsync<Traits>(
618 globalWaitTask->wait_for_all();
619 if (globalWaitTask->exceptionPtr() !=
nullptr) {
620 std::rethrow_exception(*(globalWaitTask->exceptionPtr()));
624 return lumiPrincipal;
628 std::shared_ptr<RunPrincipal> rp;
640 auto const& es =
esp_->eventSetupImpl();
644 std::vector<edm::SubProcess> emptyList;
649 streamLoopWaitTask->increment_ref_count();
661 streamLoopWaitTask->wait_for_all();
662 if (streamLoopWaitTask->exceptionPtr() !=
nullptr) {
663 std::rethrow_exception(*(streamLoopWaitTask->exceptionPtr()));
668 globalWaitTask->increment_ref_count();
671 endGlobalTransitionAsync<Traits>(
673 globalWaitTask->wait_for_all();
674 if (globalWaitTask->exceptionPtr() !=
nullptr) {
675 std::rethrow_exception(*(globalWaitTask->exceptionPtr()));
689 std::vector<edm::SubProcess> emptyList;
692 globalWaitTask->increment_ref_count();
696 endGlobalTransitionAsync<Traits>(
698 globalWaitTask->wait_for_all();
699 if (globalWaitTask->exceptionPtr() !=
nullptr) {
700 std::rethrow_exception(*(globalWaitTask->exceptionPtr()));
704 return &processBlockPrincipal;
715 "Multiple exceptions were thrown while executing endJob. An exception message follows for each.\n");
725 c.call([actReg]() { actReg->preEndJobSignal_(); });
727 c.call([actReg]() { actReg->postEndJobSignal_(); });