Skip to content
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

Fix 32-bit revcomp failures #8116

Merged
merged 1 commit into from
Jan 3, 2018
Merged

Conversation

benharsh
Copy link
Member

@benharsh benharsh commented Jan 3, 2018

Fix 32-bit failures by casting to ssize_t and c_intptr.

Tested on linux64, linux32, and OS X.

@benharsh benharsh merged commit b66b162 into chapel-lang:master Jan 3, 2018
mppf added a commit that referenced this pull request Feb 1, 2018
Add channel.advancePastByte, use it to improve revcomp

PR #8045 added some messy rev-comp studies that improve performance by improving the I/O pattern. What the performance comes down to is two things:
 1. Copying large chunks of the input from the channel buffer in to the array to be used
 2. Using memchr to identify the relevant chunks of the input

I experimented with a version that used regexp format strings to replace the memchr call but that had unsatisfying performance.

This PR adds channel.advancePastByte in order to enable the expression of the fast I/O pattern in revcomp easily. Now the revcomp version does the following:
 * "mark" (indicate to the I/O system not to drop the buffer as we might return)
 * identify the offset of the newline (end of the sequence description)
 * identify the offset of the > (start of the next sequence)
 * "revert" (go back to where we "marked")
 * read the data again in one go with readBytes

I'm seeing a 10% speedup for this version beyond revcomp-buf.chpl, and it is much simpler.

While there, I noticed that qio_channel_advance might not set up the buffer in some cases, so added code to do that.

- [x] full local testing
- [x] docs for advancePastByte
- [x] update catch statement to specify type
- [x] check for 32-bit issues ala #8116

Closes #8105.

Reviewed by @benharsh - thanks!
@benharsh benharsh deleted the fix-revcomp branch March 16, 2018 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant