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 &&
253 it->first.moduleLabel() == moduleLabel;
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& item : preg.productList()) {
326 if (item.second.branchType() ==
prod.second.branchType() and
327 item.second.unwrappedTypeID().typeInfo() ==
prod.second.unwrappedTypeID().typeInfo() and
328 item.first.moduleLabel() ==
prod.second.switchAliasModuleLabel() and
329 item.first.productInstanceName() ==
prod.second.productInstanceName()) {
332 <<
"Encountered a BranchDescription that is aliased-for by SwitchProducer, and whose processName " 333 << item.first.processName() <<
" differs from current process " << processName
334 <<
". Module label is " << item.first.moduleLabel() <<
".\nPlease contact a framework developer.";
336 prod.second.setSwitchAliasForBranch(item.second);
337 it->second.chosenBranches.push_back(
prod.first);
342 if (switchMap.empty())
345 for (
auto&
elem : switchMap) {
351 std::vector<bool> foundBranches;
352 for (
auto const& switchItem : switchMap) {
353 auto const& switchLabel = switchItem.first;
354 auto const& chosenBranches = switchItem.second.chosenBranches;
355 auto const& caseLabels = switchItem.second.caseLabels;
356 foundBranches.resize(chosenBranches.size());
357 for (
auto const& caseLabel : caseLabels) {
358 std::fill(foundBranches.begin(), foundBranches.end(),
false);
359 for (
auto& nonConstItem : preg.productListUpdator()) {
360 auto const& item = nonConstItem;
361 if (item.first.moduleLabel() == caseLabel) {
370 nonConstItem.second.setTransient(
true);
372 auto range = std::equal_range(chosenBranches.begin(),
373 chosenBranches.end(),
374 BranchKey(item.first.friendlyClassName(),
376 item.first.productInstanceName(),
377 item.first.processName()));
378 if (range.first == range.second) {
380 <<
"SwitchProducer " << switchLabel <<
" has a case " << caseLabel <<
" with a product " 381 << item.first <<
" that is not produced by the chosen case " 383 .getUntrackedParameter<std::string>(
"@chosen_case");
386 foundBranches[
std::distance(chosenBranches.begin(), range.first)] =
true;
389 auto const& bd = item.second;
390 if (not bd.branchAliases().empty()) {
392 <<
"SwitchProducer does not support ROOT branch aliases. Got the following ROOT branch " 393 "aliases for SwitchProducer with label " 394 << switchLabel <<
" for case " << caseLabel <<
":";
395 for (
auto const& item : bd.branchAliases()) {
403 for (
size_t i = 0;
i < chosenBranches.size();
i++) {
404 if (not foundBranches[
i]) {
406 <<
"SwitchProducer " << switchLabel <<
" has a case " << caseLabel
407 <<
" that does not produce a product " << chosenBranches[
i] <<
" that is produced by the chosen case " 409 .getUntrackedParameter<std::string>(
"@chosen_case");
417 vstring
const& end_path_name_list,
418 vstring& modulesInConfig,
419 std::set<std::string>
const& usedModuleLabels,
420 std::map<
std::string, std::vector<std::pair<std::string, int>>>& outputModulePathPositions) {
432 vstring outputModuleLabels;
434 std::string const moduleEdmType(
"@module_edm_type");
440 std::set<std::string> modulesInConfigSet(modulesInConfig.begin(), modulesInConfig.end());
444 vstring scheduledPaths = proc_pset.getParameter<vstring>(
"@paths");
445 std::set<std::string> modulesOnPaths;
447 std::set<std::string> noEndPaths(scheduledPaths.begin(), scheduledPaths.end());
448 for (
auto const& endPath : end_path_name_list) {
449 noEndPaths.erase(endPath);
453 for (
auto const&
path : noEndPaths) {
454 labels = proc_pset.getParameter<vstring>(
path);
455 modulesOnPaths.insert(labels.begin(), labels.end());
461 std::vector<std::string> labelsToBeDropped;
462 labelsToBeDropped.reserve(modulesInConfigSet.size());
463 std::set_difference(modulesInConfigSet.begin(),
464 modulesInConfigSet.end(),
465 usedModuleLabels.begin(),
466 usedModuleLabels.end(),
467 std::back_inserter(labelsToBeDropped));
469 const unsigned int sizeBeforeOutputModules = labelsToBeDropped.size();
470 for (
auto const& modLabel : usedModuleLabels) {
474 edmType = proc_pset.getParameterSet(modLabel).getParameter<
std::string>(moduleEdmType);
475 if (edmType == outputModule) {
476 outputModuleLabels.push_back(modLabel);
477 labelsToBeDropped.push_back(modLabel);
479 if (edmType == edAnalyzer) {
480 if (modulesOnPaths.end() == modulesOnPaths.find(modLabel)) {
481 labelsToBeDropped.push_back(modLabel);
488 labelsToBeDropped.begin(), labelsToBeDropped.begin() + sizeBeforeOutputModules, labelsToBeDropped.end());
494 vstring::iterator endAfterRemove =
495 std::remove_if(modulesInConfig.begin(),
496 modulesInConfig.end(),
497 std::bind(binary_search_string, std::ref(labelsToBeDropped), _1));
498 modulesInConfig.erase(endAfterRemove, modulesInConfig.end());
499 proc_pset.addParameter<vstring>(
std::string(
"@all_modules"), modulesInConfig);
502 vstring endPathsToBeDropped;
504 for (vstring::const_iterator iEndPath = end_path_name_list.begin(), endEndPath = end_path_name_list.end();
505 iEndPath != endEndPath;
507 labels = proc_pset.getParameter<vstring>(*iEndPath);
508 vstring::iterator iSave = labels.begin();
509 vstring::iterator iBegin = labels.begin();
511 for (vstring::iterator iLabel = labels.begin(), iEnd = labels.end(); iLabel != iEnd; ++iLabel) {
512 if (binary_search_string(labelsToBeDropped, *iLabel)) {
513 if (binary_search_string(outputModuleLabels, *iLabel)) {
514 outputModulePathPositions[*iLabel].emplace_back(*iEndPath, iSave - iBegin);
517 if (iSave != iLabel) {
518 iSave->swap(*iLabel);
523 labels.erase(iSave, labels.end());
524 if (labels.empty()) {
526 proc_pset.eraseSimpleParameter(*iEndPath);
527 endPathsToBeDropped.push_back(*iEndPath);
529 proc_pset.addParameter<vstring>(*iEndPath,
labels);
535 endAfterRemove = std::remove_if(scheduledPaths.begin(),
536 scheduledPaths.end(),
537 std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
538 scheduledPaths.erase(endAfterRemove, scheduledPaths.end());
539 proc_pset.addParameter<vstring>(
std::string(
"@paths"), scheduledPaths);
542 vstring scheduledEndPaths = proc_pset.getParameter<vstring>(
"@end_paths");
543 endAfterRemove = std::remove_if(scheduledEndPaths.begin(),
544 scheduledEndPaths.end(),
545 std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
546 scheduledEndPaths.erase(endAfterRemove, scheduledEndPaths.end());
547 proc_pset.addParameter<vstring>(
std::string(
"@end_paths"), scheduledEndPaths);
550 class RngEDConsumer :
public EDConsumerBase {
552 explicit RngEDConsumer(std::set<TypeID>& typesConsumed) {
554 if (rng.isAvailable()) {
555 rng->consumes(consumesCollector());
556 for (
auto const& consumesInfo : this->consumesInfo()) {
557 typesConsumed.emplace(consumesInfo.type());
576 std::shared_ptr<ActivityRegistry> areg,
577 std::shared_ptr<ProcessConfiguration> processConfiguration,
578 bool hasSubprocesses,
583 ? std::shared_ptr<TriggerResultInserter>{}
584 : makeInserter(proc_pset, prealloc, preg, actions, areg, processConfiguration)},
597 processConfiguration,
605 processConfiguration,
608 assert(0 < prealloc.numberOfStreams());
610 for (
unsigned int i = 0;
i < prealloc.numberOfStreams(); ++
i) {
622 processConfiguration,
630 const std::string kTriggerResults(
"TriggerResults");
631 std::vector<std::string> modulesToUse;
634 if (worker->description().moduleLabel() != kTriggerResults) {
635 modulesToUse.push_back(worker->description().moduleLabel());
639 unsigned int const nUnscheduledModules =
streamSchedules_[0]->numberOfUnscheduledModules();
640 if (nUnscheduledModules > 0) {
641 std::vector<std::string>
temp;
642 temp.reserve(modulesToUse.size());
643 auto itBeginUnscheduled = modulesToUse.begin() + modulesToUse.size() - nUnscheduledModules;
644 std::copy(itBeginUnscheduled, modulesToUse.end(), std::back_inserter(temp));
645 std::copy(modulesToUse.begin(), itBeginUnscheduled, std::back_inserter(temp));
646 temp.swap(modulesToUse);
660 processConfiguration,
665 std::set<std::string> usedModuleLabels;
667 if (worker->description().moduleLabel() != kTriggerResults) {
668 usedModuleLabels.insert(worker->description().moduleLabel());
671 std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string>>(
"@all_modules"));
672 std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
673 reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels, outputModulePathPositions);
674 processEDAliases(proc_pset, processConfiguration->processName(), preg);
678 if (nUnscheduledModules > 0) {
679 std::set<std::string> unscheduledModules(modulesToUse.begin(), modulesToUse.begin() + nUnscheduledModules);
680 preg.setUnscheduledProducts(unscheduledModules);
683 processSwitchProducers(proc_pset, processConfiguration->processName(), preg);
684 proc_pset.registerIt();
685 processConfiguration->setParameterSetID(proc_pset.id());
686 processConfiguration->setProcessConfigurationID();
690 size_t all_workers_count =
allWorkers().size();
699 limitOutput(proc_pset, branchIDListHelper.branchIDLists(), subProcessParentageHelper);
705 branchIDListHelper.updateFromRegistry(preg);
708 worker->registerThinnedAssociations(preg, thinnedAssociationsHelper);
710 thinnedAssociationsHelper.sort();
715 c->selectProducts(preg, thinnedAssociationsHelper);
718 for (
auto& product : preg.productListUpdator()) {
724 std::set<TypeID> productTypesConsumed;
725 std::set<TypeID> elementTypesConsumed;
728 for (
auto const& consumesInfo : worker->consumesInfo()) {
730 productTypesConsumed.emplace(consumesInfo.type());
732 elementTypesConsumed.emplace(consumesInfo.type());
737 if (hasSubprocesses) {
741 { RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed); }
742 preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
745 for (
auto&
c : all_output_communicators_) {
746 c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
750 std::vector<const ModuleDescription*> modDesc;
752 modDesc.reserve(
workers.size());
756 std::back_inserter(modDesc),
760 summaryTimeKeeper_ = std::make_unique<SystemTimeKeeper>(prealloc.numberOfStreams(), modDesc, tns, processContext);
761 auto timeKeeperPtr = summaryTimeKeeper_.get();
791 int maxEventSpecs = 0;
792 int maxEventsOut = -1;
799 std::vector<std::string> psetNamesE;
806 if (maxEventSpecs > 1) {
808 <<
"\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
813 if (vMaxEventsOut !=
nullptr && !vMaxEventsOut->
empty()) {
814 std::string const& moduleLabel =
c->description().moduleLabel();
819 <<
"\nNo entry in 'maxEvents' for output module label '" << moduleLabel <<
"'.\n";
831 if (!
c->limitReached()) {
836 LogInfo(
"SuccessfulTermination") <<
"The job is terminating successfully because each output module\n" 837 <<
"has reached its configured limit.\n";
857 LogVerbatim(
"FwkSummary") <<
"TrigReport Process: " 861 <<
"---------- Event Summary ------------";
875 <<
"---------- Path Summary ------------";
876 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#" 877 <<
" " << std::right << std::setw(10) <<
"Executed" 878 <<
" " << std::right << std::setw(10) <<
"Passed" 879 <<
" " << std::right << std::setw(10) <<
"Failed" 880 <<
" " << std::right << std::setw(10) <<
"Error" 885 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
886 <<
p.bitPosition <<
" " << std::right << std::setw(10) <<
p.timesRun <<
" " 887 << std::right << std::setw(10) <<
p.timesPassed <<
" " << std::right << std::setw(10)
888 <<
p.timesFailed <<
" " << std::right << std::setw(10) <<
p.timesExcept <<
" " 911 <<
"-------End-Path Summary ------------";
912 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#" 913 <<
" " << std::right << std::setw(10) <<
"Executed" 914 <<
" " << std::right << std::setw(10) <<
"Passed" 915 <<
" " << std::right << std::setw(10) <<
"Failed" 916 <<
" " << std::right << std::setw(10) <<
"Error" 921 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
922 <<
p.bitPosition <<
" " << std::right << std::setw(10) <<
p.timesRun <<
" " 923 << std::right << std::setw(10) <<
p.timesPassed <<
" " << std::right << std::setw(10)
924 <<
p.timesFailed <<
" " << std::right << std::setw(10) <<
p.timesExcept <<
" " 931 <<
"---------- Modules in Path: " <<
p.name <<
" ------------";
932 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#" 933 <<
" " << std::right << std::setw(10) <<
"Visited" 934 <<
" " << std::right << std::setw(10) <<
"Passed" 935 <<
" " << std::right << std::setw(10) <<
"Failed" 936 <<
" " << std::right << std::setw(10) <<
"Error" 941 unsigned int bitpos = 0;
942 for (
auto const&
mod :
p.moduleInPathSummaries) {
943 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
944 << bitpos <<
" " << std::right << std::setw(10) <<
mod.timesVisited <<
" " 945 << std::right << std::setw(10) <<
mod.timesPassed <<
" " << std::right
946 << std::setw(10) <<
mod.timesFailed <<
" " << std::right << std::setw(10)
947 <<
mod.timesExcept <<
" " <<
mod.moduleLabel <<
"";
955 <<
"------ Modules in End-Path: " <<
p.name <<
" ------------";
956 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Trig Bit#" 957 <<
" " << std::right << std::setw(10) <<
"Visited" 958 <<
" " << std::right << std::setw(10) <<
"Passed" 959 <<
" " << std::right << std::setw(10) <<
"Failed" 960 <<
" " << std::right << std::setw(10) <<
"Error" 965 unsigned int bitpos = 0;
966 for (
auto const&
mod :
p.moduleInPathSummaries) {
967 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
968 << bitpos <<
" " << std::right << std::setw(10) <<
mod.timesVisited <<
" " 969 << std::right << std::setw(10) <<
mod.timesPassed <<
" " << std::right
970 << std::setw(10) <<
mod.timesFailed <<
" " << std::right << std::setw(10)
971 <<
mod.timesExcept <<
" " <<
mod.moduleLabel <<
"";
978 <<
"---------- Module Summary ------------";
979 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) <<
"Visited" 980 <<
" " << std::right << std::setw(10) <<
"Executed" 981 <<
" " << std::right << std::setw(10) <<
"Passed" 982 <<
" " << std::right << std::setw(10) <<
"Failed" 983 <<
" " << std::right << std::setw(10) <<
"Error" 988 LogVerbatim(
"FwkSummary") <<
"TrigReport " << std::right << std::setw(10) << worker.timesVisited <<
" " 989 << std::right << std::setw(10) << worker.timesRun <<
" " << std::right
990 << std::setw(10) << worker.timesPassed <<
" " << std::right << std::setw(10)
991 << worker.timesFailed <<
" " << std::right << std::setw(10) << worker.timesExcept
992 <<
" " << worker.moduleLabel <<
"";
1003 <<
"---------- Event Summary ---[sec]----";
1010 LogVerbatim(
"FwkSummary") <<
"TimeReport" << std::setprecision(6) <<
std::fixed <<
" efficiency CPU/Real/thread = " 1018 <<
"---------- Path Summary ---[Real sec]----";
1019 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1020 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1023 const int timesRun =
std::max(1,
p.timesRun);
1025 << std::setw(kColumn1Size) <<
p.realTime / totalEvents <<
" " << std::right
1026 << std::setw(kColumn2Size) <<
p.realTime / timesRun <<
" " <<
p.name <<
"";
1028 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1029 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1035 <<
"-------End-Path Summary ---[Real sec]----";
1036 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1037 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1041 const int timesRun =
std::max(1,
p.timesRun);
1044 << std::setw(kColumn1Size) <<
p.realTime / totalEvents <<
" " << std::right
1045 << std::setw(kColumn2Size) <<
p.realTime / timesRun <<
" " <<
p.name <<
"";
1047 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1048 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1055 <<
"---------- Modules in Path: " <<
p.name <<
" ---[Real sec]----";
1056 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1057 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit" 1060 for (
auto const&
mod :
p.moduleInPathSummaries) {
1062 << std::setw(kColumn1Size) <<
mod.realTime / totalEvents <<
" " << std::right
1063 << std::setw(kColumn2Size) <<
mod.realTime /
std::max(1,
mod.timesVisited) <<
" " 1064 <<
mod.moduleLabel <<
"";
1068 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1069 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit" 1076 <<
"------ Modules in End-Path: " <<
p.name <<
" ---[Real sec]----";
1077 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1078 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit" 1081 for (
auto const&
mod :
p.moduleInPathSummaries) {
1083 << std::setw(kColumn1Size) <<
mod.realTime / totalEvents <<
" " << std::right
1084 << std::setw(kColumn2Size) <<
mod.realTime /
std::max(1,
mod.timesVisited) <<
" " 1085 <<
mod.moduleLabel <<
"";
1089 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1090 <<
" " << std::right << std::setw(kColumn2Size) <<
"per visit" 1096 <<
"---------- Module Summary ---[Real sec]----";
1097 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1098 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1099 <<
" " << std::right << std::setw(kColumn3Size) <<
"per visit" 1104 << std::setw(kColumn1Size) << worker.realTime / totalEvents <<
" " << std::right
1105 << std::setw(kColumn2Size) << worker.realTime /
std::max(1, worker.timesRun) <<
" " 1106 << std::right << std::setw(kColumn3Size)
1107 << worker.realTime /
std::max(1, worker.timesVisited) <<
" " << worker.moduleLabel
1110 LogVerbatim(
"FwkSummary") <<
"TimeReport " << std::right << std::setw(kColumn1Size) <<
"per event" 1111 <<
" " << std::right << std::setw(kColumn2Size) <<
"per exec" 1112 <<
" " << std::right << std::setw(kColumn3Size) <<
"per visit" 1123 using std::placeholders::_1;
1128 using std::placeholders::_1;
1138 c->writeRunAsync(task, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1147 c->writeLumiAsync(task, lbp, processContext, activityRegistry);
1152 using std::placeholders::_1;
1161 using std::placeholders::_1;
1166 using std::placeholders::_1;
1185 unsigned int iStreamID,
1199 if (worker->description().moduleLabel() == iLabel) {
1204 if (
nullptr == found) {
1213 s->replaceModule(newMod, iLabel);
1226 auto const& processName = newMod->moduleDescription().processName();
1227 auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1228 auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1229 auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1239 std::vector<ModuleDescription const*>
result;
1244 result.push_back(p);
1253 worker->convertCurrentProcessAlias(processName);
1270 std::vector<ModuleDescription const*>& descriptions,
1271 unsigned int hint)
const {
1272 streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1276 std::vector<ModuleDescription const*>& descriptions,
1277 unsigned int hint)
const {
1278 streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1282 std::vector<ModuleDescription const*>& allModuleDescriptions,
1283 std::vector<std::pair<unsigned int, unsigned int>>& moduleIDToIndex,
1284 std::vector<std::vector<ModuleDescription const*>>& modulesWhoseProductsAreConsumedBy,
1286 allModuleDescriptions.clear();
1287 moduleIDToIndex.clear();
1288 modulesWhoseProductsAreConsumedBy.clear();
1294 std::map<std::string, ModuleDescription const*> labelToDesc;
1298 allModuleDescriptions.push_back(p);
1299 moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->
id(),
i));
1307 std::vector<ModuleDescription const*>&
modules = modulesWhoseProductsAreConsumedBy.at(i);
1308 worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1316 s->enableEndPaths(active);
1327 s->getTriggerReport(rep);
1340 int returnValue = 0;
1342 returnValue += s->totalEvents();
1348 int returnValue = 0;
1350 returnValue += s->totalEventsPassed();
1356 int returnValue = 0;
1358 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)