CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::Schedule Class Reference

#include <Schedule.h>

Public Types

typedef std::vector
< boost::shared_ptr
< OutputModuleCommunicator > > 
AllOutputModuleCommunicators
 
typedef std::vector< Worker * > AllWorkers
 
typedef std::vector< std::string > vstring
 
typedef boost::shared_ptr< WorkerWorkerPtr
 
typedef std::vector< Worker * > Workers
 

Public Member Functions

AllWorkers const & allWorkers () const
 returns the collection of pointers to workers More...
 
void availablePaths (std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill the labels for all paths in the process More...
 
void beginJob (ProductRegistry const &)
 
void beginStream (unsigned int)
 
bool changeModule (std::string const &iLabel, ParameterSet const &iPSet)
 
void clearCounters ()
 Clear all the counters in the trigger report. More...
 
void closeOutputFiles ()
 
void enableEndPaths (bool active)
 
void endJob (ExceptionCollector &collector)
 
bool endPathsEnabled () const
 
void endStream (unsigned int)
 
std::vector< ModuleDescription
const * > 
getAllModuleDescriptions () const
 
void getTriggerReport (TriggerReport &rep) const
 
void getTriggerTimingReport (TriggerTimingReport &rep) const
 
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 More...
 
void openNewOutputFilesIfNeeded ()
 
void openOutputFiles (FileBlock &fb)
 
void postForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
 
void preForkReleaseResources ()
 
template<typename T >
void processOneEvent (unsigned int iStreamID, typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
 
template<typename T >
void processOneGlobal (typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
 
template<typename T >
void processOneStream (unsigned int iStreamID, typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
 
void respondToCloseInputFile (FileBlock const &fb)
 
void respondToOpenInputFile (FileBlock const &fb)
 
 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)
 
bool shouldWeCloseOutput () const
 
bool terminate () const
 Return whether each output module has reached its maximum count. More...
 
int totalEvents () const
 
int totalEventsFailed () const
 
int totalEventsPassed () const
 
void writeLumi (LuminosityBlockPrincipal const &lbp, ProcessContext const *)
 
void writeRun (RunPrincipal const &rp, ProcessContext const *)
 

Private Member Functions

void limitOutput (ParameterSet const &proc_pset, BranchIDLists const &branchIDLists)
 

Private Attributes

AllOutputModuleCommunicators all_output_communicators_
 
volatile bool endpathsAreActive_
 
std::unique_ptr< GlobalScheduleglobalSchedule_
 
boost::shared_ptr< ModuleRegistrymoduleRegistry_
 
PreallocationConfiguration preallocConfig_
 
std::shared_ptr
< TriggerResultInserter
resultsInserter_
 
std::vector< std::shared_ptr
< StreamSchedule > > 
streamSchedules_
 
bool wantSummary_
 

Detailed Description

Definition at line 109 of file Schedule.h.

Member Typedef Documentation

Definition at line 114 of file Schedule.h.

typedef std::vector<Worker*> edm::Schedule::AllWorkers

Definition at line 113 of file Schedule.h.

typedef std::vector<std::string> edm::Schedule::vstring

Definition at line 111 of file Schedule.h.

typedef boost::shared_ptr<Worker> edm::Schedule::WorkerPtr

Definition at line 112 of file Schedule.h.

typedef std::vector<Worker*> edm::Schedule::Workers

Definition at line 116 of file Schedule.h.

Constructor & Destructor Documentation

edm::Schedule::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 
)

Definition at line 351 of file Schedule.cc.

360  :
361  //Only create a resultsInserter if there is a trigger path
362  resultsInserter_{tns.getTrigPaths().empty()? std::shared_ptr<TriggerResultInserter>{} :makeInserter(proc_pset,prealloc,preg,actions,areg,processConfiguration)},
processConfiguration
Definition: Schedule.cc:362
actions
Definition: Schedule.cc:362
std::shared_ptr< TriggerResultInserter > resultsInserter_
Definition: Schedule.h:240
areg
Definition: Schedule.cc:362
preg
Definition: Schedule.cc:362
prealloc
Definition: Schedule.cc:362

Member Function Documentation

Schedule::AllWorkers const & edm::Schedule::allWorkers ( ) const

returns the collection of pointers to workers

Definition at line 947 of file Schedule.cc.

References globalSchedule_.

Referenced by changeModule(), getAllModuleDescriptions(), postForkReacquireResources(), preForkReleaseResources(), respondToCloseInputFile(), and respondToOpenInputFile().

947  {
948  return globalSchedule_->allWorkers();
949  }
std::unique_ptr< GlobalSchedule > globalSchedule_
Definition: Schedule.h:244
void edm::Schedule::availablePaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all paths in the process

Definition at line 952 of file Schedule.cc.

References streamSchedules_.

Referenced by edm::ScheduleInfo::availablePaths().

952  {
953  streamSchedules_[0]->availablePaths(oLabelsToFill);
954  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
void edm::Schedule::beginJob ( ProductRegistry const &  iRegistry)

Definition at line 890 of file Schedule.cc.

References globalSchedule_.

890  {
891  globalSchedule_->beginJob(iRegistry);
892  }
std::unique_ptr< GlobalSchedule > globalSchedule_
Definition: Schedule.h:244
void edm::Schedule::beginStream ( unsigned int  iStreamID)

Definition at line 894 of file Schedule.cc.

References streamSchedules_.

894  {
895  assert(iStreamID<streamSchedules_.size());
896  streamSchedules_[iStreamID]->beginStream();
897  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
bool edm::Schedule::changeModule ( std::string const &  iLabel,
ParameterSet const &  iPSet 
)

clone the type of module with label iLabel but configure with iPSet. Returns true if successful.

Definition at line 911 of file Schedule.cc.

References allWorkers(), newFWLiteAna::found, globalSchedule_, moduleRegistry_, preallocConfig_, and streamSchedules_.

Referenced by edm::ModuleChanger::changeModule().

912  {
913  Worker* found = nullptr;
914  for (auto const& worker : allWorkers()) {
915  if (worker->description().moduleLabel() == iLabel) {
916  found = worker;
917  break;
918  }
919  }
920  if (nullptr == found) {
921  return false;
922  }
923 
924  auto newMod = moduleRegistry_->replaceModule(iLabel,iPSet,preallocConfig_);
925 
926  globalSchedule_->replaceModule(newMod,iLabel);
927 
928  for(auto s: streamSchedules_) {
929  s->replaceModule(newMod,iLabel);
930  }
931  return true;
932  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:947
boost::shared_ptr< ModuleRegistry > moduleRegistry_
Definition: Schedule.h:241
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:247
std::unique_ptr< GlobalSchedule > globalSchedule_
Definition: Schedule.h:244
void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1024 of file Schedule.cc.

References streamSchedules_.

1024  {
1025  for(auto const& s: streamSchedules_) {
1026  s->clearCounters();
1027  }
1028  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
void edm::Schedule::closeOutputFiles ( )

Definition at line 855 of file Schedule.cc.

References all_output_communicators_, edm::OutputModuleCommunicator::closeFile(), and edm::for_all().

855  {
857  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:246
void edm::Schedule::enableEndPaths ( bool  active)

Turn end_paths "off" if "active" is false; turn end_paths "on" if "active" is true.

Definition at line 963 of file Schedule.cc.

References endpathsAreActive_, and streamSchedules_.

963  {
964  endpathsAreActive_ = active;
965  for(auto const & s : streamSchedules_) {
966  s->enableEndPaths(active);
967  }
968  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
volatile bool endpathsAreActive_
Definition: Schedule.h:252
void edm::Schedule::endJob ( ExceptionCollector collector)

Definition at line 507 of file Schedule.cc.

References edm::EventTimingSummary::cpuTime, edm::TriggerTimingReport::endPathSummaries, edm::TriggerReport::endPathSummaries, edm::TriggerTimingReport::eventSummary, edm::TriggerReport::eventSummary, getTriggerReport(), getTriggerTimingReport(), globalSchedule_, edm::ExceptionCollector::hasThrown(), max(), mod(), AlCaHLTBitMon_ParallelJobs::p, edm::EventTimingSummary::realTime, edm::EventTimingSummary::totalEvents, edm::EventSummary::totalEvents, totalEvents(), edm::EventSummary::totalEventsFailed, edm::EventSummary::totalEventsPassed, edm::TriggerTimingReport::trigPathSummaries, edm::TriggerReport::trigPathSummaries, wantSummary_, edm::TriggerTimingReport::workerSummaries, and edm::TriggerReport::workerSummaries.

507  {
508  globalSchedule_->endJob(collector);
509  if (collector.hasThrown()) {
510  return;
511  }
512 
513  if (wantSummary_ == false) return;
514  {
515  TriggerReport tr;
516  getTriggerReport(tr);
517 
518  // The trigger report (pass/fail etc.):
519 
520  LogVerbatim("FwkSummary") << "";
521  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Event Summary ------------";
522  if(!tr.trigPathSummaries.empty()) {
523  LogVerbatim("FwkSummary") << "TrigReport"
524  << " Events total = " << tr.eventSummary.totalEvents
525  << " passed = " << tr.eventSummary.totalEventsPassed
526  << " failed = " << tr.eventSummary.totalEventsFailed
527  << "";
528  } else {
529  LogVerbatim("FwkSummary") << "TrigReport"
530  << " Events total = " << tr.eventSummary.totalEvents
531  << " passed = " << tr.eventSummary.totalEvents
532  << " failed = 0";
533  }
534 
535  LogVerbatim("FwkSummary") << "";
536  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Path Summary ------------";
537  LogVerbatim("FwkSummary") << "TrigReport "
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" << " "
543  << "Name" << "";
544  for (auto const& p: tr.trigPathSummaries) {
545  LogVerbatim("FwkSummary") << "TrigReport "
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 << " "
552  << p.name << "";
553  }
554 
555  /*
556  std::vector<int>::const_iterator epi = empty_trig_paths_.begin();
557  std::vector<int>::const_iterator epe = empty_trig_paths_.end();
558  std::vector<std::string>::const_iterator epn = empty_trig_path_names_.begin();
559  for (; epi != epe; ++epi, ++epn) {
560 
561  LogVerbatim("FwkSummary") << "TrigReport "
562  << std::right << std::setw(5) << 1
563  << std::right << std::setw(5) << *epi << " "
564  << std::right << std::setw(10) << totalEvents() << " "
565  << std::right << std::setw(10) << totalEvents() << " "
566  << std::right << std::setw(10) << 0 << " "
567  << std::right << std::setw(10) << 0 << " "
568  << *epn << "";
569  }
570  */
571 
572  LogVerbatim("FwkSummary") << "";
573  LogVerbatim("FwkSummary") << "TrigReport " << "-------End-Path Summary ------------";
574  LogVerbatim("FwkSummary") << "TrigReport "
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" << " "
580  << "Name" << "";
581  for (auto const& p: tr.endPathSummaries) {
582  LogVerbatim("FwkSummary") << "TrigReport "
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 << " "
589  << p.name << "";
590  }
591 
592  for (auto const& p: tr.trigPathSummaries) {
593  LogVerbatim("FwkSummary") << "";
594  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Modules in Path: " << p.name << " ------------";
595  LogVerbatim("FwkSummary") << "TrigReport "
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" << " "
601  << "Name" << "";
602 
603  unsigned int bitpos = 0;
604  for (auto const& mod: p.moduleInPathSummaries) {
605  LogVerbatim("FwkSummary") << "TrigReport "
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 << "";
613  ++bitpos;
614  }
615  }
616 
617  for (auto const& p: tr.endPathSummaries) {
618  LogVerbatim("FwkSummary") << "";
619  LogVerbatim("FwkSummary") << "TrigReport " << "------ Modules in End-Path: " << p.name << " ------------";
620  LogVerbatim("FwkSummary") << "TrigReport "
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" << " "
626  << "Name" << "";
627 
628  unsigned int bitpos=0;
629  for (auto const& mod: p.moduleInPathSummaries) {
630  LogVerbatim("FwkSummary") << "TrigReport "
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 << "";
638  ++bitpos;
639  }
640  }
641 
642  LogVerbatim("FwkSummary") << "";
643  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Module Summary ------------";
644  LogVerbatim("FwkSummary") << "TrigReport "
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" << " "
650  << "Name" << "";
651  for (auto const& worker : tr.workerSummaries) {
652  LogVerbatim("FwkSummary") << "TrigReport "
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 << "";
659  }
660  LogVerbatim("FwkSummary") << "";
661  }
662  // The timing report (CPU and Real Time):
663  TriggerTimingReport tr;
665 
666  const int totalEvents = std::max(1, tr.eventSummary.totalEvents);
667 
668  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Event Summary ---[sec]----";
669  LogVerbatim("FwkSummary") << "TimeReport"
670  << std::setprecision(6) << std::fixed
671  << " CPU/event = " << tr.eventSummary.cpuTime/totalEvents
672  << " Real/event = " << tr.eventSummary.realTime/totalEvents
673  << "";
674 
675  LogVerbatim("FwkSummary") << "";
676  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Path Summary ---[sec]----";
677  LogVerbatim("FwkSummary") << "TimeReport "
678  << std::right << std::setw(22) << "per event "
679  << std::right << std::setw(22) << "per path-run "
680  << "";
681  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
686  << "Name" << "";
687  for (auto const& p: tr.trigPathSummaries) {
688  const int timesRun = std::max(1, p.timesRun);
689  LogVerbatim("FwkSummary") << "TimeReport "
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 << " "
695  << p.name << "";
696  }
697  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
702  << "Name" << "";
703  LogVerbatim("FwkSummary") << "TimeReport "
704  << std::right << std::setw(22) << "per event "
705  << std::right << std::setw(22) << "per path-run "
706  << "";
707 
708  LogVerbatim("FwkSummary") << "";
709  LogVerbatim("FwkSummary") << "TimeReport " << "-------End-Path Summary ---[sec]----";
710  LogVerbatim("FwkSummary") << "TimeReport "
711  << std::right << std::setw(22) << "per event "
712  << std::right << std::setw(22) << "per endpath-run "
713  << "";
714  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
719  << "Name" << "";
720  for (auto const& p: tr.endPathSummaries) {
721  const int timesRun = std::max(1, p.timesRun);
722 
723  LogVerbatim("FwkSummary") << "TimeReport "
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 << " "
729  << p.name << "";
730  }
731  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
736  << "Name" << "";
737  LogVerbatim("FwkSummary") << "TimeReport "
738  << std::right << std::setw(22) << "per event "
739  << std::right << std::setw(22) << "per endpath-run "
740  << "";
741 
742  for (auto const& p: tr.trigPathSummaries) {
743  LogVerbatim("FwkSummary") << "";
744  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Modules in Path: " << p.name << " ---[sec]----";
745  LogVerbatim("FwkSummary") << "TimeReport "
746  << std::right << std::setw(22) << "per event "
747  << std::right << std::setw(22) << "per module-visit "
748  << "";
749  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
754  << "Name" << "";
755  for (auto const& mod: p.moduleInPathSummaries) {
756  LogVerbatim("FwkSummary") << "TimeReport "
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 << "";
763  }
764  }
765  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
770  << "Name" << "";
771  LogVerbatim("FwkSummary") << "TimeReport "
772  << std::right << std::setw(22) << "per event "
773  << std::right << std::setw(22) << "per module-visit "
774  << "";
775 
776  for (auto const& p: tr.endPathSummaries) {
777  LogVerbatim("FwkSummary") << "";
778  LogVerbatim("FwkSummary") << "TimeReport " << "------ Modules in End-Path: " << p.name << " ---[sec]----";
779  LogVerbatim("FwkSummary") << "TimeReport "
780  << std::right << std::setw(22) << "per event "
781  << std::right << std::setw(22) << "per module-visit "
782  << "";
783  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
788  << "Name" << "";
789  for (auto const& mod: p.moduleInPathSummaries) {
790  LogVerbatim("FwkSummary") << "TimeReport "
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 << "";
797  }
798  }
799  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
804  << "Name" << "";
805  LogVerbatim("FwkSummary") << "TimeReport "
806  << std::right << std::setw(22) << "per event "
807  << std::right << std::setw(22) << "per module-visit "
808  << "";
809 
810  LogVerbatim("FwkSummary") << "";
811  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Module Summary ---[sec]----";
812  LogVerbatim("FwkSummary") << "TimeReport "
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 "
816  << "";
817  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
824  << "Name" << "";
825  for (auto const& worker : tr.workerSummaries) {
826  LogVerbatim("FwkSummary") << "TimeReport "
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 << "";
835  }
836  LogVerbatim("FwkSummary") << "TimeReport "
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" << " "
843  << "Name" << "";
844  LogVerbatim("FwkSummary") << "TimeReport "
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 "
848  << "";
849 
850  LogVerbatim("FwkSummary") << "";
851  LogVerbatim("FwkSummary") << "T---Report end!" << "";
852  LogVerbatim("FwkSummary") << "";
853  }
const T & max(const T &a, const T &b)
int totalEvents() const
Definition: Schedule.cc:996
void getTriggerReport(TriggerReport &rep) const
Definition: Schedule.cc:976
bool wantSummary_
Definition: Schedule.h:250
std::unique_ptr< GlobalSchedule > globalSchedule_
Definition: Schedule.h:244
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void getTriggerTimingReport(TriggerTimingReport &rep) const
Definition: Schedule.cc:986
bool edm::Schedule::endPathsEnabled ( ) const

Return true if end_paths are active, and false if they are inactive.

Definition at line 971 of file Schedule.cc.

References endpathsAreActive_.

971  {
972  return endpathsAreActive_;
973  }
volatile bool endpathsAreActive_
Definition: Schedule.h:252
void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 899 of file Schedule.cc.

References streamSchedules_.

899  {
900  assert(iStreamID<streamSchedules_.size());
901  streamSchedules_[iStreamID]->endStream();
902  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
std::vector< ModuleDescription const * > edm::Schedule::getAllModuleDescriptions ( ) const

Return a vector allowing const access to all the ModuleDescriptions for this Schedule. *** N.B. *** Ownership of the ModuleDescriptions is not *** passed to the caller. Do not call delete on these *** pointers!

Definition at line 935 of file Schedule.cc.

References allWorkers(), AlCaHLTBitMon_ParallelJobs::p, query::result, and findQualityFiles::size.

Referenced by edm::ScheduleInfo::availableModuleLabels(), and edm::ScheduleInfo::parametersForModule().

935  {
936  std::vector<ModuleDescription const*> result;
937  result.reserve(allWorkers().size());
938 
939  for (auto const& worker : allWorkers()) {
940  ModuleDescription const* p = worker->descPtr();
941  result.push_back(p);
942  }
943  return result;
944  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:947
tuple result
Definition: query.py:137
tuple size
Write out results.
void edm::Schedule::getTriggerReport ( TriggerReport rep) const

Return the trigger report information on paths, modules-in-path, modules-in-endpath, and modules.

Definition at line 976 of file Schedule.cc.

References edm::TriggerReport::eventSummary, streamSchedules_, edm::EventSummary::totalEvents, edm::EventSummary::totalEventsFailed, and edm::EventSummary::totalEventsPassed.

Referenced by endJob().

976  {
977  rep.eventSummary.totalEvents = 0;
978  rep.eventSummary.totalEventsPassed = 0;
979  rep.eventSummary.totalEventsFailed = 0;
980  for(auto& s: streamSchedules_) {
981  s->getTriggerReport(rep);
982  }
983  }
string rep
Definition: cuy.py:1188
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
void edm::Schedule::getTriggerTimingReport ( TriggerTimingReport rep) const

Return the trigger timing report information on paths, modules-in-path, modules-in-endpath, and modules.

Definition at line 986 of file Schedule.cc.

References edm::EventTimingSummary::cpuTime, edm::TriggerTimingReport::eventSummary, edm::EventTimingSummary::realTime, streamSchedules_, and edm::EventTimingSummary::totalEvents.

Referenced by endJob().

986  {
987  rep.eventSummary.totalEvents = 0;
988  rep.eventSummary.cpuTime = 0.;
989  rep.eventSummary.realTime = 0.;
990  for(auto& s: streamSchedules_) {
991  s->getTriggerTimingReport(rep);
992  }
993  }
string rep
Definition: cuy.py:1188
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists 
)
private

Definition at line 452 of file Schedule.cc.

References all_output_communicators_, trackerHits::c, edm::errors::Configuration, edm::ParameterSet::empty(), edm::hlt::Exception, edm::ParameterSet::getParameterNamesForType(), edm::ParameterSet::getParameterSetNames(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), edm::OutputModuleDescription::maxEvents_, convertSQLitetoXML_cfg::output, edm::search_all(), and AlCaHLTBitMon_QueryRunRegistry::string.

452  {
453  std::string const output("output");
454 
455  ParameterSet const& maxEventsPSet = proc_pset.getUntrackedParameterSet("maxEvents", ParameterSet());
456  int maxEventSpecs = 0;
457  int maxEventsOut = -1;
458  ParameterSet const* vMaxEventsOut = 0;
459  std::vector<std::string> intNamesE = maxEventsPSet.getParameterNamesForType<int>(false);
460  if (search_all(intNamesE, output)) {
461  maxEventsOut = maxEventsPSet.getUntrackedParameter<int>(output);
462  ++maxEventSpecs;
463  }
464  std::vector<std::string> psetNamesE;
465  maxEventsPSet.getParameterSetNames(psetNamesE, false);
466  if (search_all(psetNamesE, output)) {
467  vMaxEventsOut = &maxEventsPSet.getUntrackedParameterSet(output);
468  ++maxEventSpecs;
469  }
470 
471  if (maxEventSpecs > 1) {
473  "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
474  }
475 
476  for (auto c : all_output_communicators_) {
477  OutputModuleDescription desc(branchIDLists, maxEventsOut);
478  if (vMaxEventsOut != 0 && !vMaxEventsOut->empty()) {
479  std::string const& moduleLabel = c->description().moduleLabel();
480  try {
481  desc.maxEvents_ = vMaxEventsOut->getUntrackedParameter<int>(moduleLabel);
482  } catch (Exception const&) {
484  "\nNo entry in 'maxEvents' for output module label '" << moduleLabel << "'.\n";
485  }
486  }
487  c->configure(desc);
488  }
489  }
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:46
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:246
void edm::Schedule::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

Definition at line 957 of file Schedule.cc.

References streamSchedules_.

Referenced by edm::ScheduleInfo::modulesInPath().

958  {
959  streamSchedules_[0]->modulesInPath(iPathLabel,oLabelsToFill);
960  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
void edm::Schedule::openNewOutputFilesIfNeeded ( )

Definition at line 859 of file Schedule.cc.

References all_output_communicators_, edm::for_all(), and edm::OutputModuleCommunicator::openNewFileIfNeeded().

859  {
861  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
virtual void openNewFileIfNeeded()=0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:246
void edm::Schedule::openOutputFiles ( FileBlock fb)

Definition at line 863 of file Schedule.cc.

References all_output_communicators_, edm::for_all(), and edm::OutputModuleCommunicator::openFile().

863  {
865  }
virtual void openFile(FileBlock const &fb)=0
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:246
void edm::Schedule::postForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)

Definition at line 907 of file Schedule.cc.

References allWorkers(), edm::for_all(), and edm::Worker::postForkReacquireResources().

907  {
908  for_all(allWorkers(), boost::bind(&Worker::postForkReacquireResources, _1, iChildIndex, iNumberOfChildren));
909  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:947
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
Definition: Worker.h:90
void edm::Schedule::preForkReleaseResources ( )

Definition at line 904 of file Schedule.cc.

References allWorkers(), edm::for_all(), and edm::Worker::preForkReleaseResources().

904  {
905  for_all(allWorkers(), boost::bind(&Worker::preForkReleaseResources, _1));
906  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:947
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void preForkReleaseResources()
Definition: Worker.h:89
template<typename T >
void edm::Schedule::processOneEvent ( unsigned int  iStreamID,
typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 257 of file Schedule.h.

References streamSchedules_.

260  {
261  assert(iStreamID<streamSchedules_.size());
262  streamSchedules_[iStreamID]->processOneEvent<T>(ep,es,cleaningUpAfterException);
263  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
long double T
template<typename T >
void edm::Schedule::processOneGlobal ( typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 275 of file Schedule.h.

References globalSchedule_.

277  {
278  globalSchedule_->processOneGlobal<T>(ep,es,cleaningUpAfterException);
279  }
std::unique_ptr< GlobalSchedule > globalSchedule_
Definition: Schedule.h:244
long double T
template<typename T >
void edm::Schedule::processOneStream ( unsigned int  iStreamID,
typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 266 of file Schedule.h.

References streamSchedules_.

269  {
270  assert(iStreamID<streamSchedules_.size());
271  streamSchedules_[iStreamID]->processOneStream<T>(ep,es,cleaningUpAfterException);
272  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
long double T
void edm::Schedule::respondToCloseInputFile ( FileBlock const &  fb)

Definition at line 886 of file Schedule.cc.

References allWorkers(), edm::for_all(), and edm::Worker::respondToCloseInputFile().

886  {
887  for_all(allWorkers(), boost::bind(&Worker::respondToCloseInputFile, _1, boost::cref(fb)));
888  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:947
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:87
void edm::Schedule::respondToOpenInputFile ( FileBlock const &  fb)

Definition at line 882 of file Schedule.cc.

References allWorkers(), edm::for_all(), and edm::Worker::respondToOpenInputFile().

882  {
883  for_all(allWorkers(), boost::bind(&Worker::respondToOpenInputFile, _1, boost::cref(fb)));
884  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:947
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:86
bool edm::Schedule::shouldWeCloseOutput ( ) const

Definition at line 875 of file Schedule.cc.

References all_output_communicators_, and edm::OutputModuleCommunicator::shouldWeCloseFile().

875  {
876  // Return true iff at least one output module returns true.
877  return (std::find_if (all_output_communicators_.begin(), all_output_communicators_.end(),
879  != all_output_communicators_.end());
880  }
virtual bool shouldWeCloseFile() const =0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:246
bool edm::Schedule::terminate ( void  ) const

Return whether each output module has reached its maximum count.

Definition at line 491 of file Schedule.cc.

References all_output_communicators_, and trackerHits::c.

491  {
492  if (all_output_communicators_.empty()) {
493  return false;
494  }
495  for (auto c : all_output_communicators_) {
496  if (!c->limitReached()) {
497  // Found an output module that has not reached output event count.
498  return false;
499  }
500  }
501  LogInfo("SuccessfulTermination")
502  << "The job is terminating successfully because each output module\n"
503  << "has reached its configured limit.\n";
504  return true;
505  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:246
int edm::Schedule::totalEvents ( ) const

Return the number of events this Schedule has tried to process (inclues both successes and failures, including failures due to exceptions during processing).

Definition at line 996 of file Schedule.cc.

References streamSchedules_.

Referenced by endJob().

996  {
997  int returnValue = 0;
998  for(auto& s: streamSchedules_) {
999  returnValue += s->totalEvents();
1000  }
1001  return returnValue;
1002  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
int edm::Schedule::totalEventsFailed ( ) const

Return the number of events that have not passed any trigger. (N.B. totalEventsFailed() + totalEventsPassed() == totalEvents()

Definition at line 1014 of file Schedule.cc.

References streamSchedules_.

1014  {
1015  int returnValue = 0;
1016  for(auto& s: streamSchedules_) {
1017  returnValue += s->totalEventsFailed();
1018  }
1019  return returnValue;
1020  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
int edm::Schedule::totalEventsPassed ( ) const

Return the number of events which have been passed by one or more trigger paths.

Definition at line 1005 of file Schedule.cc.

References streamSchedules_.

1005  {
1006  int returnValue = 0;
1007  for(auto& s: streamSchedules_) {
1008  returnValue += s->totalEventsPassed();
1009  }
1010  return returnValue;
1011  }
std::vector< std::shared_ptr< StreamSchedule > > streamSchedules_
Definition: Schedule.h:242
void edm::Schedule::writeLumi ( LuminosityBlockPrincipal const &  lbp,
ProcessContext const *  processContext 
)

Definition at line 871 of file Schedule.cc.

References all_output_communicators_, edm::for_all(), and edm::OutputModuleCommunicator::writeLumi().

871  {
872  for_all(all_output_communicators_, boost::bind(&OutputModuleCommunicator::writeLumi, _1, boost::cref(lbp), processContext));
873  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
virtual void writeLumi(LuminosityBlockPrincipal const &lbp, ProcessContext const *)=0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:246
void edm::Schedule::writeRun ( RunPrincipal const &  rp,
ProcessContext const *  processContext 
)

Definition at line 867 of file Schedule.cc.

References all_output_communicators_, edm::for_all(), and edm::OutputModuleCommunicator::writeRun().

867  {
868  for_all(all_output_communicators_, boost::bind(&OutputModuleCommunicator::writeRun, _1, boost::cref(rp), processContext));
869  }
virtual void writeRun(RunPrincipal const &rp, ProcessContext const *)=0
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:246

Member Data Documentation

AllOutputModuleCommunicators edm::Schedule::all_output_communicators_
private
volatile bool edm::Schedule::endpathsAreActive_
private

Definition at line 252 of file Schedule.h.

Referenced by enableEndPaths(), and endPathsEnabled().

std::unique_ptr<GlobalSchedule> edm::Schedule::globalSchedule_
private

Definition at line 244 of file Schedule.h.

Referenced by allWorkers(), beginJob(), changeModule(), endJob(), and processOneGlobal().

boost::shared_ptr<ModuleRegistry> edm::Schedule::moduleRegistry_
private

Definition at line 241 of file Schedule.h.

Referenced by changeModule().

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 247 of file Schedule.h.

Referenced by changeModule().

std::shared_ptr<TriggerResultInserter> edm::Schedule::resultsInserter_
private

Definition at line 240 of file Schedule.h.

std::vector<std::shared_ptr<StreamSchedule> > edm::Schedule::streamSchedules_
private
bool edm::Schedule::wantSummary_
private

Definition at line 250 of file Schedule.h.

Referenced by endJob().