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

Do not guard calls mesa_error() with report_ierr #732

Merged
merged 10 commits into from
Sep 16, 2024

Conversation

pmocz
Copy link
Member

@pmocz pmocz commented Sep 11, 2024

The user flag report_ierr = .true. is used as a debugging tool to report diagnostics on internal errors in Mesa but not stop the code. Flipping the switch to true should not change the outcome of the simulation. Therefore, we should not call mesa_error() inside if(report_ierr == .true.) if statements. Either always just halt the code, or use guards like if(stop_for_bad_nums == .true.).

There are just a handful of cases in the code where this pattern was not followed. This is dangerous because it can cause non-reproducible results when someone is trying to debug their run switches report_ierr = .true. on. Particularly in simulations that chain more than one inlist. For example, running ./run_all for the 20M_pre_ms_to_core_collapse test problem with report_ierr = .true. was yielding a different result than switching diagnostics off because one of the inlists in the middle of the chain was ending prematurely and the next inlist restarted the simulation from the last photo written.

TL;DR: fix so that switching on diagnostics reporting does not change outcome of the simulation

@pmocz pmocz requested a review from warrickball September 11, 2024 19:13
@pmocz pmocz self-assigned this Sep 11, 2024
@pmocz pmocz requested a review from rsmolec as a code owner September 11, 2024 19:13
@pmocz pmocz added the bug Something isn't working label Sep 11, 2024
Co-authored-by: Warrick Ball <[email protected]>
@pmocz pmocz merged commit e965acd into main Sep 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants