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 a file header #193

Merged
merged 82 commits into from
Jul 10, 2024

Conversation

tim-griesbach
Copy link
Collaborator

@tim-griesbach tim-griesbach commented Jun 12, 2024

scda: Write and read a file header

This PR adds the functionality to read and write a scda file header, i.e. implementing in particular the functions fopen_write and fopen_read according to the scda API introduced in #132 and #156.

A list of some of the functionalities that are implemented in this PR is

  • fopen_read and fopen_write,
  • helper functions that pad data according to the scda convention defined in the scda preprint,
  • helper functions that check if data is correctly padded and that extract the actual data,
  • complete error handling for fopen_read and fopen_write; including MPI count error management,
  • ferror_string to convert error codes to error strings,
  • fuzzy error checking to increase the code coverage of the error management,
  • a basic test program that currently aborts on errors and offers fuzzy error testing by command line parameters and
  • the non-static function sc_scda_is_success to check if an error code encodes success.

@cburstedde
Copy link
Owner

When merging the latest develop branch, will the CI go through?

@tim-griesbach
Copy link
Collaborator Author

When merging the latest develop branch, will the CI go through?

Yes, I think so. I merged the latest develop branch into this PR and the CI looks good to me.

* \return True if \b errcode encodes success and
* false otherwise.
*/
int sc_scda_is_success (sc_scda_ferror_t errorcode);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll be merging this one now.

For future development: Would it be more intuitive to rename the function to sc_scda_ferror_success (or something else -- open for suggestions) and to return MPI_SUCCESS on success and some MPI error otherwise?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that a function sc_scda_ferror_success that returns MPI error codes may be unexpected to the user and we also have the sc_scda_ret_t value SC_SCDA_FERR_SUCCESS that may be named too similar.
Do you think it is sensible to name the function sc_scda_ferror_is_success to be consistent to the other scda function names but still use the semantic of mapping an error code to a Boolean?

@cburstedde cburstedde merged commit 91cc8a4 into cburstedde:develop Jul 10, 2024
14 checks passed
@cburstedde
Copy link
Owner

cburstedde commented Jul 12, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants