41 std::vector<const ModuleDescription*>
const& iModules,
43 m_streamEventTimer(iNumStreams),
44 m_streamPathTiming(iNumStreams),
52 return iLHS->
id() < iRHS->id();
59 stream.resize(numModuleSlots);
64 std::vector<unsigned int> numModulesInPath;
65 std::vector<unsigned int> numModulesInEndPath;
67 const unsigned int numPaths = iNamesService.
getTrigPaths().size();
68 const unsigned int numEndPaths = iNamesService.
getEndPaths().size();
77 numModulesInPath.reserve(numPaths);
78 numModulesInEndPath.reserve(numEndPaths);
82 for(
unsigned int i =0;
i<numPaths;++
i) {
86 for(
unsigned int i =0;
i<numEndPaths;++
i) {
94 unsigned int index = 0;
95 stream.resize(numModulesInPath.size()+numModulesInEndPath.size());
96 for(
unsigned int numMods : numModulesInPath) {
100 for(
unsigned int numMods : numModulesInEndPath) {
139 timing.m_timer.start();
147 timing.m_timer.stop();
150 auto& modsOnPath = timing.m_moduleTiming;
151 for(
unsigned int i = 0;
i< iStatus.
index()+1;++
i) {
152 ++modsOnPath[
i].m_timesVisited;
175 modTiming.m_realTime +=
times;
189 modTiming.m_realTime +=
times;
214 unsigned int iEndIndex,
215 std::vector<std::string>
const& iPathNames,
216 std::vector<std::vector<std::string>>
const& iModulesOnPaths,
217 std::vector<std::vector<SystemTimeKeeper::PathTiming>>
const& iPathTimings,
218 std::vector<PathTimingSummary>& iSummary) {
219 iSummary.resize(iEndIndex-iStartIndex);
221 for(
auto const&
stream: iPathTimings) {
222 auto it = iSummary.begin();
223 for(
unsigned int index = iStartIndex;
index < iEndIndex; ++
index, ++it) {
225 it->name = iPathNames[
index];
226 it->bitPosition =
index-iStartIndex;
227 if(not pathTiming.m_moduleTiming.empty()) {
228 it->timesRun += pathTiming.m_moduleTiming[0].m_timesVisited;
230 it->realTime += pathTiming.m_timer.realTime();
231 if(it->moduleInPathSummaries.empty()) {
232 it->moduleInPathSummaries.resize(pathTiming.m_moduleTiming.size());
234 for(
unsigned int modIndex=0; modIndex < pathTiming.m_moduleTiming.size(); ++modIndex) {
235 auto const& modTiming =pathTiming.m_moduleTiming[modIndex];
236 auto& modSummary =it->moduleInPathSummaries[modIndex];
237 if(modSummary.moduleLabel.empty()) {
238 modSummary.moduleLabel = iModulesOnPaths[
index][modIndex];
240 modSummary.timesVisited += modTiming.m_timesVisited;
241 modSummary.realTime += modTiming.m_realTime;
251 double sumEventTime = 0.;
253 sumEventTime +=
stream.realTime();
265 std::map<std::string,unsigned int>
visited;
267 unsigned int pathIndex = 0;
269 unsigned int modIndex = 0;
270 for(
auto const&
mod:
path.m_moduleTiming) {
278 unsigned int modIndex=0;
280 auto& outMod =
summary[modIndex];
281 outMod.moduleLabel =
mod->moduleLabel();
282 outMod.realTime = 0.;
286 auto const& timing =
stream[moduleId];
287 outMod.realTime += timing.m_timer.realTime();
288 outMod.timesRun += timing.m_timesRun;
290 outMod.timesVisited = visited[
mod->moduleLabel()];
291 if(0 == outMod.timesVisited) {
292 outMod.timesVisited = outMod.timesRun;
std::vector< std::vector< std::string > > m_modulesOnPaths
std::vector< PathTimingSummary > endPathSummaries
Strings const & getTrigPathModules(std::string const &name) const
unsigned int m_minModuleID
void stopEvent(StreamContext const &)
void startProcessingLoop()
std::atomic< unsigned int > m_numberOfEvents
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
Strings const & getEndPaths() const
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::vector< ModuleInPathTiming > m_moduleTiming
std::vector< std::vector< ModuleTiming > > m_streamModuleTiming
void stopProcessingLoop()
void startEvent(StreamID)
std::vector< std::string > m_pathNames
Strings const & getEndPathModules(std::string const &name) const
void fillTriggerTimingReport(TriggerTimingReport &rep)
tuple path
else: Piece not in the list, fine.
std::vector< const ModuleDescription * > m_modules
EventTimingSummary eventSummary
ModuleDescription const * moduleDescription() const
static void fillPathSummary(Path const &path, PathSummary &sum)
std::vector< PathTimingSummary > trigPathSummaries
unsigned int pathID() const
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
StreamID const & streamID() const
CPUTimer m_processingLoopTimer
unsigned int value() const
void startPath(StreamContext const &, PathContext const &)
SystemTimeKeeper(unsigned int iNumStreams, std::vector< const ModuleDescription * > const &iModules, service::TriggerNamesService const &iNameService)
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
Strings const & getTrigPaths() const
std::vector< WallclockTimer > m_streamEventTimer
PathTiming & pathTiming(StreamContext const &, PathContext const &)
unsigned int m_endPathOffset
std::vector< WorkerTimingSummary > workerSummaries
T mod(const T &a, const T &b)
PlaceInPathContext const * placeInPathContext() const
std::vector< std::vector< PathTiming > > m_streamPathTiming
tuple size
Write out results.
unsigned int index() const