Skip to content

Commit 702278a

Browse files
committed
ITS: add total/avg summary + remove some headers
1 parent d07bf78 commit 702278a

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TimeFrameGPU.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,13 @@
1515

1616
#include "ITStracking/TimeFrame.h"
1717
#include "ITStracking/Configuration.h"
18-
19-
#include "ITStrackingGPU/ClusterLinesGPU.h"
2018
#include "ITStrackingGPU/Utils.h"
2119

2220
#include <gsl/gsl>
2321

24-
namespace o2
25-
{
26-
namespace its
27-
{
28-
namespace gpu
22+
namespace o2::its::gpu
2923
{
24+
3025
class Stream;
3126

3227
class DefaultGPUAllocator : public ExternalAllocator
@@ -228,7 +223,6 @@ inline int TimeFrameGPU<nLayers>::getNumberOfCells() const
228223
return std::accumulate(mNCells.begin(), mNCells.end(), 0);
229224
}
230225

231-
} // namespace gpu
232-
} // namespace its
233-
} // namespace o2
226+
} // namespace o2::its::gpu
227+
234228
#endif

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Tracker.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class Tracker
9494

9595
unsigned int mNumberOfDroppedTFs{0};
9696
unsigned int mTimeFrameCounter{0};
97+
double mTotalTime{0};
9798
};
9899

99100
inline void Tracker::setParameters(const std::vector<TrackingParameters>& trkPars)

Detectors/ITSMFT/ITS/tracking/src/Tracker.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void Tracker::clustersToTracks(LogFunc logger, LogFunc error)
113113
} while (iVertex < maxNvertices && !dropTF);
114114
logger(std::format(" - Tracklet finding: {} tracklets found in {:.2f} ms", nTracklets, timeTracklets));
115115
logger(std::format(" - Cell finding: {} cells found in {:.2f} ms", nCells, timeCells));
116-
logger(std::format(" - Meighbours finding: {} neighbours found in {:.2f} ms", nNeighbours, timeNeighbours));
116+
logger(std::format(" - Neighbours finding: {} neighbours found in {:.2f} ms", nNeighbours, timeNeighbours));
117117
logger(std::format(" - Track finding: {} tracks found in {:.2f} ms", nTracks + mTimeFrame->getNumberOfTracks(), timeRoads));
118118
total += timeTracklets + timeCells + timeNeighbours + timeRoads;
119119
if (mTraits->supportsExtendTracks() && mTrkParams[iteration].UseTrackFollower && !dropTF) {
@@ -138,14 +138,15 @@ void Tracker::clustersToTracks(LogFunc logger, LogFunc error)
138138
}
139139

140140
if constexpr (constants::DoTimeBenchmarks) {
141-
logger(std::format("=== TimeFrame {} processing completed in: {:.2f} ms using {} threads ===", mTimeFrameCounter, total, mTraits->getNThreads()));
141+
logger(std::format("=== TimeFrame {} processing completed in: {:.2f} ms using {} thread(s) ===", mTimeFrameCounter, total, mTraits->getNThreads()));
142142
}
143143

144144
if (mTimeFrame->hasMCinformation()) {
145145
computeTracksMClabels();
146146
}
147147
rectifyClusterIndices();
148148
++mTimeFrameCounter;
149+
mTotalTime += total;
149150
}
150151

151152
void Tracker::initialiseTimeFrame(int& iteration)
@@ -459,7 +460,7 @@ int Tracker::getNThreads() const
459460

460461
void Tracker::printSummary() const
461462
{
462-
LOGP(info, "Tracker summary: Processed {} TFs (dropped {})", mTimeFrameCounter, mNumberOfDroppedTFs);
463+
LOGP(info, "Tracker summary: Processed {} TFs (dropped {}) in TOT={:.2f} s, AVG/TF={:.2f} s", mTimeFrameCounter, mNumberOfDroppedTFs, mTotalTime * 1.e-3, mTotalTime * 1.e-3 / ((mTimeFrameCounter > 0) ? (double)mTimeFrameCounter : -1.0));
463464
}
464465

465466
} // namespace its

Detectors/ITSMFT/ITS/tracking/src/TrackerTraits.cxx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
#include <cassert>
2020
#include <iostream>
2121

22-
#include <fmt/format.h>
22+
#ifdef OPTIMISATION_OUTPUT
23+
#include <format>
24+
#endif
2325

2426
#include "CommonConstants/MathConstants.h"
2527
#include "DetectorsBase/Propagator.h"
@@ -38,7 +40,7 @@ using o2::base::PropagatorF;
3840

3941
namespace
4042
{
41-
float Sq(float q)
43+
inline float Sq(float q)
4244
{
4345
return q * q;
4446
}
@@ -57,7 +59,7 @@ void TrackerTraits::computeLayerTracklets(const int iteration, int iROFslice, in
5759

5860
#ifdef OPTIMISATION_OUTPUT
5961
static int iter{0};
60-
std::ofstream off(fmt::format("tracklets{}.txt", iter++));
62+
std::ofstream off(std::format("tracklets{}.txt", iter++));
6163
#endif
6264

6365
for (int iLayer = 0; iLayer < mTrkParams[iteration].TrackletsPerRoad(); ++iLayer) {
@@ -173,7 +175,7 @@ void TrackerTraits::computeLayerTracklets(const int iteration, int iROFslice, in
173175
break;
174176
}
175177
}
176-
off << fmt::format("{}\t{:d}\t{}\t{}\t{}\t{}", iLayer, label.isValid(), (tanLambda * (nextCluster.radius - currentCluster.radius) + currentCluster.zCoordinate - nextCluster.zCoordinate) / sigmaZ, tanLambda, resolution, sigmaZ) << std::endl;
178+
off << std::format("{}\t{:d}\t{}\t{}\t{}\t{}", iLayer, label.isValid(), (tanLambda * (nextCluster.radius - currentCluster.radius) + currentCluster.zCoordinate - nextCluster.zCoordinate) / sigmaZ, tanLambda, resolution, sigmaZ) << std::endl;
177179
#endif
178180

179181
if (deltaZ / sigmaZ < mTrkParams[iteration].NSigmaCut &&
@@ -270,7 +272,7 @@ void TrackerTraits::computeLayerCells(const int iteration)
270272
{
271273
#ifdef OPTIMISATION_OUTPUT
272274
static int iter{0};
273-
std::ofstream off(fmt::format("cells{}.txt", iter++));
275+
std::ofstream off(std::format("cells{}.txt", iter++));
274276
#endif
275277

276278
for (int iLayer = 0; iLayer < mTrkParams[iteration].CellsPerRoad(); ++iLayer) {
@@ -318,7 +320,7 @@ void TrackerTraits::computeLayerCells(const int iteration)
318320
#ifdef OPTIMISATION_OUTPUT
319321
bool good{tf->getTrackletsLabel(iLayer)[iTracklet] == tf->getTrackletsLabel(iLayer + 1)[iNextTracklet]};
320322
float signedDelta{currentTracklet.tanLambda - nextTracklet.tanLambda};
321-
off << fmt::format("{}\t{:d}\t{}\t{}\t{}\t{}", iLayer, good, signedDelta, signedDelta / (mTrkParams[iteration].CellDeltaTanLambdaSigma), tanLambda, resolution) << std::endl;
323+
off << std::format("{}\t{:d}\t{}\t{}\t{}\t{}", iLayer, good, signedDelta, signedDelta / (mTrkParams[iteration].CellDeltaTanLambdaSigma), tanLambda, resolution) << std::endl;
322324
#endif
323325

324326
if (deltaTanLambda / mTrkParams[iteration].CellDeltaTanLambdaSigma < mTrkParams[iteration].NSigmaCut) {
@@ -402,7 +404,7 @@ void TrackerTraits::computeLayerCells(const int iteration)
402404
void TrackerTraits::findCellsNeighbours(const int iteration)
403405
{
404406
#ifdef OPTIMISATION_OUTPUT
405-
std::ofstream off(fmt::format("cellneighs{}.txt", iteration));
407+
std::ofstream off(std::format("cellneighs{}.txt", iteration));
406408
#endif
407409
for (int iLayer{0}; iLayer < mTrkParams[iteration].CellsPerRoad() - 1; ++iLayer) {
408410
const int nextLayerCellsNum{static_cast<int>(mTimeFrame->getCells()[iLayer + 1].size())};
@@ -439,7 +441,7 @@ void TrackerTraits::findCellsNeighbours(const int iteration)
439441

440442
#ifdef OPTIMISATION_OUTPUT
441443
bool good{mTimeFrame->getCellsLabel(iLayer)[iCell] == mTimeFrame->getCellsLabel(iLayer + 1)[iNextCell]};
442-
off << fmt::format("{}\t{:d}\t{}", iLayer, good, chi2) << std::endl;
444+
off << std::format("{}\t{:d}\t{}", iLayer, good, chi2) << std::endl;
443445
#endif
444446

445447
if (chi2 > mTrkParams[0].MaxChi2ClusterAttachment) {
@@ -469,6 +471,7 @@ void TrackerTraits::findCellsNeighbours(const int iteration)
469471

470472
void TrackerTraits::processNeighbours(int iLayer, int iLevel, const std::vector<CellSeed>& currentCellSeed, const std::vector<int>& currentCellId, std::vector<CellSeed>& updatedCellSeeds, std::vector<int>& updatedCellsIds)
471473
{
474+
bool print = iLayer == 3 && iLevel == 2;
472475
if (iLevel < 2 || iLayer < 1) {
473476
std::cout << "Error: layer " << iLayer << " or level " << iLevel << " cannot be processed by processNeighbours" << std::endl;
474477
exit(1);

0 commit comments

Comments
 (0)