25 #include "boost/bind.hpp"
26 #include "boost/ref.hpp"
39 bool binary_search_string(std::vector<std::string>
const&
v,
std::string const&
s) {
40 return std::binary_search(v.begin(), v.end(),
s);
46 std::shared_ptr<TriggerResultInserter>
48 PreallocationConfiguration
const& iPrealloc,
49 ProductRegistry&
preg,
50 ExceptionToActionTable
const&
actions,
51 boost::shared_ptr<ActivityRegistry>
areg,
54 ParameterSet* trig_pset = proc_pset.getPSetForUpdate(
"@trigger_paths");
55 trig_pset->registerIt();
57 WorkerParams work_args(trig_pset, preg, &iPrealloc, processConfiguration, actions);
58 ModuleDescription md(trig_pset->id(),
59 "TriggerResultInserter",
61 processConfiguration.get(),
64 areg->preModuleConstructionSignal_(md);
65 bool postCalled =
false;
66 std::shared_ptr<TriggerResultInserter> returnValue;
68 maker::ModuleHolderT<TriggerResultInserter> holder(
new TriggerResultInserter(*trig_pset, iPrealloc.numberOfStreams()),static_cast<Maker const*>(
nullptr));
69 holder.setModuleDescription(md);
70 holder.registerProductsAndCallbacks(&preg);
71 returnValue.reset(holder.release());
74 areg->postModuleConstructionSignal_(md);
79 areg->postModuleConstructionSignal_(md);
92 checkAndInsertAlias(
std::string const& friendlyClassName,
98 ProductRegistry
const& preg,
99 std::multimap<BranchKey, BranchKey>& aliasMap,
100 std::map<BranchKey, BranchKey>& aliasKeys) {
103 BranchKey
key(friendlyClassName, moduleLabel, productInstanceName, processName);
104 if(preg.productList().find(
key) == preg.productList().end()) {
107 for(
auto const& product : preg.productList()) {
108 if(moduleLabel == product.first.moduleLabel() && processName == product.first.processName()) {
110 <<
"There are no products of type '" << friendlyClassName <<
"'\n"
111 <<
"with module label '" << moduleLabel <<
"' and instance name '" << productInstanceName <<
"'.\n";
116 std::string const& theInstanceAlias(instanceAlias == star ? productInstanceName : instanceAlias);
117 BranchKey aliasKey(friendlyClassName, alias, theInstanceAlias, processName);
118 if(preg.productList().find(aliasKey) != preg.productList().end()) {
120 <<
"A product of type '" << friendlyClassName <<
"'\n"
121 <<
"with module label '" << alias <<
"' and instance name '" << theInstanceAlias <<
"'\n"
122 <<
"already exists.\n";
124 auto iter = aliasKeys.find(aliasKey);
125 if(iter != aliasKeys.end()) {
127 if(iter->second !=
key) {
129 <<
"The module label alias '" << alias <<
"' and product instance alias '" << theInstanceAlias <<
"'\n"
130 <<
"are used for multiple products of type '" << friendlyClassName <<
"'\n"
131 <<
"One has module label '" << moduleLabel <<
"' and product instance name '" << productInstanceName <<
"',\n"
132 <<
"the other has module label '" << iter->second.moduleLabel() <<
"' and product instance name '" << iter->second.productInstanceName() <<
"'.\n";
135 auto prodIter = preg.productList().find(
key);
136 if(prodIter != preg.productList().end()) {
137 if (!prodIter->second.produced()) {
139 <<
"The module label alias '" << alias <<
"' and product instance alias '" << theInstanceAlias <<
"'\n"
140 <<
"are used for a product of type '" << friendlyClassName <<
"'\n"
141 <<
"with module label '" << moduleLabel <<
"' and product instance name '" << productInstanceName <<
"',\n"
142 <<
"An EDAlias can only be used for products produced in the current process. This one is not.\n";
144 aliasMap.insert(std::make_pair(
key, aliasKey));
145 aliasKeys.insert(std::make_pair(aliasKey,
key));
152 std::vector<std::string>
aliases = proc_pset.getParameter<std::vector<std::string> >(
"@all_aliases");
153 if(aliases.empty()) {
160 desc.add<
std::string>(
"fromProductInstance", star);
163 std::multimap<BranchKey, BranchKey> aliasMap;
165 std::map<BranchKey, BranchKey> aliasKeys;
169 ParameterSet const& aliasPSet = proc_pset.getParameterSet(alias);
170 std::vector<std::string> vPSetNames = aliasPSet.getParameterNamesForType<
VParameterSet>();
178 if(productInstanceName == star) {
180 BranchKey lowerBound(friendlyClassName, moduleLabel,
empty,
empty);
181 for(ProductRegistry::ProductList::const_iterator it = preg.productList().lower_bound(lowerBound);
182 it != preg.productList().end() && it->first.friendlyClassName() == friendlyClassName && it->first.moduleLabel() == moduleLabel;
184 if(it->first.processName() != processName) {
189 checkAndInsertAlias(friendlyClassName, moduleLabel, it->first.productInstanceName(), processName, alias, instanceAlias,
preg, aliasMap, aliasKeys);
194 for(
auto const& product : preg.productList()) {
195 if(moduleLabel == product.first.moduleLabel() && processName == product.first.processName()) {
197 <<
"There are no products of type '" << friendlyClassName <<
"'\n"
198 <<
"with module label '" << moduleLabel <<
"'.\n";
203 checkAndInsertAlias(friendlyClassName, moduleLabel, productInstanceName, processName, alias, instanceAlias, preg, aliasMap, aliasKeys);
211 for(
auto const& aliasEntry : aliasMap) {
212 ProductRegistry::ProductList::const_iterator it = preg.productList().find(aliasEntry.first);
213 assert(it != preg.productList().end());
214 preg.addLabelAlias(it->second, aliasEntry.second.moduleLabel(), aliasEntry.second.productInstanceName());
219 typedef std::vector<std::string>
vstring;
222 vstring
const& end_path_name_list,
223 vstring& modulesInConfig,
224 std::set<std::string>
const& usedModuleLabels,
225 std::map<
std::string, std::vector<std::pair<std::string, int> > >& outputModulePathPositions) {
237 vstring outputModuleLabels;
239 std::string const moduleEdmType(
"@module_edm_type");
245 std::set<std::string> modulesInConfigSet(modulesInConfig.begin(), modulesInConfig.end());
249 vstring scheduledPaths = proc_pset.getParameter<vstring>(
"@paths");
250 std::set<std::string> modulesOnPaths;
252 std::set<std::string> noEndPaths(scheduledPaths.begin(),scheduledPaths.end());
253 for(
auto const&
endPath: end_path_name_list) {
258 for(
auto const&
path: noEndPaths) {
259 labels = proc_pset.getParameter<vstring>(
path);
260 modulesOnPaths.insert(labels.begin(),labels.end());
266 std::vector<std::string> labelsToBeDropped;
267 labelsToBeDropped.reserve(modulesInConfigSet.size());
268 std::set_difference(modulesInConfigSet.begin(),modulesInConfigSet.end(),
269 usedModuleLabels.begin(),usedModuleLabels.end(),
270 std::back_inserter(labelsToBeDropped));
272 const unsigned int sizeBeforeOutputModules = labelsToBeDropped.size();
273 for (
auto const& modLabel: usedModuleLabels) {
274 edmType = proc_pset.getParameterSet(modLabel).getParameter<
std::string>(moduleEdmType);
275 if (edmType == outputModule) {
276 outputModuleLabels.push_back(modLabel);
277 labelsToBeDropped.push_back(modLabel);
279 if(edmType == edAnalyzer) {
280 if(modulesOnPaths.end()==modulesOnPaths.find(modLabel)) {
281 labelsToBeDropped.push_back(modLabel);
286 std::inplace_merge(labelsToBeDropped.begin(),
287 labelsToBeDropped.begin()+sizeBeforeOutputModules,
288 labelsToBeDropped.end());
294 vstring::iterator endAfterRemove = std::remove_if(modulesInConfig.begin(), modulesInConfig.end(), boost::bind(binary_search_string, boost::ref(labelsToBeDropped), _1));
295 modulesInConfig.erase(endAfterRemove, modulesInConfig.end());
296 proc_pset.addParameter<vstring>(
std::string(
"@all_modules"), modulesInConfig);
299 vstring endPathsToBeDropped;
301 for (vstring::const_iterator iEndPath = end_path_name_list.begin(), endEndPath = end_path_name_list.end();
302 iEndPath != endEndPath;
304 labels = proc_pset.getParameter<vstring>(*iEndPath);
305 vstring::iterator iSave = labels.begin();
306 vstring::iterator iBegin = labels.begin();
308 for (vstring::iterator iLabel = labels.begin(), iEnd = labels.end();
309 iLabel != iEnd; ++iLabel) {
310 if (binary_search_string(labelsToBeDropped, *iLabel)) {
311 if (binary_search_string(outputModuleLabels, *iLabel)) {
312 outputModulePathPositions[*iLabel].emplace_back(*iEndPath, iSave - iBegin);
315 if (iSave != iLabel) {
316 iSave->swap(*iLabel);
321 labels.erase(iSave, labels.end());
322 if (labels.empty()) {
324 proc_pset.eraseSimpleParameter(*iEndPath);
325 endPathsToBeDropped.push_back(*iEndPath);
327 proc_pset.addParameter<vstring>(*iEndPath,
labels);
333 endAfterRemove = std::remove_if(scheduledPaths.begin(), scheduledPaths.end(), boost::bind(binary_search_string, boost::ref(endPathsToBeDropped), _1));
334 scheduledPaths.erase(endAfterRemove, scheduledPaths.end());
335 proc_pset.addParameter<vstring>(
std::string(
"@paths"), scheduledPaths);
338 vstring scheduledEndPaths = proc_pset.getParameter<vstring>(
"@end_paths");
339 endAfterRemove = std::remove_if(scheduledEndPaths.begin(), scheduledEndPaths.end(), boost::bind(binary_search_string, boost::ref(endPathsToBeDropped), _1));
340 scheduledEndPaths.erase(endAfterRemove, scheduledEndPaths.end());
341 proc_pset.addParameter<vstring>(
std::string(
"@end_paths"), scheduledEndPaths);
356 boost::shared_ptr<ActivityRegistry> areg,
357 boost::shared_ptr<ProcessConfiguration> processConfiguration,
362 resultsInserter_{tns.
getTrigPaths().empty()? std::shared_ptr<TriggerResultInserter>{} :makeInserter(proc_pset,prealloc,preg,actions,areg,processConfiguration)},
369 assert(0<
prealloc.numberOfStreams());
370 streamSchedules_.reserve(
prealloc.numberOfStreams());
371 for(
unsigned int i=0;
i<
prealloc.numberOfStreams();++
i) {
372 streamSchedules_.emplace_back(std::shared_ptr<StreamSchedule>{
new StreamSchedule{resultsInserter_.get(),
moduleRegistry_,proc_pset,tns,
prealloc,
preg,branchIDListHelper,
actions,
areg,
processConfiguration,
nullptr==subProcPSet,
StreamID{
i},processContext}});
377 const std::string kTriggerResults(
"TriggerResults");
378 std::vector<std::string> modulesToUse;
379 modulesToUse.reserve(streamSchedules_[0]->allWorkers().
size());
380 for(
auto const& worker : streamSchedules_[0]->allWorkers()) {
381 if(worker->description().moduleLabel() != kTriggerResults) {
382 modulesToUse.push_back(worker->description().moduleLabel());
386 unsigned int n = streamSchedules_[0]->numberOfUnscheduledModules();
388 std::vector<std::string>
temp;
389 temp.reserve(modulesToUse.size());
390 auto itBeginUnscheduled = modulesToUse.begin()+modulesToUse.size()-
n;
391 std::copy(itBeginUnscheduled,modulesToUse.end(),
392 std::back_inserter(temp));
393 std::copy(modulesToUse.begin(),itBeginUnscheduled,std::back_inserter(temp));
394 temp.swap(modulesToUse);
396 globalSchedule_.reset(
new GlobalSchedule{ resultsInserter_.get(),
404 std::set<std::string> usedModuleLabels;
405 for(
auto const worker: allWorkers()) {
406 if(worker->description().moduleLabel() != kTriggerResults) {
407 usedModuleLabels.insert(worker->description().moduleLabel());
410 std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string> >(
"@all_modules"));
411 std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
412 reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels,
413 outputModulePathPositions);
414 processEDAliases(proc_pset, processConfiguration->processName(),
preg);
415 proc_pset.registerIt();
417 processConfiguration->setParameterSetID(proc_pset.id());
418 processConfiguration->setProcessConfigurationID();
422 size_t all_workers_count = allWorkers().size();
424 moduleRegistry_->forAllModuleHolders([
this](maker::ModuleHolder* iHolder){
425 auto comm = iHolder->createOutputModuleCommunicator();
431 limitOutput(proc_pset, branchIDListHelper.branchIDLists());
437 assert (all_workers_count == allWorkers().
size());
439 branchIDListHelper.updateFromRegistry(preg);
444 c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
445 c->selectProducts(preg);
456 int maxEventSpecs = 0;
457 int maxEventsOut = -1;
464 std::vector<std::string> psetNamesE;
471 if (maxEventSpecs > 1) {
473 "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
478 if (vMaxEventsOut != 0 && !vMaxEventsOut->
empty()) {
479 std::string const& moduleLabel =
c->description().moduleLabel();
484 "\nNo entry in 'maxEvents' for output module label '" << moduleLabel <<
"'.\n";
496 if (!
c->limitReached()) {
501 LogInfo(
"SuccessfulTermination")
502 <<
"The job is terminating successfully because each output module\n"
503 <<
"has reached its configured limit.\n";
521 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Event Summary ------------";
536 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Path Summary ------------";
538 << std::right << std::setw(10) <<
"Trig Bit#" <<
" "
539 << std::right << std::setw(10) <<
"Run" <<
" "
540 << std::right << std::setw(10) <<
"Passed" <<
" "
541 << std::right << std::setw(10) <<
"Failed" <<
" "
542 << std::right << std::setw(10) <<
"Error" <<
" "
546 << std::right << std::setw(5) << 1
547 << std::right << std::setw(5) <<
p.bitPosition <<
" "
548 << std::right << std::setw(10) <<
p.timesRun <<
" "
549 << std::right << std::setw(10) <<
p.timesPassed <<
" "
550 << std::right << std::setw(10) <<
p.timesFailed <<
" "
551 << std::right << std::setw(10) <<
p.timesExcept <<
" "
573 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"-------End-Path Summary ------------";
575 << std::right << std::setw(10) <<
"Trig Bit#" <<
" "
576 << std::right << std::setw(10) <<
"Run" <<
" "
577 << std::right << std::setw(10) <<
"Passed" <<
" "
578 << std::right << std::setw(10) <<
"Failed" <<
" "
579 << std::right << std::setw(10) <<
"Error" <<
" "
583 << std::right << std::setw(5) << 0
584 << std::right << std::setw(5) <<
p.bitPosition <<
" "
585 << std::right << std::setw(10) <<
p.timesRun <<
" "
586 << std::right << std::setw(10) <<
p.timesPassed <<
" "
587 << std::right << std::setw(10) <<
p.timesFailed <<
" "
588 << std::right << std::setw(10) <<
p.timesExcept <<
" "
594 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Modules in Path: " <<
p.name <<
" ------------";
596 << std::right << std::setw(10) <<
"Trig Bit#" <<
" "
597 << std::right << std::setw(10) <<
"Visited" <<
" "
598 << std::right << std::setw(10) <<
"Passed" <<
" "
599 << std::right << std::setw(10) <<
"Failed" <<
" "
600 << std::right << std::setw(10) <<
"Error" <<
" "
603 unsigned int bitpos = 0;
604 for (
auto const&
mod:
p.moduleInPathSummaries) {
606 << std::right << std::setw(5) << 1
607 << std::right << std::setw(5) << bitpos <<
" "
608 << std::right << std::setw(10) <<
mod.timesVisited <<
" "
609 << std::right << std::setw(10) <<
mod.timesPassed <<
" "
610 << std::right << std::setw(10) <<
mod.timesFailed <<
" "
611 << std::right << std::setw(10) <<
mod.timesExcept <<
" "
612 <<
mod.moduleLabel <<
"";
619 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"------ Modules in End-Path: " <<
p.name <<
" ------------";
621 << std::right << std::setw(10) <<
"Trig Bit#" <<
" "
622 << std::right << std::setw(10) <<
"Visited" <<
" "
623 << std::right << std::setw(10) <<
"Passed" <<
" "
624 << std::right << std::setw(10) <<
"Failed" <<
" "
625 << std::right << std::setw(10) <<
"Error" <<
" "
628 unsigned int bitpos=0;
629 for (
auto const&
mod:
p.moduleInPathSummaries) {
631 << std::right << std::setw(5) << 0
632 << std::right << std::setw(5) << bitpos <<
" "
633 << std::right << std::setw(10) <<
mod.timesVisited <<
" "
634 << std::right << std::setw(10) <<
mod.timesPassed <<
" "
635 << std::right << std::setw(10) <<
mod.timesFailed <<
" "
636 << std::right << std::setw(10) <<
mod.timesExcept <<
" "
637 <<
mod.moduleLabel <<
"";
643 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Module Summary ------------";
645 << std::right << std::setw(10) <<
"Visited" <<
" "
646 << std::right << std::setw(10) <<
"Run" <<
" "
647 << std::right << std::setw(10) <<
"Passed" <<
" "
648 << std::right << std::setw(10) <<
"Failed" <<
" "
649 << std::right << std::setw(10) <<
"Error" <<
" "
653 << std::right << std::setw(10) << worker.timesVisited <<
" "
654 << std::right << std::setw(10) << worker.timesRun <<
" "
655 << std::right << std::setw(10) << worker.timesPassed <<
" "
656 << std::right << std::setw(10) << worker.timesFailed <<
" "
657 << std::right << std::setw(10) << worker.timesExcept <<
" "
658 << worker.moduleLabel <<
"";
668 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Event Summary ---[sec]----";
670 << std::setprecision(6) << std::fixed
676 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Path Summary ---[sec]----";
678 << std::right << std::setw(22) <<
"per event "
679 << std::right << std::setw(22) <<
"per path-run "
682 << std::right << std::setw(10) <<
"CPU" <<
" "
683 << std::right << std::setw(10) <<
"Real" <<
" "
684 << std::right << std::setw(10) <<
"CPU" <<
" "
685 << std::right << std::setw(10) <<
"Real" <<
" "
688 const int timesRun =
std::max(1,
p.timesRun);
690 << std::setprecision(6) << std::fixed
691 << std::right << std::setw(10) <<
p.cpuTime/totalEvents <<
" "
692 << std::right << std::setw(10) <<
p.realTime/totalEvents <<
" "
693 << std::right << std::setw(10) <<
p.cpuTime/timesRun <<
" "
694 << std::right << std::setw(10) <<
p.realTime/timesRun <<
" "
698 << std::right << std::setw(10) <<
"CPU" <<
" "
699 << std::right << std::setw(10) <<
"Real" <<
" "
700 << std::right << std::setw(10) <<
"CPU" <<
" "
701 << std::right << std::setw(10) <<
"Real" <<
" "
704 << std::right << std::setw(22) <<
"per event "
705 << std::right << std::setw(22) <<
"per path-run "
709 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"-------End-Path Summary ---[sec]----";
711 << std::right << std::setw(22) <<
"per event "
712 << std::right << std::setw(22) <<
"per endpath-run "
715 << std::right << std::setw(10) <<
"CPU" <<
" "
716 << std::right << std::setw(10) <<
"Real" <<
" "
717 << std::right << std::setw(10) <<
"CPU" <<
" "
718 << std::right << std::setw(10) <<
"Real" <<
" "
721 const int timesRun =
std::max(1,
p.timesRun);
724 << std::setprecision(6) << std::fixed
725 << std::right << std::setw(10) <<
p.cpuTime/totalEvents <<
" "
726 << std::right << std::setw(10) <<
p.realTime/totalEvents <<
" "
727 << std::right << std::setw(10) <<
p.cpuTime/timesRun <<
" "
728 << std::right << std::setw(10) <<
p.realTime/timesRun <<
" "
732 << std::right << std::setw(10) <<
"CPU" <<
" "
733 << std::right << std::setw(10) <<
"Real" <<
" "
734 << std::right << std::setw(10) <<
"CPU" <<
" "
735 << std::right << std::setw(10) <<
"Real" <<
" "
738 << std::right << std::setw(22) <<
"per event "
739 << std::right << std::setw(22) <<
"per endpath-run "
744 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Modules in Path: " <<
p.name <<
" ---[sec]----";
746 << std::right << std::setw(22) <<
"per event "
747 << std::right << std::setw(22) <<
"per module-visit "
750 << std::right << std::setw(10) <<
"CPU" <<
" "
751 << std::right << std::setw(10) <<
"Real" <<
" "
752 << std::right << std::setw(10) <<
"CPU" <<
" "
753 << std::right << std::setw(10) <<
"Real" <<
" "
755 for (
auto const&
mod:
p.moduleInPathSummaries) {
757 << std::setprecision(6) << std::fixed
758 << std::right << std::setw(10) <<
mod.cpuTime/totalEvents <<
" "
759 << std::right << std::setw(10) <<
mod.realTime/totalEvents <<
" "
760 << std::right << std::setw(10) <<
mod.cpuTime/
std::max(1,
mod.timesVisited) <<
" "
761 << std::right << std::setw(10) <<
mod.realTime/
std::max(1,
mod.timesVisited) <<
" "
762 <<
mod.moduleLabel <<
"";
766 << std::right << std::setw(10) <<
"CPU" <<
" "
767 << std::right << std::setw(10) <<
"Real" <<
" "
768 << std::right << std::setw(10) <<
"CPU" <<
" "
769 << std::right << std::setw(10) <<
"Real" <<
" "
772 << std::right << std::setw(22) <<
"per event "
773 << std::right << std::setw(22) <<
"per module-visit "
778 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"------ Modules in End-Path: " <<
p.name <<
" ---[sec]----";
780 << std::right << std::setw(22) <<
"per event "
781 << std::right << std::setw(22) <<
"per module-visit "
784 << std::right << std::setw(10) <<
"CPU" <<
" "
785 << std::right << std::setw(10) <<
"Real" <<
" "
786 << std::right << std::setw(10) <<
"CPU" <<
" "
787 << std::right << std::setw(10) <<
"Real" <<
" "
789 for (
auto const&
mod:
p.moduleInPathSummaries) {
791 << std::setprecision(6) << std::fixed
792 << std::right << std::setw(10) <<
mod.cpuTime/totalEvents <<
" "
793 << std::right << std::setw(10) <<
mod.realTime/totalEvents <<
" "
794 << std::right << std::setw(10) <<
mod.cpuTime/
std::max(1,
mod.timesVisited) <<
" "
795 << std::right << std::setw(10) <<
mod.realTime/
std::max(1,
mod.timesVisited) <<
" "
796 <<
mod.moduleLabel <<
"";
800 << std::right << std::setw(10) <<
"CPU" <<
" "
801 << std::right << std::setw(10) <<
"Real" <<
" "
802 << std::right << std::setw(10) <<
"CPU" <<
" "
803 << std::right << std::setw(10) <<
"Real" <<
" "
806 << std::right << std::setw(22) <<
"per event "
807 << std::right << std::setw(22) <<
"per module-visit "
811 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Module Summary ---[sec]----";
813 << std::right << std::setw(22) <<
"per event "
814 << std::right << std::setw(22) <<
"per module-run "
815 << std::right << std::setw(22) <<
"per module-visit "
818 << std::right << std::setw(10) <<
"CPU" <<
" "
819 << std::right << std::setw(10) <<
"Real" <<
" "
820 << std::right << std::setw(10) <<
"CPU" <<
" "
821 << std::right << std::setw(10) <<
"Real" <<
" "
822 << std::right << std::setw(10) <<
"CPU" <<
" "
823 << std::right << std::setw(10) <<
"Real" <<
" "
827 << std::setprecision(6) << std::fixed
828 << std::right << std::setw(10) << worker.cpuTime/totalEvents <<
" "
829 << std::right << std::setw(10) << worker.realTime/totalEvents <<
" "
830 << std::right << std::setw(10) << worker.cpuTime/
std::max(1, worker.timesRun) <<
" "
831 << std::right << std::setw(10) << worker.realTime/
std::max(1, worker.timesRun) <<
" "
832 << std::right << std::setw(10) << worker.cpuTime/
std::max(1, worker.timesVisited) <<
" "
833 << std::right << std::setw(10) << worker.realTime/
std::max(1, worker.timesVisited) <<
" "
834 << worker.moduleLabel <<
"";
837 << std::right << std::setw(10) <<
"CPU" <<
" "
838 << std::right << std::setw(10) <<
"Real" <<
" "
839 << std::right << std::setw(10) <<
"CPU" <<
" "
840 << std::right << std::setw(10) <<
"Real" <<
" "
841 << std::right << std::setw(10) <<
"CPU" <<
" "
842 << std::right << std::setw(10) <<
"Real" <<
" "
845 << std::right << std::setw(22) <<
"per event "
846 << std::right << std::setw(22) <<
"per module-run "
847 << std::right << std::setw(22) <<
"per module-visit "
851 LogVerbatim(
"FwkSummary") <<
"T---Report end!" <<
"";
915 if (worker->description().moduleLabel() == iLabel) {
920 if (
nullptr == found) {
929 s->replaceModule(newMod,iLabel);
934 std::vector<ModuleDescription const*>
936 std::vector<ModuleDescription const*>
result;
958 std::vector<std::string>& oLabelsToFill)
const {
966 s->enableEndPaths(active);
981 s->getTriggerReport(rep);
991 s->getTriggerTimingReport(rep);
999 returnValue += s->totalEvents();
1006 int returnValue = 0;
1008 returnValue += s->totalEventsPassed();
1015 int returnValue = 0;
1017 returnValue += s->totalEventsFailed();
std::vector< PathSummary > endPathSummaries
T getUntrackedParameter(std::string const &, T const &) const
std::vector< PathTimingSummary > endPathSummaries
std::vector< BranchIDList > BranchIDLists
virtual void openFile(FileBlock const &fb)=0
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
virtual void writeRun(RunPrincipal const &rp, ProcessContext const *)=0
preallocConfig_(prealloc)
bool endPathsEnabled() const
all_output_communicators_()
void respondToCloseInputFile(FileBlock const &fb)
bool changeModule(std::string const &iLabel, ParameterSet const &iPSet)
std::vector< Worker * > AllWorkers
std::vector< ParameterSet > VParameterSet
void writeRun(RunPrincipal const &rp, ProcessContext const *)
void endStream(unsigned int)
void writeLumi(LuminosityBlockPrincipal const &lbp, ProcessContext const *)
void enableEndPaths(bool active)
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
std::vector< WorkerSummary > workerSummaries
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription's constructor's modI...
int totalEventsFailed() const
void eraseOrSetUntrackedParameterSet(std::string const &name)
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
int totalEventsPassed() const
std::vector< PathSummary > trigPathSummaries
EventSummary eventSummary
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists)
const T & max(const T &a, const T &b)
wantSummary_(tns.wantSummary())
virtual void openNewFileIfNeeded()=0
EventTimingSummary eventSummary
void clearCounters()
Clear all the counters in the trigger report.
boost::shared_ptr< ModuleRegistry > moduleRegistry_
std::vector< PathTimingSummary > trigPathSummaries
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
void setProcessParameterSetID(ParameterSetID const &id)
Associated free functions.
bool terminate() const
Return whether each output module has reached its maximum count.
void respondToOpenInputFile(FileBlock const &fb)
virtual void writeLumi(LuminosityBlockPrincipal const &lbp, ProcessContext const *)=0
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
void getTriggerReport(TriggerReport &rep) const
virtual bool shouldWeCloseFile() const =0
PreallocationConfiguration preallocConfig_
moduleRegistry_(new ModuleRegistry())
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
volatile bool endpathsAreActive_
void respondToOpenInputFile(FileBlock const &fb)
bool search_all(ForwardSequence const &s, Datum const &d)
AllOutputModuleCommunicators all_output_communicators_
void loadMissingDictionaries()
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 ...
Schedule(ParameterSet &proc_pset, service::TriggerNamesService &tns, ProductRegistry &pregistry, BranchIDListHelper &branchIDListHelper, ExceptionToActionTable const &actions, boost::shared_ptr< ActivityRegistry > areg, boost::shared_ptr< ProcessConfiguration > processConfiguration, const ParameterSet *subProcPSet, PreallocationConfiguration const &config, ProcessContext const *processContext)
void beginStream(unsigned int)
void respondToCloseInputFile(FileBlock const &fb)
void preForkReleaseResources()
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Strings const & getTrigPaths() const
std::unique_ptr< GlobalSchedule > globalSchedule_
void beginJob(ProductRegistry const &)
virtual void closeFile()=0
void openNewOutputFilesIfNeeded()
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
void preForkReleaseResources()
void openOutputFiles(FileBlock &fb)
std::vector< WorkerTimingSummary > workerSummaries
T mod(const T &a, const T &b)
void endJob(ExceptionCollector &collector)
void getTriggerTimingReport(TriggerTimingReport &rep) const
bool shouldWeCloseOutput() const
std::vector< std::string > vstring
tuple size
Write out results.
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)