Skip to content

Commit 1b41c53

Browse files
committed
TPC: Fix potential problem in multi-threaded cluster decoding with dynamic OMP
1 parent 997c963 commit 1b41c53

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

GPU/GPUTracking/DataCompression/TPCClusterDecompressor.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ int TPCClusterDecompressor::decompress(const CompressedClusters* clustersCompres
4848
const unsigned int maxTime = (param.par.continuousMaxTimeBin + 1) * ClusterNative::scaleTimePacked - 1;
4949
GPUCA_OPENMP(parallel for firstprivate(offset, lasti))
5050
for (unsigned int i = 0; i < clustersCompressed->nTracks; i++) {
51+
if (i < lasti) {
52+
offset = lasti = 0; // dynamic OMP scheduling, need to reinitialize offset
53+
}
5154
while (lasti < i) {
5255
offset += clustersCompressed->nTrackClusters[lasti++];
5356
}

0 commit comments

Comments
 (0)