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

Refactor FileStream and HiCFileWriter to be more robust against data races #275

Closed
wants to merge 33 commits into from

Conversation

robomics
Copy link
Contributor

@robomics robomics commented Oct 3, 2024

This PR introduces two main changes:

  • updating the FileStream class to expose several member functions to perform atomic reads and writes to binary files
  • updating HiCFileWriter to take advantage of the new FileStream functionality
  • optimize serialization of .hic files (the optimizations are especially noticeable when writing .hic files using a low number of threads)

@robomics robomics added the enhancement New feature or request label Oct 3, 2024
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 87.83270% with 96 lines in your changes missing coverage. Please review.

Project coverage is 79.31%. Comparing base (9fd7986) to head (c854b2b).

Files with missing lines Patch % Lines
...tk/hic/include/hictk/hic/impl/file_writer_impl.hpp 87.75% 25 Missing and 5 partials ⚠️
...ictk/hic/impl/file_writer_data_structures_impl.hpp 57.35% 28 Missing and 1 partial ⚠️
.../filestream/include/hictk/impl/filestream_impl.hpp 94.65% 8 Missing and 6 partials ⚠️
...de/hictk/hic/impl/serialized_block_pqueue_impl.hpp 92.47% 3 Missing and 4 partials ⚠️
...tk/hic/include/hictk/hic/impl/file_reader_impl.hpp 61.53% 1 Missing and 4 partials ⚠️
...ictk/hic/impl/interaction_to_block_mapper_impl.hpp 55.55% 2 Missing and 2 partials ⚠️
...ibhictk/hic/include/hictk/hic/impl/header_impl.hpp 90.90% 1 Missing and 2 partials ⚠️
...y_buffer/include/hictk/impl/binary_buffer_impl.hpp 71.42% 1 Missing and 1 partial ⚠️
.../include/hictk/hic/interaction_to_block_mapper.hpp 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #275      +/-   ##
==========================================
+ Coverage   79.08%   79.31%   +0.22%     
==========================================
  Files         171      173       +2     
  Lines       16482    16794     +312     
  Branches     2278     2302      +24     
==========================================
+ Hits        13035    13320     +285     
- Misses       2450     2469      +19     
- Partials      997     1005       +8     
Flag Coverage Δ
[tests integration](https://app.codecov.io/gh/paulsengroup/hictk/pull/275/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=paulsengroup) 69.74% <83.96%> (+0.20%)
[tests unittests](https://app.codecov.io/gh/paulsengroup/hictk/pull/275/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=paulsengroup) 77.36% <86.43%> (+0.81%)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robomics robomics changed the title Refactor FileStream to be more robust against data races Refactor FileStream and HiCFileWriter to be more robust against data races Oct 6, 2024
@robomics
Copy link
Contributor Author

robomics commented Oct 8, 2024

Superseded by #282

@robomics robomics closed this Oct 8, 2024
@robomics robomics deleted the fix/data-race branch October 10, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant