8000 0.5.10 mt fixes by iainrb · Pull Request #1 · wtsi-npg/bwa · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

0.5.10 mt fixes #1

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

Merged
merged 4 commits into from
Jan 17, 2013
Merged

0.5.10 mt fixes #1

merged 4 commits into from
Jan 17, 2013

Conversation

iainrb
Copy link
@iainrb iainrb commented Jan 17, 2013

Merge in 0.5.10 multithreaded fixes from Rob Davies

Rob Davies added 4 commits January 2, 2013 17:09
Added the following wrappers that check the results of system calls
and exit non-zero if something went wrong.  This is so bwa can be more
robust against system failures (e.g. IO errors from remote storage, or
running out of memory).  The existing and new wrappers have also been
modified so that they no longer try to dump core on failure.  In most cases
the resulting core files are not useful (especially if bwa was compiled
with optimization turned on) so just pollute whatever directories they
got written to.

The err_fflush wrapper also now calls fsync on regular files to try to
ensure that data has been written out when using remote filesystems.  This
is not really necessary for local filesystems but only takes a few seconds to
do.  The fsync can be disabled by removing the #define for FSYNC_ON_FLUSH
in utils.c.

Wrappers for memory allocation functions:

xcalloc
xmalloc
xrealloc
xstrdup

New wrappers for IO functions:

err_fwrite
err_fread_noeof   (also dies on EOF)
err_gzread
err_fseek
err_rewind
err_ftell
err_fprintf
err_printf
err_fflush
err_fclose
err_gzclose
Use the wrapper functions in utils.c plus a few extra bits of error
checking code to catch system errors and exit non-zero when they occur.
This commit mainly covers funtions that make IO system calls.

Updated dependencies in Makefiles.
Use the wrapper functions in utils.c to catch system errors and exit
non-zero when they occur.

This commit adds wrappers for memory allocation functions (malloc, calloc,
realloc and strdup).  It also prevents gen_cigar from trying to realloc a
buffer to zero bytes long.

Updates the dependencies in the Makefile again.
Added wrappers err_fputc and err_fputs to catch failures in fput and fputs.
Macros err_putchar and err_puts call the new wrappers and can be used in
place of putchar and puts.

To avoid having to make millions of function calls when printing out
sequences, the code to print them in bwa_print_sam1 using putchar has
been replaced by a new version in bwa_print_seq that puts the sequence
into a buffer and then outputs the lot with err_fwrite.  In testing, the
new code was slightly faster than the old version, with the added benefit
that it will stop promptly if IO problems are detected.
iainrb pushed a commit that referenced this pull request Jan 17, 2013
@iainrb iainrb merged commit c3a60e8 into wtsi-npg:0.5.10-mt Jan 17, 2013
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
0