Skip to content

Set precision in the save function - #2103

Merged
blaisb merged 3 commits into
masterfrom
simulation_control_set_precision
Aug 25, 2026
Merged

blaisb merged 3 commits into
masterfrom
simulation_control_set_precision

Conversation

@OGaboriault

@OGaboriault OGaboriault commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The precision used to checkpoint the simulation control object was limited to five decimal places. As a result, when using time steps smaller than this precision, the time stored in the checkpoint file could be significantly rounded.

Solution

The std::setprecision(17) function is now used in the save function.

Testing

I have run a application test with this change and the number of decimal places was coherent with the change.

Documentation

No.

Use of LLMs (Large Language Models)

ChatGPT was asked what precision should be used. The answer was 17.

Miscellaneous (will be removed when merged)

Checklist (will be removed when merged)

See this page for more information about the pull request process.

Code related list:

  • All in-code documentation related to this PR is up to date (Doxygen format)
  • Copyright headers are present and up to date
  • Lethe documentation is up to date
  • Fix has unit test(s) (preferred) or application test(s), and restart files are in the generator folder
  • The branch is rebased onto master
  • An entry describing the origin of the bug as well as its fix has been added in /release_notes/current/ following the instructions of /release_notes/template.md
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent

Pull request related list:

  • Labels are applied
  • There are at least 2 reviewers (or 1 if small feature)
  • If the fix is temporary, an issue is opened
  • The PR description is clean and is ready to be used as the commit message when merging the PR

@OGaboriault
OGaboriault requested a review from blaisb August 24, 2026 18:11
@OGaboriault OGaboriault self-assigned this Aug 24, 2026
@OGaboriault OGaboriault added the Bug Something isn't working label Aug 24, 2026
@OGaboriault OGaboriault changed the title Set pression in the save function Set precision in the save function Aug 24, 2026
Comment thread source/core/simulation_control.cc Outdated

@blaisb blaisb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small thing to fix then good to go!

@blaisb blaisb added the Next release PR that would need to be merged before the next release label Aug 25, 2026
@blaisb
blaisb merged commit abdf51d into master Aug 25, 2026
10 checks passed
@blaisb
blaisb deleted the simulation_control_set_precision branch August 25, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Next release PR that would need to be merged before the next release Reviewed and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants