Skip to content

Commit fe8a381

Browse files
committed
GPU: Do tfTime extrapolation also for wall time
1 parent 6dcc1dc commit fe8a381

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

GPU/GPUTracking/Base/GPUReconstruction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ class GPUReconstruction
238238
// Support / Debugging
239239
virtual void PrintKernelOccupancies() {}
240240
double GetStatKernelTime() { return mStatKernelTime; }
241+
double GetStatWallTime() { return mStatWallTime; }
241242

242243
protected:
243244
GPUReconstruction(const GPUSettingsProcessing& cfg); // Constructor
@@ -326,6 +327,7 @@ class GPUReconstruction
326327
unsigned int mStatNEvents = 0;
327328
unsigned int mNEventsProcessed = 0;
328329
double mStatKernelTime = 0.;
330+
double mStatWallTime = 0.;
329331

330332
int mMaxThreads = 0; // Maximum number of threads that may be running, on CPU or GPU
331333
int mThreadId = -1; // Thread ID that is valid for the local CUDA context

GPU/GPUTracking/Base/GPUReconstructionCPU.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ int GPUReconstructionCPU::RunChains()
198198
}
199199
timerTotal.Stop();
200200

201+
mStatWallTime = (timerTotal.GetElapsedTime() * 1000000. / mStatNEvents);
201202
if (GetDeviceProcessingSettings().debugLevel >= 1) {
202203
double kernelTotal = 0;
203204
std::vector<double> kernelStepTimes(N_RECO_STEPS);
@@ -254,10 +255,10 @@ int GPUReconstructionCPU::RunChains()
254255
}
255256
}
256257
mStatKernelTime = kernelTotal * 1000000 / mStatNEvents;
257-
printf("Execution Time: Total : %50s Time: %'10d us\n", "Total kernel time", (int)mStatKernelTime);
258-
printf("Execution Time: Total : %50s Time: %'10d us\n", "Total time", (int)(timerTotal.GetElapsedTime() * 1000000. / mStatNEvents));
258+
printf("Execution Time: Total : %50s Time: %'10d us\n", "Total Kernel", (int)mStatKernelTime);
259+
printf("Execution Time: Total : %50s Time: %'10d us\n", "Total Wall", (int)mStatWallTime);
259260
} else if (GetDeviceProcessingSettings().debugLevel >= 0) {
260-
printf("Total Time: %'d us\n", (int)(timerTotal.GetElapsedTime() * 1000000 / mStatNEvents));
261+
printf("Total Wall Time: %'d us\n", (int)mStatWallTime);
261262
}
262263
if (mDeviceProcessingSettings.resetTimers) {
263264
mStatNEvents = 0;

GPU/GPUTracking/Standalone/standalone.cxx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,6 @@ int ReadConfiguration(int argc, char** argv)
201201
printf("Can only produce QA pdf output when input files are specified!\n");
202202
return 1;
203203
}
204-
if (configStandalone.timeFrameTime && configStandalone.DebugLevel == 0) {
205-
printf("tfTime needs debug >= 1 currently\n");
206-
return 1;
207-
}
208204
if (configStandalone.eventDisplay) {
209205
configStandalone.noprompt = 1;
210206
}
@@ -792,15 +788,15 @@ int main(int argc, char** argv)
792788
double nClusters = chainTracking->GetTPCMerger().NMaxClusters();
793789
if (nClusters > 0) {
794790
double nClsPerTF = 550000. * 1138.3;
795-
double timePerTF = rec->GetStatKernelTime() / 1000000. * nClsPerTF / nClusters;
791+
double timePerTF = (configStandalone.DebugLevel ? rec->GetStatKernelTime() : rec->GetStatWallTime()) / 1000000. * nClsPerTF / nClusters;
796792
double nGPUsReq = timePerTF / 0.02277;
797793
char stat[1024];
798794
snprintf(stat, 1024, "Sync phase: %.2f sec per 256 orbit TF, %.1f GPUs required", timePerTF, nGPUsReq);
799795
if (configStandalone.testSyncAsync) {
800-
timePerTF = recAsync->GetStatKernelTime() / 1000000. * nClsPerTF / nClusters;
796+
timePerTF = (configStandalone.DebugLevel ? recAsync->GetStatKernelTime() : recAsync->GetStatWallTime()) / 1000000. * nClsPerTF / nClusters;
801797
snprintf(stat + strlen(stat), 1024 - strlen(stat), " - Async phase: %f sec per TF", timePerTF);
802798
}
803-
printf("%s (Extrapolated from %d clusters to %d)\n", stat, (int)nClusters, (int)nClsPerTF);
799+
printf("%s (Measured %s time - Extrapolated from %d clusters to %d)\n", stat, configStandalone.DebugLevel ? "kernel" : "wall", (int)nClusters, (int)nClsPerTF);
804800
}
805801
}
806802
}

0 commit comments

Comments
 (0)