55 using std::placeholders::_1;
57 bool binary_search_string(std::vector<std::string>
const&
v,
std::string const&
s) {
58 return std::binary_search(
v.begin(),
v.end(),
s);
64 std::shared_ptr<TriggerResultInserter> makeInserter(
ParameterSet& proc_pset,
65 PreallocationConfiguration
const& iPrealloc,
66 ProductRegistry& preg,
67 ExceptionToActionTable
const&
actions,
68 std::shared_ptr<ActivityRegistry> areg,
69 std::shared_ptr<ProcessConfiguration> processConfiguration) {
70 ParameterSet* trig_pset = proc_pset.getPSetForUpdate(
"@trigger_paths");
71 trig_pset->registerIt();
73 WorkerParams work_args(trig_pset, preg, &iPrealloc, processConfiguration,
actions);
74 ModuleDescription md(trig_pset->id(),
75 "TriggerResultInserter",
77 processConfiguration.get(),
80 areg->preModuleConstructionSignal_(md);
81 bool postCalled =
false;
82 std::shared_ptr<TriggerResultInserter> returnValue;
85 maker::ModuleHolderT<TriggerResultInserter> holder(
86 make_shared_noexcept_false<TriggerResultInserter>(*trig_pset, iPrealloc.numberOfStreams()),
87 static_cast<Maker const*>(
nullptr));
88 holder.setModuleDescription(md);
89 holder.registerProductsAndCallbacks(&preg);
90 returnValue = holder.module();
93 areg->postModuleConstructionSignal_(md);
96 CMS_SA_ALLOW try { areg->postModuleConstructionSignal_(md); }
catch (...) {
105 template <
typename T>
106 void makePathStatusInserters(std::vector<
edm::propagate_const<std::shared_ptr<T>>>& pathStatusInserters,
107 std::vector<std::string>
const&
pathNames,
108 PreallocationConfiguration
const& iPrealloc,
109 ProductRegistry& preg,
110 std::shared_ptr<ActivityRegistry> areg,
111 std::shared_ptr<ProcessConfiguration> processConfiguration,
118 pathStatusInserters.reserve(
pathNames.size());
121 ModuleDescription md(
124 areg->preModuleConstructionSignal_(md);
125 bool postCalled =
false;
128 maker::ModuleHolderT<T> holder(make_shared_noexcept_false<T>(iPrealloc.numberOfStreams()),
129 static_cast<Maker const*>(
nullptr));
130 holder.setModuleDescription(md);
131 holder.registerProductsAndCallbacks(&preg);
132 pathStatusInserters.emplace_back(holder.module());
135 areg->postModuleConstructionSignal_(md);
138 CMS_SA_ALLOW try { areg->postModuleConstructionSignal_(md); }
catch (...) {
147 void checkAndInsertAlias(
std::string const& friendlyClassName,
153 ProductRegistry
const& preg,
154 std::multimap<BranchKey, BranchKey>& aliasMap,
155 std::map<BranchKey, BranchKey>& aliasKeys) {
159 if (preg.productList().find(
key) == preg.productList().end()) {
162 for (
auto const& product : preg.productList()) {
165 <<
"There are no products of type '" << friendlyClassName <<
"'\n"
166 <<
"with module label '" <<
moduleLabel <<
"' and instance name '" << productInstanceName <<
"'.\n";
171 if (
auto iter = aliasMap.find(
key); iter != aliasMap.end()) {
173 if (iter->second.moduleLabel() ==
alias) {
175 <<
"The module label alias '" <<
alias <<
"' is used for multiple products of type '" << friendlyClassName
176 <<
"' with module label '" <<
moduleLabel <<
"' and instance name '" << productInstanceName
177 <<
"'. One alias has the instance name '" << iter->first.productInstanceName()
178 <<
"' and the other has the instance name '" << instanceAlias <<
"'.";
182 std::string const& theInstanceAlias(instanceAlias == star ? productInstanceName : instanceAlias);
183 BranchKey aliasKey(friendlyClassName,
alias, theInstanceAlias,
processName);
184 if (preg.productList().find(aliasKey) != preg.productList().end()) {
186 <<
"A product of type '" << friendlyClassName <<
"'\n"
187 <<
"with module label '" <<
alias <<
"' and instance name '" << theInstanceAlias <<
"'\n"
188 <<
"already exists.\n";
190 auto iter = aliasKeys.find(aliasKey);
191 if (iter != aliasKeys.end()) {
193 if (iter->second !=
key) {
195 <<
"The module label alias '" <<
alias <<
"' and product instance alias '" << theInstanceAlias <<
"'\n"
196 <<
"are used for multiple products of type '" << friendlyClassName <<
"'\n"
197 <<
"One has module label '" <<
moduleLabel <<
"' and product instance name '" << productInstanceName
199 <<
"the other has module label '" << iter->second.moduleLabel() <<
"' and product instance name '"
200 << iter->second.productInstanceName() <<
"'.\n";
203 auto prodIter = preg.productList().find(
key);
204 if (prodIter != preg.productList().end()) {
205 if (!prodIter->second.produced()) {
207 <<
"The module label alias '" <<
alias <<
"' and product instance alias '" << theInstanceAlias <<
"'\n"
208 <<
"are used for a product of type '" << friendlyClassName <<
"'\n"
209 <<
"with module label '" <<
moduleLabel <<
"' and product instance name '" << productInstanceName
211 <<
"An EDAlias can only be used for products produced in the current process. This one is not.\n";
213 aliasMap.insert(std::make_pair(
key, aliasKey));
214 aliasKeys.insert(std::make_pair(aliasKey,
key));
220 std::vector<std::string> aliases = proc_pset.getParameter<std::vector<std::string>>(
"@all_aliases");
221 if (aliases.empty()) {
228 desc.add<
std::string>(
"fromProductInstance", star);
231 std::multimap<BranchKey, BranchKey> aliasMap;
233 std::map<BranchKey, BranchKey> aliasKeys;
238 std::vector<std::string> vPSetNames = aliasPSet.getParameterNamesForType<
VParameterSet>();
246 if (productInstanceName == star) {
249 for (ProductRegistry::ProductList::const_iterator it = preg.productList().lower_bound(lowerBound);
250 it != preg.productList().end() && it->first.friendlyClassName() == friendlyClassName &&
258 checkAndInsertAlias(friendlyClassName,
260 it->first.productInstanceName(),
271 for (
auto const& product : preg.productList()) {
274 <<
"There are no products of type '" << friendlyClassName <<
"'\n"
280 checkAndInsertAlias(friendlyClassName,
295 for (
auto const& aliasEntry : aliasMap) {
296 ProductRegistry::ProductList::const_iterator it = preg.productList().find(aliasEntry.first);
297 assert(it != preg.productList().end());
298 preg.addLabelAlias(it->second, aliasEntry.second.moduleLabel(), aliasEntry.second.productInstanceName());
302 typedef std::vector<std::string>
vstring;
306 struct BranchesCases {
307 BranchesCases(std::vector<std::string> cases) : caseLabels{
std::move(cases)} {}
308 std::vector<BranchKey> chosenBranches;
309 std::vector<std::string> caseLabels;
311 std::map<std::string, BranchesCases> switchMap;
312 for (
auto&
prod : preg.productListUpdator()) {
313 if (
prod.second.isSwitchAlias()) {
314 auto it = switchMap.find(
prod.second.moduleLabel());
315 if (it == switchMap.end()) {
317 auto inserted = switchMap.emplace(
prod.second.moduleLabel(),
318 switchPSet.getParameter<std::vector<std::string>>(
"@all_cases"));
324 for (
auto const& productIter : preg.productList()) {
325 BranchKey
const& branchKey = productIter.first;
334 BranchDescription
const& desc = productIter.second;
335 if (desc.branchType() ==
prod.second.branchType() and
336 desc.unwrappedTypeID().typeInfo() ==
prod.second.unwrappedTypeID().typeInfo() and
337 branchKey.moduleLabel() ==
prod.second.switchAliasModuleLabel() and
338 branchKey.productInstanceName() ==
prod.second.productInstanceName()) {
339 prod.second.setSwitchAliasForBranch(desc);
340 it->second.chosenBranches.push_back(
prod.first);
346 ex <<
"Trying to find a BranchDescription to be aliased-for by SwitchProducer with\n"
347 <<
" friendly class name = " <<
prod.second.friendlyClassName() <<
"\n"
348 <<
" module label = " <<
prod.second.moduleLabel() <<
"\n"
349 <<
" product instance name = " <<
prod.second.productInstanceName() <<
"\n"
351 <<
"\n\nbut did not find any. Please contact a framework developer.";
352 ex.addContext(
"Calling Schedule.cc:processSwitchProducers()");
357 if (switchMap.empty())
360 for (
auto& elem : switchMap) {
361 std::sort(elem.second.chosenBranches.begin(), elem.second.chosenBranches.end());
366 std::vector<bool> foundBranches;
367 for (
auto const& switchItem : switchMap) {
368 auto const& switchLabel = switchItem.first;
369 auto const& chosenBranches = switchItem.second.chosenBranches;
370 auto const& caseLabels = switchItem.second.caseLabels;
371 foundBranches.resize(chosenBranches.size());
372 for (
auto const& caseLabel : caseLabels) {
373 std::fill(foundBranches.begin(), foundBranches.end(),
false);
374 for (
auto& nonConstItem : preg.productListUpdator()) {
375 auto const&
item = nonConstItem;
385 nonConstItem.second.setTransient(
true);
387 auto range = std::equal_range(chosenBranches.begin(),
388 chosenBranches.end(),
389 BranchKey(
item.first.friendlyClassName(),
391 item.first.productInstanceName(),
392 item.first.processName()));
395 <<
"SwitchProducer " << switchLabel <<
" has a case " << caseLabel <<
" with a product "
396 <<
item.first <<
" that is not produced by the chosen case "
398 .getUntrackedParameter<std::string>(
"@chosen_case");
404 auto const&
bd =
item.second;
405 if (not
bd.branchAliases().empty()) {
407 <<
"SwitchProducer does not support ROOT branch aliases. Got the following ROOT branch "
408 "aliases for SwitchProducer with label "
409 << switchLabel <<
" for case " << caseLabel <<
":";
410 for (
auto const& branchAlias :
bd.branchAliases()) {
411 ex <<
" " << branchAlias;
418 for (
size_t i = 0;
i < chosenBranches.size();
i++) {
419 if (not foundBranches[
i]) {
421 <<
"SwitchProducer " << switchLabel <<
" has a case " << caseLabel
422 <<
" that does not produce a product " << chosenBranches[
i] <<
" that is produced by the chosen case "
424 .getUntrackedParameter<std::string>(
"@chosen_case");
432 vstring const& end_path_name_list,
434 std::set<std::string>
const& usedModuleLabels,
435 std::map<
std::string, std::vector<std::pair<std::string, int>>>& outputModulePathPositions) {
449 std::string const moduleEdmType(
"@module_edm_type");
455 std::set<std::string> modulesInConfigSet(modulesInConfig.begin(), modulesInConfig.end());
459 vstring scheduledPaths = proc_pset.getParameter<
vstring>(
"@paths");
460 std::set<std::string> modulesOnPaths;
462 std::set<std::string> noEndPaths(scheduledPaths.begin(), scheduledPaths.end());
463 for (
auto const&
endPath : end_path_name_list) {
468 for (
auto const&
path : noEndPaths) {
476 std::vector<std::string> labelsToBeDropped;
477 labelsToBeDropped.reserve(modulesInConfigSet.size());
478 std::set_difference(modulesInConfigSet.begin(),
479 modulesInConfigSet.end(),
480 usedModuleLabels.begin(),
481 usedModuleLabels.end(),
482 std::back_inserter(labelsToBeDropped));
484 const unsigned int sizeBeforeOutputModules = labelsToBeDropped.size();
485 for (
auto const& modLabel : usedModuleLabels) {
489 edmType = proc_pset.getParameterSet(modLabel).getParameter<
std::string>(moduleEdmType);
490 if (edmType == outputModule) {
491 outputModuleLabels.push_back(modLabel);
492 labelsToBeDropped.push_back(modLabel);
494 if (edmType == edAnalyzer) {
495 if (modulesOnPaths.end() == modulesOnPaths.find(modLabel)) {
496 labelsToBeDropped.push_back(modLabel);
503 labelsToBeDropped.begin(), labelsToBeDropped.begin() + sizeBeforeOutputModules, labelsToBeDropped.end());
509 vstring::iterator endAfterRemove =
510 std::remove_if(modulesInConfig.begin(),
511 modulesInConfig.end(),
512 std::bind(binary_search_string, std::ref(labelsToBeDropped), _1));
513 modulesInConfig.erase(endAfterRemove, modulesInConfig.end());
519 for (vstring::const_iterator iEndPath = end_path_name_list.begin(), endEndPath = end_path_name_list.end();
520 iEndPath != endEndPath;
523 vstring::iterator iSave =
labels.begin();
524 vstring::iterator iBegin =
labels.begin();
526 for (vstring::iterator iLabel =
labels.begin(), iEnd =
labels.end(); iLabel != iEnd; ++iLabel) {
527 if (binary_search_string(labelsToBeDropped, *iLabel)) {
528 if (binary_search_string(outputModuleLabels, *iLabel)) {
529 outputModulePathPositions[*iLabel].emplace_back(*iEndPath, iSave - iBegin);
532 if (iSave != iLabel) {
533 iSave->swap(*iLabel);
541 proc_pset.eraseSimpleParameter(*iEndPath);
542 endPathsToBeDropped.push_back(*iEndPath);
550 endAfterRemove = std::remove_if(scheduledPaths.begin(),
551 scheduledPaths.end(),
552 std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
553 scheduledPaths.erase(endAfterRemove, scheduledPaths.end());
557 vstring scheduledEndPaths = proc_pset.getParameter<
vstring>(
"@end_paths");
558 endAfterRemove = std::remove_if(scheduledEndPaths.begin(),
559 scheduledEndPaths.end(),
560 std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
561 scheduledEndPaths.erase(endAfterRemove, scheduledEndPaths.end());
565 class RngEDConsumer :
public EDConsumerBase {
567 explicit RngEDConsumer(std::set<TypeID>& typesConsumed) {
569 if (rng.isAvailable()) {
570 rng->consumes(consumesCollector());
571 for (
auto const& consumesInfo : this->consumesInfo()) {
572 typesConsumed.emplace(consumesInfo.type());
591 std::shared_ptr<ActivityRegistry> areg,
592 std::shared_ptr<ProcessConfiguration> processConfiguration,
593 bool hasSubprocesses,
598 ? std::shared_ptr<TriggerResultInserter>{}
599 : makeInserter(proc_pset, prealloc, preg,
actions, areg, processConfiguration)},
601 all_output_communicators_(),
602 preallocConfig_(prealloc),
603 pathNames_(&tns.getTrigPaths()),
604 endPathNames_(&tns.getEndPaths()),
605 wantSummary_(tns.wantSummary()),
606 endpathsAreActive_(
true) {
607 makePathStatusInserters(pathStatusInserters_,
612 processConfiguration,
615 makePathStatusInserters(endPathStatusInserters_,
620 processConfiguration,
623 assert(0 < prealloc.numberOfStreams());
624 streamSchedules_.reserve(prealloc.numberOfStreams());
625 for (
unsigned int i = 0;
i < prealloc.numberOfStreams(); ++
i) {
626 streamSchedules_.emplace_back(make_shared_noexcept_false<StreamSchedule>(resultsInserter(),
627 pathStatusInserters_,
628 endPathStatusInserters_,
637 processConfiguration,
645 const std::string kTriggerResults(
"TriggerResults");
646 std::vector<std::string> modulesToUse;
647 modulesToUse.reserve(streamSchedules_[0]->allWorkers().
size());
648 for (
auto const& worker : streamSchedules_[0]->allWorkers()) {
649 if (worker->description().moduleLabel() != kTriggerResults) {
650 modulesToUse.push_back(worker->description().moduleLabel());
654 unsigned int const nUnscheduledModules = streamSchedules_[0]->numberOfUnscheduledModules();
655 if (nUnscheduledModules > 0) {
656 std::vector<std::string>
temp;
657 temp.reserve(modulesToUse.size());
658 auto itBeginUnscheduled = modulesToUse.begin() + modulesToUse.size() - nUnscheduledModules;
659 std::copy(itBeginUnscheduled, modulesToUse.end(), std::back_inserter(
temp));
660 std::copy(modulesToUse.begin(), itBeginUnscheduled, std::back_inserter(
temp));
661 temp.swap(modulesToUse);
665 globalSchedule_ = std::make_unique<GlobalSchedule>(resultsInserter(),
666 pathStatusInserters_,
667 endPathStatusInserters_,
675 processConfiguration,
680 std::set<std::string> usedModuleLabels;
681 for (
auto const& worker : allWorkers()) {
682 if (worker->description().moduleLabel() != kTriggerResults) {
683 usedModuleLabels.insert(worker->description().moduleLabel());
686 std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string>>(
"@all_modules"));
687 std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
688 reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels, outputModulePathPositions);
689 processEDAliases(proc_pset, processConfiguration->processName(), preg);
693 if (nUnscheduledModules > 0) {
694 std::set<std::string> unscheduledModules(modulesToUse.begin(), modulesToUse.begin() + nUnscheduledModules);
695 preg.setUnscheduledProducts(unscheduledModules);
698 processSwitchProducers(proc_pset, processConfiguration->processName(), preg);
699 proc_pset.registerIt();
700 processConfiguration->setParameterSetID(proc_pset.id());
701 processConfiguration->setProcessConfigurationID();
705 size_t all_workers_count = allWorkers().size();
707 moduleRegistry_->forAllModuleHolders([
this](maker::ModuleHolder* iHolder) {
708 auto comm = iHolder->createOutputModuleCommunicator();
710 all_output_communicators_.emplace_back(std::shared_ptr<OutputModuleCommunicator>{comm.release()});
714 limitOutput(proc_pset, branchIDListHelper.branchIDLists(), subProcessParentageHelper);
718 assert(all_workers_count == allWorkers().
size());
720 branchIDListHelper.updateFromRegistry(preg);
722 for (
auto const& worker : streamSchedules_[0]->allWorkers()) {
723 worker->registerThinnedAssociations(preg, thinnedAssociationsHelper);
725 thinnedAssociationsHelper.sort();
729 for (
auto&
c : all_output_communicators_) {
730 c->selectProducts(preg, thinnedAssociationsHelper);
733 for (
auto& product : preg.productListUpdator()) {
739 std::set<TypeID> productTypesConsumed;
740 std::set<TypeID> elementTypesConsumed;
742 for (
auto const& worker : allWorkers()) {
743 for (
auto const& consumesInfo : worker->consumesInfo()) {
745 productTypesConsumed.emplace(consumesInfo.type());
747 elementTypesConsumed.emplace(consumesInfo.type());
752 if (hasSubprocesses) {
756 { RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed); }
757 preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
760 for (
auto&
c : all_output_communicators_) {
761 c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
765 std::vector<const ModuleDescription*> modDesc;
766 const auto&
workers = allWorkers();
767 modDesc.reserve(
workers.size());
771 std::back_inserter(modDesc),
772 [](
const Worker* iWorker) ->
const ModuleDescription* {
return iWorker->descPtr(); });
775 summaryTimeKeeper_ = std::make_unique<SystemTimeKeeper>(prealloc.numberOfStreams(), modDesc, tns, processContext);
776 auto timeKeeperPtr = summaryTimeKeeper_.get();
806 int maxEventSpecs = 0;
807 int maxEventsOut = -1;
814 std::vector<std::string> psetNamesE;
821 if (maxEventSpecs > 1) {
823 <<
"\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
828 if (vMaxEventsOut !=
nullptr && !vMaxEventsOut->
empty()) {
834 <<
"\nNo entry in 'maxEvents' for output module label '" <<
moduleLabel <<
"'.\n";
846 if (!
c->limitReached()) {
851 LogInfo(
"SuccessfulTermination") <<
"The job is terminating successfully because each output module\n"
852 <<
"has reached its configured limit.\n";
872 LogVerbatim(
"FwkSummary") <<
"TrigReport Process: "
876 <<
"---------- Event Summary ------------";
890 <<
"---------- Path Summary ------------";
891 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#"
892 <<
" " << std::right << std::setw(10) <<
"Executed"
893 <<
" " << std::right << std::setw(10) <<
"Passed"
894 <<
" " << std::right << std::setw(10) <<
"Failed"
895 <<
" " << std::right << std::setw(10) <<
"Error"
900 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
901 <<
p.bitPosition <<
" " << std::right << std::setw(10) <<
p.timesRun <<
" "
902 << std::right << std::setw(10) <<
p.timesPassed <<
" " << std::right << std::setw(10)
903 <<
p.timesFailed <<
" " << std::right << std::setw(10) <<
p.timesExcept <<
" "
926 <<
"-------End-Path Summary ------------";
927 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#"
928 <<
" " << std::right << std::setw(10) <<
"Executed"
929 <<
" " << std::right << std::setw(10) <<
"Passed"
930 <<
" " << std::right << std::setw(10) <<
"Failed"
931 <<
" " << std::right << std::setw(10) <<
"Error"
936 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
937 <<
p.bitPosition <<
" " << std::right << std::setw(10) <<
p.timesRun <<
" "
938 << std::right << std::setw(10) <<
p.timesPassed <<
" " << std::right << std::setw(10)
939 <<
p.timesFailed <<
" " << std::right << std::setw(10) <<
p.timesExcept <<
" "
946 <<
"---------- Modules in Path: " <<
p.name <<
" ------------";
947 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#"
948 <<
" " << std::right << std::setw(10) <<
"Visited"
949 <<
" " << std::right << std::setw(10) <<
"Passed"
950 <<
" " << std::right << std::setw(10) <<
"Failed"
951 <<
" " << std::right << std::setw(10) <<
"Error"
956 unsigned int bitpos = 0;
957 for (
auto const&
mod :
p.moduleInPathSummaries) {
958 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
959 << bitpos <<
" " << std::right << std::setw(10) <<
mod.timesVisited <<
" "
960 << std::right << std::setw(10) <<
mod.timesPassed <<
" " << std::right
961 << std::setw(10) <<
mod.timesFailed <<
" " << std::right << std::setw(10)
962 <<
mod.timesExcept <<
" " <<
mod.moduleLabel <<
"";
970 <<
"------ Modules in End-Path: " <<
p.name <<
" ------------";
971 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#"
972 <<
" " << std::right << std::setw(10) <<
"Visited"
973 <<
" " << std::right << std::setw(10) <<
"Passed"
974 <<
" " << std::right << std::setw(10) <<
"Failed"
975 <<
" " << std::right << std::setw(10) <<
"Error"
980 unsigned int bitpos = 0;
981 for (
auto const&
mod :
p.moduleInPathSummaries) {
982 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
983 << bitpos <<
" " << std::right << std::setw(10) <<
mod.timesVisited <<
" "
984 << std::right << std::setw(10) <<
mod.timesPassed <<
" " << std::right
985 << std::setw(10) <<
mod.timesFailed <<
" " << std::right << std::setw(10)
986 <<
mod.timesExcept <<
" " <<
mod.moduleLabel <<
"";
993 <<
"---------- Module Summary ------------";
994 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Visited"
995 <<
" " << std::right << std::setw(10) <<
"Executed"
996 <<
" " << std::right << std::setw(10) <<
"Passed"
997 <<
" " << std::right << std::setw(10) <<
"Failed"
998 <<
" " << std::right << std::setw(10) <<
"Error"
1003 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) << worker.timesVisited <<
" "
1004 << std::right << std::setw(10) << worker.timesRun <<
" " << std::right
1005 << std::setw(10) << worker.timesPassed <<
" " << std::right << std::setw(10)
1006 << worker.timesFailed <<
" " << std::right << std::setw(10) << worker.timesExcept
1007 <<
" " << worker.moduleLabel <<
"";
1018 <<
"---------- Event Summary ---[sec]----";
1025 LogVerbatim(
"FwkSummary") <<
"TimeReport" << std::setprecision(6) <<
std::fixed <<
" efficiency CPU/Real/thread = "
1028 constexpr
int kColumn1Size = 10;
1029 constexpr
int kColumn2Size = 12;
1030 constexpr
int kColumn3Size = 12;
1033 <<
"---------- Path Summary ---[Real sec]----";
1034 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1035 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec"
1038 const int timesRun =
std::max(1,
p.timesRun);
1040 << std::setw(kColumn1Size) <<
p.realTime /
totalEvents <<
" " << std::right
1041 << std::setw(kColumn2Size) <<
p.realTime / timesRun <<
" " <<
p.name <<
"";
1043 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1044 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec"
1050 <<
"-------End-Path Summary ---[Real sec]----";
1051 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1052 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec"
1056 const int timesRun =
std::max(1,
p.timesRun);
1059 << std::setw(kColumn1Size) <<
p.realTime /
totalEvents <<
" " << std::right
1060 << std::setw(kColumn2Size) <<
p.realTime / timesRun <<
" " <<
p.name <<
"";
1062 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1063 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec"
1070 <<
"---------- Modules in Path: " <<
p.name <<
" ---[Real sec]----";
1071 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1072 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit"
1075 for (
auto const&
mod :
p.moduleInPathSummaries) {
1077 << std::setw(kColumn1Size) <<
mod.realTime /
totalEvents <<
" " << std::right
1078 << std::setw(kColumn2Size) <<
mod.realTime /
std::max(1,
mod.timesVisited) <<
" "
1079 <<
mod.moduleLabel <<
"";
1083 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1084 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit"
1091 <<
"------ Modules in End-Path: " <<
p.name <<
" ---[Real sec]----";
1092 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1093 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit"
1096 for (
auto const&
mod :
p.moduleInPathSummaries) {
1098 << std::setw(kColumn1Size) <<
mod.realTime /
totalEvents <<
" " << std::right
1099 << std::setw(kColumn2Size) <<
mod.realTime /
std::max(1,
mod.timesVisited) <<
" "
1100 <<
mod.moduleLabel <<
"";
1104 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1105 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit"
1111 <<
"---------- Module Summary ---[Real sec]----";
1112 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1113 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec"
1114 <<
" " << std::right << std::setw(kColumn3Size) <<
"per visit"
1119 << std::setw(kColumn1Size) << worker.realTime /
totalEvents <<
" " << std::right
1120 << std::setw(kColumn2Size) << worker.realTime /
std::max(1, worker.timesRun) <<
" "
1121 << std::right << std::setw(kColumn3Size)
1122 << worker.realTime /
std::max(1, worker.timesVisited) <<
" " << worker.moduleLabel
1125 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event"
1126 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec"
1127 <<
" " << std::right << std::setw(kColumn3Size) <<
"per visit"
1138 using std::placeholders::_1;
1143 using std::placeholders::_1;
1161 [
task, activityRegistry, globalContext,
token](std::exception_ptr
const* iExcept)
mutable {
1170 std::exception_ptr ptr;
1174 task.doneWaiting(ptr);
1182 c->writeRunAsync(tHolder, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1200 [
task, activityRegistry, globalContext,
token](std::exception_ptr
const* iExcept)
mutable {
1209 std::exception_ptr ptr;
1213 task.doneWaiting(ptr);
1220 c->writeLumiAsync(tHolder, lbp, processContext, activityRegistry);
1225 using std::placeholders::_1;
1234 using std::placeholders::_1;
1239 using std::placeholders::_1;
1258 unsigned int iStreamID,
1272 if (worker->description().moduleLabel() == iLabel) {
1277 if (
nullptr ==
found) {
1286 s->replaceModule(newMod, iLabel);
1297 found->updateLookup(iIndices);
1299 auto const&
processName = newMod->moduleDescription().processName();
1300 auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(
processName);
1301 auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(
processName);
1302 auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(
processName);
1303 found->resolvePutIndicies(
InRun, runModuleToIndicies);
1304 found->resolvePutIndicies(
InLumi, lumiModuleToIndicies);
1305 found->resolvePutIndicies(
InEvent, eventModuleToIndicies);
1312 std::vector<ModuleDescription const*>
result;
1343 std::vector<ModuleDescription const*>& descriptions,
1344 unsigned int hint)
const {
1345 streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1349 std::vector<ModuleDescription const*>& descriptions,
1350 unsigned int hint)
const {
1351 streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1355 std::vector<ModuleDescription const*>& allModuleDescriptions,
1356 std::vector<std::pair<unsigned int, unsigned int>>& moduleIDToIndex,
1357 std::vector<std::vector<ModuleDescription const*>>& modulesWhoseProductsAreConsumedBy,
1359 allModuleDescriptions.clear();
1360 moduleIDToIndex.clear();
1361 modulesWhoseProductsAreConsumedBy.clear();
1367 std::map<std::string, ModuleDescription const*> labelToDesc;
1371 allModuleDescriptions.push_back(
p);
1372 moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(
p->id(),
i));
1373 labelToDesc[
p->moduleLabel()] =
p;
1380 std::vector<ModuleDescription const*>&
modules = modulesWhoseProductsAreConsumedBy.at(
i);
1381 worker->modulesWhoseProductsAreConsumed(
modules, preg, labelToDesc);
1389 s->enableEndPaths(active);
1396 rep.eventSummary.totalEvents = 0;
1397 rep.eventSummary.totalEventsPassed = 0;
1398 rep.eventSummary.totalEventsFailed = 0;
1400 s->getTriggerReport(
rep);
1406 rep.eventSummary.totalEvents = 0;
1407 rep.eventSummary.cpuTime = 0.;
1408 rep.eventSummary.realTime = 0.;
1413 int returnValue = 0;
1415 returnValue +=
s->totalEvents();
1421 int returnValue = 0;
1423 returnValue +=
s->totalEventsPassed();
1429 int returnValue = 0;
1431 returnValue +=
s->totalEventsFailed();