Skip to content

Commit 0c70cd3

Browse files
committed
GPU: Bugfix: buffer size corrections must be performed before clusterization, to affect also buffers of clusterizer
1 parent eff9877 commit 0c70cd3

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,16 @@ int GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
378378
mRec->SetNOMPThreads(mRec->MemoryScalers()->nTPCdigits / 20000);
379379
}
380380

381+
mRec->MemoryScalers()->nTPCHits = mRec->MemoryScalers()->NTPCClusters(mRec->MemoryScalers()->nTPCdigits);
382+
if (mIOPtrs.settingsTF && mIOPtrs.settingsTF->hasNHBFPerTF) {
383+
unsigned int nHitsBase = mRec->MemoryScalers()->nTPCHits;
384+
unsigned int threshold = 30000000 * mIOPtrs.settingsTF->nHBFPerTF / 256;
385+
mRec->MemoryScalers()->nTPCHits = std::max<unsigned int>(nHitsBase, std::min<unsigned int>(threshold, nHitsBase * 3)); // Increase the buffer size for low occupancy data to compensate for noisy pads creating exceiive clusters
386+
if (nHitsBase < threshold) {
387+
float maxFactor = mRec->MemoryScalers()->nTPCHits < threshold ? 2.0 : 1.5;
388+
mRec->MemoryScalers()->temporaryFactor *= std::min(maxFactor, (float)threshold / nHitsBase);
389+
}
390+
}
381391
for (unsigned int iSlice = 0; iSlice < NSLICES; iSlice++) {
382392
processors()->tpcClusterer[iSlice].SetMaxData(mIOPtrs); // First iteration to set data sizes
383393
}
@@ -411,14 +421,6 @@ int GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
411421
}
412422
bool buildNativeGPU = (mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCConversion) || (mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCSliceTracking) || (mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCMerging) || (mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCCompression);
413423
bool buildNativeHost = mRec->GetRecoStepsOutputs() & GPUDataTypes::InOutType::TPCClusters; // TODO: Should do this also when clusters are needed for later steps on the host but not requested as output
414-
mRec->MemoryScalers()->nTPCHits = mRec->MemoryScalers()->NTPCClusters(mRec->MemoryScalers()->nTPCdigits);
415-
if (mIOPtrs.settingsTF && mIOPtrs.settingsTF->hasNHBFPerTF) {
416-
unsigned int threshold = 20000000 * mIOPtrs.settingsTF->nHBFPerTF / 256;
417-
mRec->MemoryScalers()->nTPCHits = std::max<unsigned int>(mRec->MemoryScalers()->nTPCHits, std::min<unsigned int>(threshold, mRec->MemoryScalers()->nTPCHits * 3)); // Increase the buffer size for low occupancy data to compensate for noisy pads creating exceiive clusters
418-
if (mRec->MemoryScalers()->nTPCHits < threshold) {
419-
mRec->MemoryScalers()->temporaryFactor *= std::min(1.5, (double)threshold / mRec->MemoryScalers()->nTPCHits);
420-
}
421-
}
422424

423425
mInputsHost->mNClusterNative = mInputsShadow->mNClusterNative = mRec->MemoryScalers()->nTPCHits;
424426
if (buildNativeGPU) {

0 commit comments

Comments
 (0)