42 std::vector<const ModuleDescription*>
const& iModules,
45 : m_streamEventTimer(iNumStreams),
46 m_streamPathTiming(iNumStreams),
48 m_processContext(iProcessContext),
53 return iLHS->
id() < iRHS->id();
60 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();
73 numModulesInPath.reserve(numPaths);
74 numModulesInEndPath.reserve(numEndPaths);
78 for (
unsigned int i = 0;
i < numPaths; ++
i) {
82 for (
unsigned int i = 0;
i < numEndPaths; ++
i) {
90 unsigned int index = 0;
91 stream.resize(numModulesInPath.size() + numModulesInEndPath.size());
92 for (
unsigned int numMods : numModulesInPath) {
96 for (
unsigned int numMods : numModulesInEndPath) {
146 auto& modsOnPath =
timing.m_moduleTiming;
147 for (
unsigned int i = 0;
i < iStatus.
index() + 1; ++
i) {
148 ++modsOnPath[
i].m_timesVisited;
163 auto times =
mod.m_timer.stop();
169 modTiming.m_realTime += times;
176 auto times =
mod.m_timer.stop();
182 modTiming.m_realTime += times;
198 unsigned int iEndIndex,
199 std::vector<std::string>
const& iPathNames,
200 std::vector<std::vector<std::string>>
const& iModulesOnPaths,
201 std::vector<std::vector<SystemTimeKeeper::PathTiming>>
const& iPathTimings,
202 std::vector<PathTimingSummary>& iSummary) {
203 iSummary.resize(iEndIndex - iStartIndex);
205 for (
auto const&
stream : iPathTimings) {
206 auto it = iSummary.begin();
207 for (
unsigned int index = iStartIndex;
index < iEndIndex; ++
index, ++it) {
209 it->name = iPathNames[
index];
210 it->bitPosition =
index - iStartIndex;
211 if (not pathTiming.m_moduleTiming.empty()) {
212 it->timesRun += pathTiming.m_moduleTiming[0].m_timesVisited;
214 it->realTime += pathTiming.m_timer.realTime();
215 if (it->moduleInPathSummaries.empty()) {
216 it->moduleInPathSummaries.resize(pathTiming.m_moduleTiming.size());
218 for (
unsigned int modIndex = 0; modIndex < pathTiming.m_moduleTiming.size(); ++modIndex) {
219 auto const& modTiming = pathTiming.m_moduleTiming[modIndex];
220 auto& modSummary = it->moduleInPathSummaries[modIndex];
221 if (modSummary.moduleLabel.empty()) {
222 modSummary.moduleLabel = iModulesOnPaths[
index][modIndex];
224 modSummary.timesVisited += modTiming.m_timesVisited;
225 modSummary.realTime += modTiming.m_realTime;
234 double sumEventTime = 0.;
236 sumEventTime +=
stream.realTime();
240 rep.eventSummary.sumStreamRealTime = sumEventTime;
248 std::map<std::string, unsigned int>
visited;
250 unsigned int pathIndex = 0;
252 unsigned int modIndex = 0;
253 for (
auto const&
mod :
path.m_moduleTiming) {
261 unsigned int modIndex = 0;
263 auto& outMod =
summary[modIndex];
264 outMod.moduleLabel =
mod->moduleLabel();
265 outMod.realTime = 0.;
270 outMod.realTime +=
timing.m_timer.realTime();
271 outMod.timesRun +=
timing.m_timesRun;
273 outMod.timesVisited =
visited[
mod->moduleLabel()];
274 if (0 == outMod.timesVisited) {
275 outMod.timesVisited = outMod.timesRun;
290 rep.endPathSummaries);