42 std::vector<const ModuleDescription*>
const& iModules,
44 m_streamEventTimer(iNumStreams),
45 m_streamPathTiming(iNumStreams),
53 return iLHS->
id() < iRHS->id();
60 stream.resize(numModuleSlots);
65 std::vector<unsigned int> numModulesInPath;
66 std::vector<unsigned int> numModulesInEndPath;
68 const unsigned int numPaths = iNamesService.
getTrigPaths().size();
69 const unsigned int numEndPaths = iNamesService.
getEndPaths().size();
78 numModulesInPath.reserve(numPaths);
79 numModulesInEndPath.reserve(numEndPaths);
83 for(
unsigned int i =0;
i<numPaths;++
i) {
87 for(
unsigned int i =0;
i<numEndPaths;++
i) {
95 unsigned int index = 0;
96 stream.resize(numModulesInPath.size()+numModulesInEndPath.size());
97 for(
unsigned int numMods : numModulesInPath) {
98 stream[
index].m_moduleTiming.resize(numMods);
101 for(
unsigned int numMods : numModulesInEndPath) {
102 stream[
index].m_moduleTiming.resize(numMods);
140 timing.m_timer.start();
148 timing.m_timer.stop();
151 auto& modsOnPath = timing.m_moduleTiming;
152 for(
unsigned int i = 0;
i< iStatus.
index()+1;++
i) {
153 ++modsOnPath[
i].m_timesVisited;
176 modTiming.m_realTime +=
times;
190 modTiming.m_realTime +=
times;
215 unsigned int iEndIndex,
216 std::vector<std::string>
const& iPathNames,
217 std::vector<std::vector<std::string>>
const& iModulesOnPaths,
218 std::vector<std::vector<SystemTimeKeeper::PathTiming>>
const& iPathTimings,
219 std::vector<PathTimingSummary>& iSummary) {
220 iSummary.resize(iEndIndex-iStartIndex);
222 for(
auto const& stream: iPathTimings) {
223 auto it = iSummary.begin();
224 for(
unsigned int index = iStartIndex;
index < iEndIndex; ++
index, ++it) {
225 auto const& pathTiming = stream[
index];
226 it->name = iPathNames[
index];
227 it->bitPosition =
index-iStartIndex;
228 if(not pathTiming.m_moduleTiming.empty()) {
229 it->timesRun += pathTiming.m_moduleTiming[0].m_timesVisited;
231 it->realTime += pathTiming.m_timer.realTime();
232 if(it->moduleInPathSummaries.empty()) {
233 it->moduleInPathSummaries.resize(pathTiming.m_moduleTiming.size());
235 for(
unsigned int modIndex=0; modIndex < pathTiming.m_moduleTiming.size(); ++modIndex) {
236 auto const& modTiming =pathTiming.m_moduleTiming[modIndex];
237 auto& modSummary =it->moduleInPathSummaries[modIndex];
238 if(modSummary.moduleLabel.empty()) {
239 modSummary.moduleLabel = iModulesOnPaths[
index][modIndex];
241 modSummary.timesVisited += modTiming.m_timesVisited;
242 modSummary.realTime += modTiming.m_realTime;
252 double sumEventTime = 0.;
254 sumEventTime += stream.realTime();
266 std::map<std::string,unsigned int>
visited;
268 unsigned int pathIndex = 0;
269 for(
auto const&
path: stream) {
270 unsigned int modIndex = 0;
271 for(
auto const&
mod:
path.m_moduleTiming) {
279 unsigned int modIndex=0;
281 auto& outMod =
summary[modIndex];
282 outMod.moduleLabel =
mod->moduleLabel();
283 outMod.realTime = 0.;
287 auto const& timing = stream[moduleId];
288 outMod.realTime += timing.m_timer.realTime();
289 outMod.timesRun += timing.m_timesRun;
291 outMod.timesVisited = visited[
mod->moduleLabel()];
292 if(0 == outMod.timesVisited) {
293 outMod.timesVisited = outMod.timesRun;
std::vector< std::vector< std::string > > m_modulesOnPaths
void fillTriggerTimingReport(TriggerTimingReport &rep) const
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
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 sort_all(RandomAccessSequence &s)
wrappers for std::sort
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