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

scda: Write and read block sections #201

Merged
merged 24 commits into from
Sep 10, 2024

Conversation

tim-griesbach
Copy link
Collaborator

scda: Write and read block sections

This PR continues the implementation of the scda file format (cf. #199) by introducing the functionalities for writing and reading block sections. The changes in this PR are in particular

  • implementation of fwrite_block and fread_block_data,
  • extension of fread_section_header to also handle block section headers,
  • internal functions to read and write count entries appearing in section headers,
  • a generic internal function to check if parameters are collective,
  • extension of the set of internal padding functions to support outputting the padding bytes into a separate buffer, next to the already existing inplace option. This is used in fwrite_block since the block data is allocated by the user and inplace padding would thus require a copy of the block data.
  • For the sake of generality: Extension of the calculation of the number of modulo padding bytes in sc_scda_pad_to_mod_len to the case SC_SCDA_PADDING_MOD < 7.

Since we do not want to copy the potentially very big data, we also
offer a padding function that only sets the padding bytes but does
not copy the input data. For the fixed-length padding the data sizes are
smaller and known in advance. That is why, we prefer the inplace
padding for the fixed-length padding. However, for the sakes of
flexibility and symmetry we will also add non-inplace function for
the fixed-length padding.
As announced in the commit description of db724ac we add the
analogous changes for the fixed-length paddding.
@cburstedde cburstedde merged commit 0f05ae2 into cburstedde:develop Sep 10, 2024
14 checks passed
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.

2 participants