54 using std::placeholders::_1;
56 bool binary_search_string(std::vector<std::string>
const&
v,
std::string const&
s) {
57 return std::binary_search(v.begin(), v.end(),
s);
63 std::shared_ptr<TriggerResultInserter> makeInserter(
ParameterSet& proc_pset,
64 PreallocationConfiguration
const& iPrealloc,
65 ProductRegistry& preg,
66 ExceptionToActionTable
const&
actions,
67 std::shared_ptr<ActivityRegistry> areg,
68 std::shared_ptr<ProcessConfiguration> processConfiguration) {
69 ParameterSet* trig_pset = proc_pset.getPSetForUpdate(
"@trigger_paths");
70 trig_pset->registerIt();
72 WorkerParams work_args(trig_pset, preg, &iPrealloc, processConfiguration, actions);
73 ModuleDescription md(trig_pset->id(),
74 "TriggerResultInserter",
76 processConfiguration.get(),
79 areg->preModuleConstructionSignal_(md);
80 bool postCalled =
false;
81 std::shared_ptr<TriggerResultInserter> returnValue;
83 maker::ModuleHolderT<TriggerResultInserter> holder(
84 make_shared_noexcept_false<TriggerResultInserter>(*trig_pset, iPrealloc.numberOfStreams()),
85 static_cast<Maker const*>(
nullptr));
86 holder.setModuleDescription(md);
87 holder.registerProductsAndCallbacks(&preg);
88 returnValue = holder.module();
91 areg->postModuleConstructionSignal_(md);
95 areg->postModuleConstructionSignal_(md);
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,
114 pset.addParameter<
std::string>(
"@module_type", moduleTypeName);
115 pset.addParameter<
std::string>(
"@module_edm_type",
"EDProducer");
118 pathStatusInserters.reserve(pathNames.size());
120 for (
auto const&
pathName : pathNames) {
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);
139 areg->postModuleConstructionSignal_(md);
149 void checkAndInsertAlias(
std::string const& friendlyClassName,
155 ProductRegistry
const& preg,
156 std::multimap<BranchKey, BranchKey>& aliasMap,
157 std::map<BranchKey, BranchKey>& aliasKeys) {
160 BranchKey
key(friendlyClassName, moduleLabel, productInstanceName, processName);
161 if (preg.productList().find(
key) == preg.productList().end()) {
164 for (
auto const& product : preg.productList()) {
165 if (moduleLabel == product.first.moduleLabel() && processName == product.first.processName()) {
167 <<
"There are no products of type '" << friendlyClassName <<
"'\n" 168 <<
"with module label '" << moduleLabel <<
"' and instance name '" << productInstanceName <<
"'.\n";
173 if (
auto iter = aliasMap.find(
key); iter != aliasMap.end()) {
175 if (iter->second.moduleLabel() ==
alias) {
177 <<
"The module label alias '" << alias <<
"' is used for multiple products of type '" << friendlyClassName
178 <<
"' with module label '" << moduleLabel <<
"' and instance name '" << productInstanceName
179 <<
"'. One alias has the instance name '" << iter->first.productInstanceName()
180 <<
"' and the other has the instance name '" << instanceAlias <<
"'.";
184 std::string const& theInstanceAlias(instanceAlias == star ? productInstanceName : instanceAlias);
185 BranchKey aliasKey(friendlyClassName, alias, theInstanceAlias, processName);
186 if (preg.productList().find(aliasKey) != preg.productList().end()) {
188 <<
"A product of type '" << friendlyClassName <<
"'\n" 189 <<
"with module label '" << alias <<
"' and instance name '" << theInstanceAlias <<
"'\n" 190 <<
"already exists.\n";
192 auto iter = aliasKeys.find(aliasKey);
193 if (iter != aliasKeys.end()) {
195 if (iter->second !=
key) {
197 <<
"The module label alias '" << alias <<
"' and product instance alias '" << theInstanceAlias <<
"'\n" 198 <<
"are used for multiple products of type '" << friendlyClassName <<
"'\n" 199 <<
"One has module label '" << moduleLabel <<
"' and product instance name '" << productInstanceName
201 <<
"the other has module label '" << iter->second.moduleLabel() <<
"' and product instance name '" 202 << iter->second.productInstanceName() <<
"'.\n";
205 auto prodIter = preg.productList().find(
key);
206 if (prodIter != preg.productList().end()) {
207 if (!prodIter->second.produced()) {
209 <<
"The module label alias '" << alias <<
"' and product instance alias '" << theInstanceAlias <<
"'\n" 210 <<
"are used for a product of type '" << friendlyClassName <<
"'\n" 211 <<
"with module label '" << moduleLabel <<
"' and product instance name '" << productInstanceName
213 <<
"An EDAlias can only be used for products produced in the current process. This one is not.\n";
215 aliasMap.insert(std::make_pair(
key, aliasKey));
216 aliasKeys.insert(std::make_pair(aliasKey,
key));
222 std::vector<std::string> aliases = proc_pset.getParameter<std::vector<std::string>>(
"@all_aliases");
223 if (aliases.empty()) {
230 desc.add<
std::string>(
"fromProductInstance", star);
233 std::multimap<BranchKey, BranchKey> aliasMap;
235 std::map<BranchKey, BranchKey> aliasKeys;
239 ParameterSet const& aliasPSet = proc_pset.getParameterSet(alias);
240 std::vector<std::string> vPSetNames = aliasPSet.getParameterNamesForType<
VParameterSet>();
241 for (
std::string const& moduleLabel : vPSetNames) {
248 if (productInstanceName == star) {
250 BranchKey lowerBound(friendlyClassName, moduleLabel,
empty,
empty);
251 for (ProductRegistry::ProductList::const_iterator it = preg.productList().lower_bound(lowerBound);
252 it != preg.productList().end() && it->first.friendlyClassName() == friendlyClassName &&
260 checkAndInsertAlias(friendlyClassName,
262 it->first.productInstanceName(),
273 for (
auto const& product : preg.productList()) {
274 if (moduleLabel == product.first.moduleLabel() && processName == product.first.processName()) {
276 <<
"There are no products of type '" << friendlyClassName <<
"'\n" 277 <<
"with module label '" << moduleLabel <<
"'.\n";
282 checkAndInsertAlias(friendlyClassName,
297 for (
auto const& aliasEntry : aliasMap) {
298 ProductRegistry::ProductList::const_iterator it = preg.productList().find(aliasEntry.first);
299 assert(it != preg.productList().end());
300 preg.addLabelAlias(it->second, aliasEntry.second.moduleLabel(), aliasEntry.second.productInstanceName());
304 typedef std::vector<std::string>
vstring;
306 void processSwitchProducers(
ParameterSet const& proc_pset,
std::string const& processName, ProductRegistry& preg) {
308 struct BranchesCases {
309 BranchesCases(std::vector<std::string> cases) : caseLabels{
std::move(cases)} {}
310 std::vector<BranchKey> chosenBranches;
311 std::vector<std::string> caseLabels;
313 std::map<std::string, BranchesCases> switchMap;
314 for (
auto&
prod : preg.productListUpdator()) {
315 if (
prod.second.isSwitchAlias()) {
316 auto it = switchMap.find(
prod.second.moduleLabel());
317 if (it == switchMap.end()) {
319 auto inserted = switchMap.emplace(
prod.second.moduleLabel(),
320 switchPSet.getParameter<std::vector<std::string>>(
"@all_cases"));
321 assert(inserted.second);
325 for (
auto const& productIter : preg.productList()) {
326 BranchKey
const& branchKey = productIter.first;
327 BranchDescription
const& desc = productIter.second;
328 if (desc.branchType() ==
prod.second.branchType() and
329 desc.unwrappedTypeID().typeInfo() ==
prod.second.unwrappedTypeID().typeInfo() and
330 branchKey.moduleLabel() ==
prod.second.switchAliasModuleLabel() and
331 branchKey.productInstanceName() ==
prod.second.productInstanceName()) {
334 <<
"Encountered a BranchDescription that is aliased-for by SwitchProducer, and whose processName " 335 << branchKey.processName() <<
" differs from current process " << processName
336 <<
". Module label is " << branchKey.moduleLabel() <<
".\nPlease contact a framework developer.";
338 prod.second.setSwitchAliasForBranch(desc);
339 it->second.chosenBranches.push_back(
prod.first);
344 if (switchMap.empty())
347 for (
auto&
elem : switchMap) {
348 std::sort(
elem.second.chosenBranches.begin(),
elem.second.chosenBranches.end());
353 std::vector<bool> foundBranches;
354 for (
auto const& switchItem : switchMap) {
355 auto const& switchLabel = switchItem.first;
356 auto const& chosenBranches = switchItem.second.chosenBranches;
357 auto const& caseLabels = switchItem.second.caseLabels;
358 foundBranches.resize(chosenBranches.size());
359 for (
auto const& caseLabel : caseLabels) {
360 std::fill(foundBranches.begin(), foundBranches.end(),
false);
361 for (
auto& nonConstItem : preg.productListUpdator()) {
362 auto const&
item = nonConstItem;
363 if (
item.first.moduleLabel() == caseLabel) {
372 nonConstItem.second.setTransient(
true);
374 auto range = std::equal_range(chosenBranches.begin(),
375 chosenBranches.end(),
376 BranchKey(
item.first.friendlyClassName(),
378 item.first.productInstanceName(),
379 item.first.processName()));
382 <<
"SwitchProducer " << switchLabel <<
" has a case " << caseLabel <<
" with a product " 383 <<
item.first <<
" that is not produced by the chosen case " 385 .getUntrackedParameter<std::string>(
"@chosen_case");
391 auto const& bd =
item.second;
392 if (not bd.branchAliases().empty()) {
394 <<
"SwitchProducer does not support ROOT branch aliases. Got the following ROOT branch " 395 "aliases for SwitchProducer with label " 396 << switchLabel <<
" for case " << caseLabel <<
":";
397 for (
auto const& branchAlias : bd.branchAliases()) {
398 ex <<
" " << branchAlias;
405 for (
size_t i = 0;
i < chosenBranches.size();
i++) {
406 if (not foundBranches[
i]) {
408 <<
"SwitchProducer " << switchLabel <<
" has a case " << caseLabel
409 <<
" that does not produce a product " << chosenBranches[
i] <<
" that is produced by the chosen case " 411 .getUntrackedParameter<std::string>(
"@chosen_case");
419 vstring
const& end_path_name_list,
420 vstring& modulesInConfig,
421 std::set<std::string>
const& usedModuleLabels,
422 std::map<
std::string, std::vector<std::pair<std::string, int>>>& outputModulePathPositions) {
434 vstring outputModuleLabels;
436 std::string const moduleEdmType(
"@module_edm_type");
442 std::set<std::string> modulesInConfigSet(modulesInConfig.begin(), modulesInConfig.end());
446 vstring scheduledPaths = proc_pset.getParameter<vstring>(
"@paths");
447 std::set<std::string> modulesOnPaths;
449 std::set<std::string> noEndPaths(scheduledPaths.begin(), scheduledPaths.end());
450 for (
auto const&
endPath : end_path_name_list) {
455 for (
auto const&
path : noEndPaths) {
456 labels = proc_pset.getParameter<vstring>(
path);
457 modulesOnPaths.insert(labels.begin(), labels.end());
463 std::vector<std::string> labelsToBeDropped;
464 labelsToBeDropped.reserve(modulesInConfigSet.size());
465 std::set_difference(modulesInConfigSet.begin(),
466 modulesInConfigSet.end(),
467 usedModuleLabels.begin(),
468 usedModuleLabels.end(),
469 std::back_inserter(labelsToBeDropped));
471 const unsigned int sizeBeforeOutputModules = labelsToBeDropped.size();
472 for (
auto const& modLabel : usedModuleLabels) {
476 edmType = proc_pset.getParameterSet(modLabel).getParameter<
std::string>(moduleEdmType);
477 if (edmType == outputModule) {
478 outputModuleLabels.push_back(modLabel);
479 labelsToBeDropped.push_back(modLabel);
481 if (edmType == edAnalyzer) {
482 if (modulesOnPaths.end() == modulesOnPaths.find(modLabel)) {
483 labelsToBeDropped.push_back(modLabel);
490 labelsToBeDropped.begin(), labelsToBeDropped.begin() + sizeBeforeOutputModules, labelsToBeDropped.end());
496 vstring::iterator endAfterRemove =
497 std::remove_if(modulesInConfig.begin(),
498 modulesInConfig.end(),
499 std::bind(binary_search_string, std::ref(labelsToBeDropped), _1));
500 modulesInConfig.erase(endAfterRemove, modulesInConfig.end());
501 proc_pset.addParameter<vstring>(
std::string(
"@all_modules"), modulesInConfig);
504 vstring endPathsToBeDropped;
506 for (vstring::const_iterator iEndPath = end_path_name_list.begin(), endEndPath = end_path_name_list.end();
507 iEndPath != endEndPath;
509 labels = proc_pset.getParameter<vstring>(*iEndPath);
510 vstring::iterator iSave = labels.begin();
511 vstring::iterator iBegin = labels.begin();
513 for (vstring::iterator iLabel = labels.begin(), iEnd = labels.end(); iLabel != iEnd; ++iLabel) {
514 if (binary_search_string(labelsToBeDropped, *iLabel)) {
515 if (binary_search_string(outputModuleLabels, *iLabel)) {
516 outputModulePathPositions[*iLabel].emplace_back(*iEndPath, iSave - iBegin);
519 if (iSave != iLabel) {
520 iSave->swap(*iLabel);
525 labels.erase(iSave, labels.end());
526 if (labels.empty()) {
528 proc_pset.eraseSimpleParameter(*iEndPath);
529 endPathsToBeDropped.push_back(*iEndPath);
531 proc_pset.addParameter<vstring>(*iEndPath,
labels);
537 endAfterRemove = std::remove_if(scheduledPaths.begin(),
538 scheduledPaths.end(),
539 std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
540 scheduledPaths.erase(endAfterRemove, scheduledPaths.end());
541 proc_pset.addParameter<vstring>(
std::string(
"@paths"), scheduledPaths);
544 vstring scheduledEndPaths = proc_pset.getParameter<vstring>(
"@end_paths");
545 endAfterRemove = std::remove_if(scheduledEndPaths.begin(),
546 scheduledEndPaths.end(),
547 std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
548 scheduledEndPaths.erase(endAfterRemove, scheduledEndPaths.end());
549 proc_pset.addParameter<vstring>(
std::string(
"@end_paths"), scheduledEndPaths);
552 class RngEDConsumer :
public EDConsumerBase {
554 explicit RngEDConsumer(std::set<TypeID>& typesConsumed) {
556 if (rng.isAvailable()) {
557 rng->consumes(consumesCollector());
558 for (
auto const& consumesInfo : this->consumesInfo()) {
559 typesConsumed.emplace(consumesInfo.type());
578 std::shared_ptr<ActivityRegistry> areg,
579 std::shared_ptr<ProcessConfiguration> processConfiguration,
580 bool hasSubprocesses,
585 ? std::shared_ptr<TriggerResultInserter>{}
586 : makeInserter(proc_pset, prealloc, preg, actions, areg, processConfiguration)},
599 processConfiguration,
607 processConfiguration,
610 assert(0 < prealloc.numberOfStreams());
612 for (
unsigned int i = 0;
i < prealloc.numberOfStreams(); ++
i) {
624 processConfiguration,
632 const std::string kTriggerResults(
"TriggerResults");
633 std::vector<std::string> modulesToUse;
636 if (worker->description().moduleLabel() != kTriggerResults) {
637 modulesToUse.push_back(worker->description().moduleLabel());
641 unsigned int const nUnscheduledModules =
streamSchedules_[0]->numberOfUnscheduledModules();
642 if (nUnscheduledModules > 0) {
643 std::vector<std::string>
temp;
644 temp.reserve(modulesToUse.size());
645 auto itBeginUnscheduled = modulesToUse.begin() + modulesToUse.size() - nUnscheduledModules;
646 std::copy(itBeginUnscheduled, modulesToUse.end(), std::back_inserter(temp));
647 std::copy(modulesToUse.begin(), itBeginUnscheduled, std::back_inserter(temp));
648 temp.swap(modulesToUse);
662 processConfiguration,
667 std::set<std::string> usedModuleLabels;
669 if (worker->description().moduleLabel() != kTriggerResults) {
670 usedModuleLabels.insert(worker->description().moduleLabel());
673 std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string>>(
"@all_modules"));
674 std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
675 reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels, outputModulePathPositions);
676 processEDAliases(proc_pset, processConfiguration->processName(), preg);
680 if (nUnscheduledModules > 0) {
681 std::set<std::string> unscheduledModules(modulesToUse.begin(), modulesToUse.begin() + nUnscheduledModules);
682 preg.setUnscheduledProducts(unscheduledModules);
685 processSwitchProducers(proc_pset, processConfiguration->processName(), preg);
686 proc_pset.registerIt();
687 processConfiguration->setParameterSetID(proc_pset.id());
688 processConfiguration->setProcessConfigurationID();
692 size_t all_workers_count =
allWorkers().size();
701 limitOutput(proc_pset, branchIDListHelper.branchIDLists(), subProcessParentageHelper);
707 branchIDListHelper.updateFromRegistry(preg);
710 worker->registerThinnedAssociations(preg, thinnedAssociationsHelper);
712 thinnedAssociationsHelper.sort();
717 c->selectProducts(preg, thinnedAssociationsHelper);
720 for (
auto& product : preg.productListUpdator()) {
726 std::set<TypeID> productTypesConsumed;
727 std::set<TypeID> elementTypesConsumed;
730 for (
auto const& consumesInfo : worker->consumesInfo()) {
732 productTypesConsumed.emplace(consumesInfo.type());
734 elementTypesConsumed.emplace(consumesInfo.type());
739 if (hasSubprocesses) {
743 { RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed); }
744 preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
747 for (
auto&
c : all_output_communicators_) {
748 c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
752 std::vector<const ModuleDescription*> modDesc;
754 modDesc.reserve(
workers.size());
758 std::back_inserter(modDesc),
762 summaryTimeKeeper_ = std::make_unique<SystemTimeKeeper>(prealloc.numberOfStreams(), modDesc, tns, processContext);
763 auto timeKeeperPtr = summaryTimeKeeper_.get();
793 int maxEventSpecs = 0;
794 int maxEventsOut = -1;
801 std::vector<std::string> psetNamesE;
808 if (maxEventSpecs > 1) {
810 <<
"\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
815 if (vMaxEventsOut !=
nullptr && !vMaxEventsOut->
empty()) {
816 std::string const& moduleLabel =
c->description().moduleLabel();
821 <<
"\nNo entry in 'maxEvents' for output module label '" << moduleLabel <<
"'.\n";
833 if (!
c->limitReached()) {
838 LogInfo(
"SuccessfulTermination") <<
"The job is terminating successfully because each output module\n" 839 <<
"has reached its configured limit.\n";
859 LogVerbatim(
"FwkSummary") <<
"TrigReport Process: " 863 <<
"---------- Event Summary ------------";
877 <<
"---------- Path Summary ------------";
878 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#" 879 <<
" " << std::right << std::setw(10) <<
"Executed" 880 <<
" " << std::right << std::setw(10) <<
"Passed" 881 <<
" " << std::right << std::setw(10) <<
"Failed" 882 <<
" " << std::right << std::setw(10) <<
"Error" 887 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
888 <<
p.bitPosition <<
" " << std::right << std::setw(10) <<
p.timesRun <<
" " 889 << std::right << std::setw(10) <<
p.timesPassed <<
" " << std::right << std::setw(10)
890 <<
p.timesFailed <<
" " << std::right << std::setw(10) <<
p.timesExcept <<
" " 913 <<
"-------End-Path Summary ------------";
914 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#" 915 <<
" " << std::right << std::setw(10) <<
"Executed" 916 <<
" " << std::right << std::setw(10) <<
"Passed" 917 <<
" " << std::right << std::setw(10) <<
"Failed" 918 <<
" " << std::right << std::setw(10) <<
"Error" 923 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
924 <<
p.bitPosition <<
" " << std::right << std::setw(10) <<
p.timesRun <<
" " 925 << std::right << std::setw(10) <<
p.timesPassed <<
" " << std::right << std::setw(10)
926 <<
p.timesFailed <<
" " << std::right << std::setw(10) <<
p.timesExcept <<
" " 933 <<
"---------- Modules in Path: " <<
p.name <<
" ------------";
934 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#" 935 <<
" " << std::right << std::setw(10) <<
"Visited" 936 <<
" " << std::right << std::setw(10) <<
"Passed" 937 <<
" " << std::right << std::setw(10) <<
"Failed" 938 <<
" " << std::right << std::setw(10) <<
"Error" 943 unsigned int bitpos = 0;
944 for (
auto const&
mod :
p.moduleInPathSummaries) {
945 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
946 << bitpos <<
" " << std::right << std::setw(10) <<
mod.timesVisited <<
" " 947 << std::right << std::setw(10) <<
mod.timesPassed <<
" " << std::right
948 << std::setw(10) <<
mod.timesFailed <<
" " << std::right << std::setw(10)
949 <<
mod.timesExcept <<
" " <<
mod.moduleLabel <<
"";
957 <<
"------ Modules in End-Path: " <<
p.name <<
" ------------";
958 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#" 959 <<
" " << std::right << std::setw(10) <<
"Visited" 960 <<
" " << std::right << std::setw(10) <<
"Passed" 961 <<
" " << std::right << std::setw(10) <<
"Failed" 962 <<
" " << std::right << std::setw(10) <<
"Error" 967 unsigned int bitpos = 0;
968 for (
auto const&
mod :
p.moduleInPathSummaries) {
969 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
970 << bitpos <<
" " << std::right << std::setw(10) <<
mod.timesVisited <<
" " 971 << std::right << std::setw(10) <<
mod.timesPassed <<
" " << std::right
972 << std::setw(10) <<
mod.timesFailed <<
" " << std::right << std::setw(10)
973 <<
mod.timesExcept <<
" " <<
mod.moduleLabel <<
"";
980 <<
"---------- Module Summary ------------";
981 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Visited" 982 <<
" " << std::right << std::setw(10) <<
"Executed" 983 <<
" " << std::right << std::setw(10) <<
"Passed" 984 <<
" " << std::right << std::setw(10) <<
"Failed" 985 <<
" " << std::right << std::setw(10) <<
"Error" 990 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) << worker.timesVisited <<
" " 991 << std::right << std::setw(10) << worker.timesRun <<
" " << std::right
992 << std::setw(10) << worker.timesPassed <<
" " << std::right << std::setw(10)
993 << worker.timesFailed <<
" " << std::right << std::setw(10) << worker.timesExcept
994 <<
" " << worker.moduleLabel <<
"";
1005 <<
"---------- Event Summary ---[sec]----";
1012 LogVerbatim(
"FwkSummary") <<
"TimeReport" << std::setprecision(6) <<
std::fixed <<
" efficiency CPU/Real/thread = " 1020 <<
"---------- Path Summary ---[Real sec]----";
1021 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1022 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1025 const int timesRun =
std::max(1,
p.timesRun);
1027 << std::setw(kColumn1Size) <<
p.realTime / totalEvents <<
" " << std::right
1028 << std::setw(kColumn2Size) <<
p.realTime / timesRun <<
" " <<
p.name <<
"";
1030 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1031 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1037 <<
"-------End-Path Summary ---[Real sec]----";
1038 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1039 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1043 const int timesRun =
std::max(1,
p.timesRun);
1046 << std::setw(kColumn1Size) <<
p.realTime / totalEvents <<
" " << std::right
1047 << std::setw(kColumn2Size) <<
p.realTime / timesRun <<
" " <<
p.name <<
"";
1049 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1050 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1057 <<
"---------- Modules in Path: " <<
p.name <<
" ---[Real sec]----";
1058 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1059 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit" 1062 for (
auto const&
mod :
p.moduleInPathSummaries) {
1064 << std::setw(kColumn1Size) <<
mod.realTime / totalEvents <<
" " << std::right
1065 << std::setw(kColumn2Size) <<
mod.realTime /
std::max(1,
mod.timesVisited) <<
" " 1066 <<
mod.moduleLabel <<
"";
1070 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1071 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit" 1078 <<
"------ Modules in End-Path: " <<
p.name <<
" ---[Real sec]----";
1079 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1080 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit" 1083 for (
auto const&
mod :
p.moduleInPathSummaries) {
1085 << std::setw(kColumn1Size) <<
mod.realTime / totalEvents <<
" " << std::right
1086 << std::setw(kColumn2Size) <<
mod.realTime /
std::max(1,
mod.timesVisited) <<
" " 1087 <<
mod.moduleLabel <<
"";
1091 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1092 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit" 1098 <<
"---------- Module Summary ---[Real sec]----";
1099 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1100 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1101 <<
" " << std::right << std::setw(kColumn3Size) <<
"per visit" 1106 << std::setw(kColumn1Size) << worker.realTime / totalEvents <<
" " << std::right
1107 << std::setw(kColumn2Size) << worker.realTime /
std::max(1, worker.timesRun) <<
" " 1108 << std::right << std::setw(kColumn3Size)
1109 << worker.realTime /
std::max(1, worker.timesVisited) <<
" " << worker.moduleLabel
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" 1125 using std::placeholders::_1;
1130 using std::placeholders::_1;
1140 c->writeRunAsync(task, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1149 c->writeLumiAsync(task, lbp, processContext, activityRegistry);
1154 using std::placeholders::_1;
1163 using std::placeholders::_1;
1168 using std::placeholders::_1;
1187 unsigned int iStreamID,
1201 if (worker->description().moduleLabel() == iLabel) {
1206 if (
nullptr == found) {
1215 s->replaceModule(newMod, iLabel);
1228 auto const& processName = newMod->moduleDescription().processName();
1229 auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1230 auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1231 auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1241 std::vector<ModuleDescription const*>
result;
1246 result.push_back(p);
1255 worker->convertCurrentProcessAlias(processName);
1272 std::vector<ModuleDescription const*>& descriptions,
1273 unsigned int hint)
const {
1274 streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1278 std::vector<ModuleDescription const*>& descriptions,
1279 unsigned int hint)
const {
1280 streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1284 std::vector<ModuleDescription const*>& allModuleDescriptions,
1285 std::vector<std::pair<unsigned int, unsigned int>>& moduleIDToIndex,
1286 std::vector<std::vector<ModuleDescription const*>>& modulesWhoseProductsAreConsumedBy,
1288 allModuleDescriptions.clear();
1289 moduleIDToIndex.clear();
1290 modulesWhoseProductsAreConsumedBy.clear();
1296 std::map<std::string, ModuleDescription const*> labelToDesc;
1300 allModuleDescriptions.push_back(p);
1301 moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->
id(),
i));
1309 std::vector<ModuleDescription const*>&
modules = modulesWhoseProductsAreConsumedBy.at(i);
1310 worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1318 s->enableEndPaths(active);
1329 s->getTriggerReport(rep);
1342 int returnValue = 0;
1344 returnValue += s->totalEvents();
1350 int returnValue = 0;
1352 returnValue += s->totalEventsPassed();
1358 int returnValue = 0;
1360 returnValue += s->totalEventsFailed();
std::vector< PathSummary > endPathSummaries
T getUntrackedParameter(std::string const &, T const &) const
std::vector< PathTimingSummary > endPathSummaries
void stopEvent(StreamContext const &)
void startProcessingLoop()
std::vector< BranchIDList > BranchIDLists
virtual void openFile(FileBlock const &fb)=0
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
roAction_t actions[nactions]
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
bool endPathsEnabled() const
void respondToCloseInputFile(FileBlock const &fb)
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::shared_ptr< ModuleRegistry const > moduleRegistry() const
std::vector< Worker * > AllWorkers
std::vector< ParameterSet > VParameterSet
std::vector< std::string > const * pathNames_
void convertCurrentProcessAlias(std::string const &processName)
Convert "@currentProcess" in InputTag process names to the actual current process name...
virtual bool shouldWeCloseFile() const =0
void endStream(unsigned int)
void enableEndPaths(bool active)
unsigned int numberOfThreads() const
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
virtual void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &)=0
void moduleDescriptionsInEndPath(std::string const &iEndPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
std::vector< WorkerSummary > workerSummaries
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
std::string const & moduleLabel() const
void stopProcessingLoop()
void startEvent(StreamID)
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription's constructor's modI...
int totalEventsFailed() const
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
void eraseOrSetUntrackedParameterSet(std::string const &name)
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
void processOneEventAsync(WaitingTaskHolder iTask, unsigned int iStreamID, EventPrincipal &principal, EventSetupImpl const &eventSetup, ServiceToken const &token)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
int totalEventsPassed() const
void triggerPaths(std::vector< std::string > &oLabelsToFill) const
std::vector< PathSummary > trigPathSummaries
EventSummary eventSummary
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
virtual void resolvePutIndicies(BranchType iBranchType, std::unordered_multimap< std::string, std::tuple< TypeID const *, const char *, edm::ProductResolverIndex >> const &iIndicies)=0
EventTimingSummary eventSummary
void clearCounters()
Clear all the counters in the trigger report.
void beginJob(ProductRegistry const &, eventsetup::ESRecordsToProxyIndices const &)
Schedule(ParameterSet &proc_pset, service::TriggerNamesService const &tns, ProductRegistry &pregistry, BranchIDListHelper &branchIDListHelper, ThinnedAssociationsHelper &thinnedAssociationsHelper, SubProcessParentageHelper const *subProcessParentageHelper, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration > processConfiguration, bool hasSubprocesses, PreallocationConfiguration const &config, ProcessContext const *processContext)
std::vector< PathTimingSummary > trigPathSummaries
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists, SubProcessParentageHelper const *subProcessParentageHelper)
bool terminate() const
Return whether each output module has reached its maximum count.
void respondToOpenInputFile(FileBlock const &fb)
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
void writeRunAsync(WaitingTaskHolder iTask, RunPrincipal const &rp, ProcessContext const *, ActivityRegistry *, MergeableRunProductMetadata const *)
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
def elem(elemtype, innerHTML='', html_class='', kwargs)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
void getTriggerReport(TriggerReport &rep) const
PreallocationConfiguration preallocConfig_
void fillModuleAndConsumesInfo(std::vector< ModuleDescription const * > &allModuleDescriptions, std::vector< std::pair< unsigned int, unsigned int >> &moduleIDToIndex, std::vector< std::vector< ModuleDescription const * >> &modulesWhoseProductsAreConsumedBy, ProductRegistry const &preg) const
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
volatile bool endpathsAreActive_
void respondToOpenInputFile(FileBlock const &fb)
std::shared_ptr< TriggerResultInserter const > resultsInserter() const
void startPath(StreamContext const &, PathContext const &)
bool search_all(ForwardSequence const &s, Datum const &d)
std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter > > > endPathStatusInserters_
virtual std::unique_ptr< OutputModuleCommunicator > createOutputModuleCommunicator()=0
AllOutputModuleCommunicators all_output_communicators_
void modulesInPath(std::string const &iPathLabel, std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill in execution order the labels of all modules in path iPathLabel ...
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::shared_ptr< ProductResolverIndexHelper const > productLookup(BranchType branchType) const
void beginStream(unsigned int)
void respondToCloseInputFile(FileBlock const &fb)
std::vector< std::string > const * endPathNames_
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Strings const & getTrigPaths() const
virtual void closeFile()=0
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
void openOutputFiles(FileBlock &fb)
void writeLumiAsync(WaitingTaskHolder iTask, LuminosityBlockPrincipal const &lbp, ProcessContext const *, ActivityRegistry *)
std::vector< WorkerTimingSummary > workerSummaries
T mod(const T &a, const T &b)
void endJob(ExceptionCollector &collector)
void getTriggerTimingReport(TriggerTimingReport &rep) const
bool shouldWeCloseOutput() const
bool changeModule(std::string const &iLabel, ParameterSet const &iPSet, const ProductRegistry &iRegistry, eventsetup::ESRecordsToProxyIndices const &)
std::vector< std::string > vstring
void setIsMergeable(BranchDescription &)
void endPaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all end paths in the process
void moduleDescriptionsInPath(std::string const &iPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)