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_cpuTime +=
times.cpu_;
176 modTiming.m_realTime +=
times.real_;
190 modTiming.m_cpuTime +=
times.cpu_;
191 modTiming.m_realTime +=
times.real_;
205 unsigned int iEndIndex,
206 std::vector<std::string>
const& iPathNames,
207 std::vector<std::vector<std::string>>
const& iModulesOnPaths,
208 std::vector<std::vector<SystemTimeKeeper::PathTiming>>
const& iPathTimings,
209 std::vector<PathTimingSummary>& iSummary) {
210 iSummary.resize(iEndIndex-iStartIndex);
212 for(
auto const&
stream: iPathTimings) {
213 auto it = iSummary.begin();
214 for(
unsigned int index = iStartIndex;
index < iEndIndex; ++
index, ++it) {
216 it->name = iPathNames[
index];
217 it->bitPosition =
index-iStartIndex;
218 if(not pathTiming.m_moduleTiming.empty()) {
219 it->timesRun += pathTiming.m_moduleTiming[0].m_timesVisited;
221 it->realTime += pathTiming.m_timer.realTime();
222 it->cpuTime += pathTiming.m_timer.cpuTime();
223 if(it->moduleInPathSummaries.empty()) {
224 it->moduleInPathSummaries.resize(pathTiming.m_moduleTiming.size());
226 for(
unsigned int modIndex=0; modIndex < pathTiming.m_moduleTiming.size(); ++modIndex) {
227 auto const& modTiming =pathTiming.m_moduleTiming[modIndex];
228 auto& modSummary =it->moduleInPathSummaries[modIndex];
229 if(modSummary.moduleLabel.empty()) {
230 modSummary.moduleLabel = iModulesOnPaths[
index][modIndex];
232 modSummary.timesVisited += modTiming.m_timesVisited;
233 modSummary.realTime += modTiming.m_realTime;
234 modSummary.cpuTime += modTiming.m_cpuTime;
245 double realTime = 0.;
247 realTime +=
stream.realTime();
248 cpuTime +=
stream.cpuTime();
259 std::map<std::string,unsigned int> visited;
261 unsigned int pathIndex = 0;
263 unsigned int modIndex = 0;
264 for(
auto const&
mod:
path.m_moduleTiming) {
272 unsigned int modIndex=0;
274 auto& outMod =
summary[modIndex];
275 outMod.moduleLabel =
mod->moduleLabel();
276 outMod.realTime = 0.;
281 auto const& timing =
stream[moduleId];
282 outMod.realTime += timing.m_timer.realTime();
283 outMod.cpuTime += timing.m_timer.cpuTime();
284 outMod.timesRun += timing.m_timesRun;
286 outMod.timesVisited = visited[
mod->moduleLabel()];
287 if(0 == outMod.timesVisited) {
288 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 &)
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
std::vector< CPUTimer > m_streamEventTimer
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
unsigned int offset(bool)
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
StreamID const & streamID() const
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
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