fix: A bug in the Triplet finding algorithm #1025
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As we found out with @krasznaa, there was a bug in the current implementation of the Sycl Seedfinder algorithm. It came out in a particular case when the first part of the algorithm - the
Duplet finding
, didn't find any duplets. In this scenario, theTriplet finding
was running forever and the code didn't terminate.The problem appeared inside the
loop
of theTriplet finding
.In the current implementation, finding triplets is splitted into several parts to limit the memory allocations on the GPU. The range of the particular iteration is taken from the
firstMiddle
andlastMiddle
indices. The current logic follows somewhat those steps:Currently, the increment of the
lastMiddle
index is performed under the condition. This condition is not satisfied if there are 0 Duplets found and therefore bothfirstMiddle
andlastMiddle
stay always 0.The fix for this issue is to increment the
lastMiddle
index even when there are 0numThreads
calculated and then continue to the next iteration.