-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite while loop prevents maracluster from progressing #17
Comments
Note: This affects this tree used for quandenser: In maracluster 1.0, the file has been renamed to "SpectrumClusters.cpp". The bug should be valid there as well. |
Thanks, you're completely right. Could you submit a pull request to the master branch with your fix? |
Actually, the problem was simply some missing parentheses, so I fixed it myself. |
Since Quandenser uses a detached head, I added a branch of maracluster which adds the fix. Perhaps it is possible to use the branch as a submodule for quandenser instead of the detached head to incorporate the fix. However, I'm not sure how to do it in github. |
Hi Matthew,
I noticed a bug where a large clusterSize in BatchSpectrumClusters.cpp prevents maracluster from progressing.
I ran a data set from cyanobacteria, 10 samples with each file about 300 mb in size. After running quandenser on the data set, I noticed that it froze when it ran maracluster. I debugged the code and found out that it froze on this specific line:
Line 209: BatchSpectrumClusters.cpp
while (clusterSize >>= 1 && clusterSizeBin < 9) ++clusterSizeBin;
When the variable "clusterSize" reaches above and equal to 512, the while loop gets stuck forever.
Copy the following code into this website and run it to verify the problem: https://repl.it/languages/cpp
If I have understood what the problematic line is trying to accomplish aka shift clusterSize bits right by one until clusterSize == 1 or until clusterSizeBin is above or equal to 9.
In that case, I suggest rewriting the line to something similar to this:
This will prevent the bug from happening. I tested it briefly with my data set and it passed through maracluster cleanly.
Best regards,
Timothy Bergström
The text was updated successfully, but these errors were encountered: