Skip to content

Commit 1613dfd

Browse files
committed
GPU: Improve debug output
1 parent c573b20 commit 1613dfd

4 files changed

Lines changed: 25 additions & 25 deletions

File tree

GPU/GPUTracking/Global/GPUChainTrackingSliceTracker.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ int GPUChainTracking::RunTPCTrackingSlices_internal()
217217
TransferMemoryResourcesToHost(RecoStep::TPCSliceTracking, &trk, -1, true);
218218
memcpy(trk.LinkTmpMemory(), mRec->Res(trk.MemoryResLinks()).Ptr(), mRec->Res(trk.MemoryResLinks()).Size());
219219
if (GetProcessingSettings().debugMask & 2) {
220-
trk.DumpLinks(*mDebugFile);
220+
trk.DumpLinks(*mDebugFile, 0);
221221
}
222222
}
223223

224224
runKernel<GPUTPCNeighboursCleaner>(GetGridBlk(GPUCA_ROW_COUNT - 2, useStream), {iSlice});
225-
DoDebugAndDump(RecoStep::TPCSliceTracking, 4, trk, &GPUTPCTracker::DumpLinks, *mDebugFile);
225+
DoDebugAndDump(RecoStep::TPCSliceTracking, 4, trk, &GPUTPCTracker::DumpLinks, *mDebugFile, 1);
226226

227227
runKernel<GPUTPCStartHitsFinder>(GetGridBlk(GPUCA_ROW_COUNT - 6, useStream), {iSlice});
228228
#ifdef GPUCA_SORT_STARTHITS_GPU

GPU/GPUTracking/SliceTracker/GPUTPCTracker.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ class GPUTPCTracker : public GPUProcessor
6363
void WriteOutput();
6464

6565
// Debugging Stuff
66-
void DumpSliceData(std::ostream& out); // Dump Input Slice Data
67-
void DumpLinks(std::ostream& out); // Dump all links to file (for comparison after NeighboursFinder/Cleaner)
68-
void DumpStartHits(std::ostream& out); // Same for Start Hits
69-
void DumpHitWeights(std::ostream& out); //....
70-
void DumpTrackHits(std::ostream& out); // Same for Track Hits
71-
void DumpTrackletHits(std::ostream& out); // Same for Track Hits
72-
void DumpOutput(std::ostream& out); // Similar for output
66+
void DumpSliceData(std::ostream& out); // Dump Input Slice Data
67+
void DumpLinks(std::ostream& out, int phase); // Dump all links to file (for comparison after NeighboursFinder/Cleaner)
68+
void DumpStartHits(std::ostream& out); // Same for Start Hits
69+
void DumpHitWeights(std::ostream& out); //....
70+
void DumpTrackHits(std::ostream& out); // Same for Track Hits
71+
void DumpTrackletHits(std::ostream& out); // Same for Track Hits
72+
void DumpOutput(std::ostream& out); // Similar for output
7373
#endif
7474

7575
struct StructGPUParameters {

GPU/GPUTracking/SliceTracker/GPUTPCTrackerDump.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ using namespace GPUCA_NAMESPACE::gpu;
2828
void GPUTPCTracker::DumpOutput(std::ostream& out)
2929
{
3030
if (Param().par.earlyTpcTransform) {
31-
out << "Slice " << mISlice << "\n";
31+
out << "\nSlice " << mISlice << "\n";
3232
const GPUTPCTrack* track = (Output())->GetFirstTrack();
3333
for (unsigned int j = 0; j < (Output())->NTracks(); j++) {
3434
out << "Track " << j << " (" << track->NHits() << "): ";
@@ -44,7 +44,7 @@ void GPUTPCTracker::DumpOutput(std::ostream& out)
4444
void GPUTPCTracker::DumpSliceData(std::ostream& out)
4545
{
4646
// Dump Slice Input Data to File
47-
out << "Slice Data (Slice" << mISlice << "):" << std::endl;
47+
out << "\nSlice Data (Slice" << mISlice << "):" << std::endl;
4848
for (int i = 0; i < GPUCA_ROW_COUNT; i++) {
4949
if (Row(i).NHits() == 0) {
5050
continue;
@@ -60,10 +60,10 @@ void GPUTPCTracker::DumpSliceData(std::ostream& out)
6060
}
6161
}
6262

63-
void GPUTPCTracker::DumpLinks(std::ostream& out)
63+
void GPUTPCTracker::DumpLinks(std::ostream& out, int phase)
6464
{
6565
// Dump Links (after Neighbours Finder / Cleaner) to file
66-
out << "Hit Links(Slice" << mISlice << "):" << std::endl;
66+
out << "\nHit Links (Phase " << phase << ", Slice" << mISlice << "):" << std::endl;
6767
for (int i = 0; i < GPUCA_ROW_COUNT; i++) {
6868
if (Row(i).NHits() == 0) {
6969
continue;
@@ -82,7 +82,7 @@ void GPUTPCTracker::DumpLinks(std::ostream& out)
8282
void GPUTPCTracker::DumpHitWeights(std::ostream& out)
8383
{
8484
// dump hit weights to file
85-
out << "Hit Weights(Slice" << mISlice << "):" << std::endl;
85+
out << "\nHit Weights(Slice" << mISlice << "):" << std::endl;
8686
for (int i = 0; i < GPUCA_ROW_COUNT; i++) {
8787
if (Row(i).NHits() == 0) {
8888
continue;
@@ -113,7 +113,7 @@ int GPUTPCTracker::StarthitSortComparison(const void* a, const void* b)
113113
void GPUTPCTracker::DumpStartHits(std::ostream& out)
114114
{
115115
// sort start hits and dump to file
116-
out << "Start Hits: (Slice" << mISlice << ") (" << *NStartHits() << ")" << std::endl;
116+
out << "\nStart Hits: (Slice" << mISlice << ") (" << *NStartHits() << ")" << std::endl;
117117
if (mRec->GetProcessingSettings().comparableDebutOutput) {
118118
qsort(TrackletStartHits(), *NStartHits(), sizeof(GPUTPCHitId), StarthitSortComparison);
119119
}
@@ -126,7 +126,7 @@ void GPUTPCTracker::DumpStartHits(std::ostream& out)
126126
void GPUTPCTracker::DumpTrackHits(std::ostream& out)
127127
{
128128
// dump tracks to file
129-
out << "Tracks: (Slice" << mISlice << ") (" << *NTracks() << ")" << std::endl;
129+
out << "\nTracks: (Slice" << mISlice << ") (" << *NTracks() << ")" << std::endl;
130130
for (int k = 0; k < GPUCA_ROW_COUNT; k++) {
131131
for (int l = 0; l < Row(k).NHits(); l++) {
132132
for (unsigned int j = 0; j < *NTracks(); j++) {
@@ -154,7 +154,7 @@ void GPUTPCTracker::DumpTrackletHits(std::ostream& out)
154154
if (nTracklets < 0) {
155155
nTracklets = 0;
156156
}
157-
out << "Tracklets: (Slice" << mISlice << ") (" << nTracklets << ")" << std::endl;
157+
out << "\nTracklets: (Slice" << mISlice << ") (" << nTracklets << ")" << std::endl;
158158
std::vector<int> Ids(nTracklets);
159159
std::iota(Ids.begin(), Ids.end(), 0);
160160
if (mRec->GetProcessingSettings().comparableDebutOutput) {

GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinderDump.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ using namespace GPUCA_NAMESPACE::gpu::tpccf;
2121

2222
void GPUTPCClusterFinder::DumpDigits(std::ostream& out)
2323
{
24-
out << "Clusterer - Digits - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << ": " << mPmemory->counters.nPositions << "\n";
24+
out << "\nClusterer - Digits - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << ": " << mPmemory->counters.nPositions << "\n";
2525
for (size_t i = 0; i < mPmemory->counters.nPositions; i++) {
2626
out << i << ": " << mPpositions[i].time() << ", " << (int)mPpositions[i].pad() << ", " << (int)mPpositions[i].row() << "\n";
2727
}
2828
}
2929

3030
void GPUTPCClusterFinder::DumpChargeMap(std::ostream& out, std::string_view title)
3131
{
32-
out << "Clusterer - " << title << " - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << "\n";
32+
out << "\nClusterer - " << title << " - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << "\n";
3333
Array2D<ushort> map(mPchargeMap);
3434

3535
for (TPCFragmentTime i = 0; i < TPC_MAX_FRAGMENT_LEN_PADDED; i++) {
@@ -56,7 +56,7 @@ void GPUTPCClusterFinder::DumpChargeMap(std::ostream& out, std::string_view titl
5656

5757
void GPUTPCClusterFinder::DumpPeaks(std::ostream& out)
5858
{
59-
out << "Clusterer - Peaks - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << "\n";
59+
out << "\nClusterer - Peaks - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << "\n";
6060
for (unsigned int i = 0; i < mPmemory->counters.nPositions; i++) {
6161
out << (int)mPisPeak[i] << " ";
6262
if ((i + 1) % 100 == 0) {
@@ -68,15 +68,15 @@ void GPUTPCClusterFinder::DumpPeaks(std::ostream& out)
6868

6969
void GPUTPCClusterFinder::DumpPeaksCompacted(std::ostream& out)
7070
{
71-
out << "Clusterer - Compacted Peaks - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << ": " << mPmemory->counters.nPeaks << "\n";
71+
out << "\nClusterer - Compacted Peaks - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << ": " << mPmemory->counters.nPeaks << "\n";
7272
for (size_t i = 0; i < mPmemory->counters.nPeaks; i++) {
7373
out << i << ": " << mPpeakPositions[i].time() << ", " << (int)mPpeakPositions[i].pad() << ", " << (int)mPpeakPositions[i].row() << "\n";
7474
}
7575
}
7676

7777
void GPUTPCClusterFinder::DumpSuppressedPeaks(std::ostream& out)
7878
{
79-
out << "Clusterer - NoiseSuppression - Slice "
79+
out << "\nClusterer - NoiseSuppression - Slice "
8080
<< " - Fragment " << mPmemory->fragment.index << mISlice << "\n";
8181
for (unsigned int i = 0; i < mPmemory->counters.nPeaks; i++) {
8282
out << (int)mPisPeak[i] << " ";
@@ -89,23 +89,23 @@ void GPUTPCClusterFinder::DumpSuppressedPeaks(std::ostream& out)
8989

9090
void GPUTPCClusterFinder::DumpSuppressedPeaksCompacted(std::ostream& out)
9191
{
92-
out << "Clusterer - Noise Suppression Peaks Compacted - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << ": " << mPmemory->counters.nClusters << "\n";
92+
out << "\nClusterer - Noise Suppression Peaks Compacted - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << ": " << mPmemory->counters.nClusters << "\n";
9393
for (size_t i = 0; i < mPmemory->counters.nClusters; i++) {
9494
out << i << ": " << mPfilteredPeakPositions[i].time() << ", " << (int)mPfilteredPeakPositions[i].pad() << ", " << (int)mPfilteredPeakPositions[i].row() << "\n";
9595
}
9696
}
9797

9898
void GPUTPCClusterFinder::DumpCountedPeaks(std::ostream& out)
9999
{
100-
out << "Clusterer - Peak Counts - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << "\n";
100+
out << "\nClusterer - Peak Counts - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << "\n";
101101
for (int i = 0; i < GPUCA_ROW_COUNT; i++) {
102102
out << i << ": " << mPclusterInRow[i] << "\n";
103103
}
104104
}
105105

106106
void GPUTPCClusterFinder::DumpClusters(std::ostream& out)
107107
{
108-
out << "Clusterer - Clusters - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << "\n";
108+
out << "\nClusterer - Clusters - Slice " << mISlice << " - Fragment " << mPmemory->fragment.index << "\n";
109109

110110
for (int i = 0; i < GPUCA_ROW_COUNT; i++) {
111111
size_t N = mPclusterInRow[i];

0 commit comments

Comments
 (0)