This repository was archived by the owner on Jan 31, 2020. It is now read-only.
Fix multi-threading bug that causes incorrect results#106
Open
jmarshall wants to merge 1 commit intogenome:masterfrom
Open
Fix multi-threading bug that causes incorrect results#106jmarshall wants to merge 1 commit intogenome:masterfrom
jmarshall wants to merge 1 commit intogenome:masterfrom
Conversation
Having `m_filteredReads.push_back(m_rawreads[i])` in a loop that is parallel for `i` meant that entries could be pushed onto `m_filteredReads` in arbitrary order when multiple threads are used. Instead store pointers in a fixed-size array in the parallel loop, and squash them sequentially into `m_filteredReads` afterwards. Fixes a bug whereby incorrect output was produced when multiple threads were used (differences observed beyond six threads).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
We have observed that, for a fraction of the events detected in our data files, Pindel output varies with the number of threads Pindel uses. Specifically the per-sample per-strand counts are incorrect — 350+51 = 401 = 277+124, i.e., the total number of supporting reads is unchanged, but some of the reads have been assigned to the wrong strand:
Output was unchanged for low threading settings, but starts to differ at T=7 and by T=16 is dramatically incorrect.
This is fixed (and the output no longer varies with the number of threads used) by correcting
ReadBuffer::flush()to maintain the order ofm_rawreads[]entries when they are copied intom_filteredReads[]regardless of threading indeterminacy.I suspect this patch may also fix or affect #26, which appears to be a similar problem.