Skip to content

Commit 32cd535

Browse files
committed
ITS: Vertexer tighten condition atomic write path
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent bbe5993 commit 32cd535

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ void VertexerTraits::computeTrackletMatching(const int iteration)
301301
bounded_vector<bool> usedTracklets(mTimeFrame->getFoundTracklets(pivotRofId, 0).size(), false, mMemoryPool.get());
302302
short startROF{std::max((short)0, static_cast<short>(pivotRofId - mVrtParams[iteration].deltaRof))};
303303
short endROF{std::min(static_cast<short>(mTimeFrame->getNrof()), static_cast<short>(pivotRofId + mVrtParams[iteration].deltaRof + 1))};
304+
305+
// needed only if multi-threaded using deltaRof and only at the overlap edges of the ranges
306+
bool safeWrite = mTaskArena->max_concurrency() > 1 && mVrtParams[iteration].deltaRof != 0 && ((Rofs.begin() - startROF < 0) || (endROF - Rofs.end() > 0));
307+
304308
for (short targetRofId0 = startROF; targetRofId0 < endROF; ++targetRofId0) {
305309
for (short targetRofId2 = startROF; targetRofId2 < endROF; ++targetRofId2) {
306310
if (std::abs(targetRofId0 - targetRofId2) > mVrtParams[iteration].deltaRof) { // do not allow over 3 ROFs
@@ -321,7 +325,7 @@ void VertexerTraits::computeTrackletMatching(const int iteration)
321325
mTimeFrame->getLinesLabel(pivotRofId),
322326
targetRofId0,
323327
targetRofId2,
324-
mTaskArena->max_concurrency() > 1 && mVrtParams[iteration].deltaRof != 0,
328+
safeWrite,
325329
mVrtParams[iteration].tanLambdaCut,
326330
mVrtParams[iteration].phiCut);
327331
}

0 commit comments

Comments
 (0)