Skip to content

append to dt_updates. - #7226

Merged
JustinRayAngus merged 2 commits into
BLAST-WarpX:developmentfrom
JustinRayAngus:append_dt_updates
Aug 31, 2026
Merged

append to dt_updates.#7226
JustinRayAngus merged 2 commits into
BLAST-WarpX:developmentfrom
JustinRayAngus:append_dt_updates

Conversation

@JustinRayAngus

Copy link
Copy Markdown
Contributor

This PR fixes a bug from PR #7221 that results in the dt_updates file being overwritten on a restart.

@JustinRayAngus
JustinRayAngus requested a review from dpgrote August 31, 2026 01:05

@lucafedeli88 lucafedeli88 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks good to me. Thanks !

@JustinRayAngus JustinRayAngus added the bug Something isn't working label Aug 31, 2026
Comment thread Source/Evolve/WarpXComputeDt.cpp Outdated
file_mode = std::ofstream::out | std::ofstream::app;
}

std::ofstream diagnostic_file{m_dt_update_diagnostic_file, file_mode};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could be simplified more. The file doesn't need to be opened in a restart since nothing needs to be written here. Note that the create_directories should still be done in case the user deleted it or is running in a different space than the original run.

if (IsNotRestart) {
    std::ofstream diagnostic_file{m_dt_update_diagnostic_file, std::ofstream::out | std::ofstream::trunc);
    int c = 0;
    diagnostic_file << "#";
    ...
    diagnostic_file.close();
}

@JustinRayAngus
JustinRayAngus requested a review from dpgrote August 31, 2026 18:00

@dpgrote dpgrote left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@JustinRayAngus
JustinRayAngus enabled auto-merge (squash) August 31, 2026 18:52
@JustinRayAngus
JustinRayAngus merged commit cf4d0ad into BLAST-WarpX:development Aug 31, 2026
50 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.

3 participants