@@ -61,7 +61,7 @@ using namespace o2::gpu;
6161using namespace o2 ::tpc;
6262using namespace o2 ::trd;
6363
64- GPUChainTracking::GPUChainTracking (GPUReconstruction* rec, uint32_t maxTPCHits, uint32_t maxTRDTracklets) : GPUChain(rec), mIOPtrs(processors()->ioPtrs), mInputsHost(new GPUTrackingInputProvider), mInputsShadow(new GPUTrackingInputProvider), mClusterNativeAccess(new ClusterNativeAccess), mTriggerBuffer(new GPUTriggerOutputs), mMaxTPCHits(maxTPCHits), mMaxTRDTracklets(maxTRDTracklets), mDebugFile(new std::ofstream )
64+ GPUChainTracking::GPUChainTracking (GPUReconstruction* rec, uint32_t maxTPCHits, uint32_t maxTRDTracklets) : GPUChain(rec), mIOPtrs(processors()->ioPtrs), mInputsHost(new GPUTrackingInputProvider), mInputsShadow(new GPUTrackingInputProvider), mClusterNativeAccess(new ClusterNativeAccess), mTriggerBuffer(new GPUTriggerOutputs), mMaxTPCHits(maxTPCHits), mMaxTRDTracklets(maxTRDTracklets), mDebugFile(new std::ostream( nullptr ) )
6565{
6666 ClearIOPointers ();
6767 mFlatObjectsShadow .mChainTracking = this ;
@@ -386,7 +386,17 @@ int32_t GPUChainTracking::Init()
386386
387387 if (GetProcessingSettings ().debugLevel >= 6 ) {
388388 std::string filename = std::string (mRec ->IsGPU () ? " GPU" : " CPU" ) + (mRec ->slaveId () != -1 ? (std::string (" _slave" ) + std::to_string (mRec ->slaveId ())) : std::string (mRec ->slavesExist () ? " _master" : " " )) + GetProcessingSettings ().debugLogSuffix + " .out" ;
389- mDebugFile ->open (filename.c_str ());
389+
390+ bool hashOnly = GetProcessingSettings ().debugDumpChecksum ;
391+
392+ std::streambuf* backing = nullptr ;
393+ if (!hashOnly) {
394+ mDebugFileBuffer .open (filename.c_str (), std::ios::out);
395+ backing = &mDebugFileBuffer ;
396+ }
397+
398+ mDebugFileStream = HashStreamBuf (hashOnly, backing);
399+ mDebugFile ->rdbuf (&mDebugFileStream );
390400 if (GetProcessingSettings ().debugFileHexFloat >= 1 || (GetProcessingSettings ().debugFileHexFloat == -1 && GetProcessingSettings ().deterministicGPUReconstruction )) {
391401 *mDebugFile << std::hexfloat;
392402 }
@@ -475,7 +485,12 @@ int32_t GPUChainTracking::Finalize()
475485 GetQA ()->DrawQAHistograms ();
476486 }
477487 if (GetProcessingSettings ().debugLevel >= 6 ) {
478- mDebugFile ->close ();
488+ mDebugFile ->flush ();
489+ mDebugFileBuffer .close ();
490+
491+ if (GetProcessingSettings ().debugDumpChecksum ) {
492+ GPUInfo (" Debug hash: %lX" , mDebugFileStream .hash ());
493+ }
479494 }
480495 if (mCompressionStatistics ) {
481496 mCompressionStatistics ->Finish ();
0 commit comments