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: Fuzzy error synchronization and padding optimization #202

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

tim-griesbach
Copy link
Collaborator

scda: Fuzzy error synchronization and padding optimization

This PR continues the implementation of the scda file format (cf. #201) by adding two smaller changes.

  1. Parallel synchronization of the state of the random number generator for the fuzzy error testing. This is required since the serial code paths cause differing counts of drawn random samples on each MPI rank. This means that the fuzzy error return could make a collective error return to a non-collective error return, which is invalid behavior. Therefore, the state of the random number generator is synchronized after every non-collective code section. This change only impacts the code when fuzzy error return is enabled, leaving the normal scda code behavior unchanged.
  2. Introduce the function sc_scda_check_pad_to_fix_len to check fixed-length padding without extracting the raw data. This function enables more modularization, saves one unnecessary copy of the vendor string and makes the set of padding functions for both padding options symmetric.

This makes the set of padding function for the two supported padding
options symmetric and saves copying the vendor string without any use.
@cburstedde
Copy link
Owner

Sounds good! Do we have a way to indicate in the code very clearly which parts are collective and which are not? This seems very important for the parallel consistency of error checking. Maybe by means of extra function calls into non-collective paths with proper naming? "Just" comments and conventions may not be sufficiently safe.

@cburstedde cburstedde merged commit 74397d3 into cburstedde:develop Sep 19, 2024
14 checks passed
@tim-griesbach
Copy link
Collaborator Author

The non-collective code paths are already in separate functions and the current naming convention for these static functions is that their name ends with _internal. I could replace the current name endings by _serial to be more clear on the functions' purpose.

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