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

Diagnostics: print when writing openPMD, Ascent, Sensei and when writing BTD plotfile and openPMD #3424

Merged
merged 34 commits into from
Oct 25, 2022

Conversation

RTSandberg
Copy link
Member

@RTSandberg RTSandberg commented Sep 22, 2022

This PR prints when writing BTD data:

--- INFO    : Writing buffer 1 of 4 to openPMD BTD file lab_diags0

and

STEP 526 starts ...
--- INFO    : Writing buffer 4 of 4 to openPMD BTD file lab_diags9
--- INFO    : Finished writing openPMD BTD file lab_diags9

It raises a low priority warning if some BTD snapshots aren't expected to fill:

*     This simulation might not run long enough to fill all BTD  snapshots.
*     Final step: 2
*     Last BTD snapshot fills around step: 527
*     @ Raised by: ALL

Also, currently WarpX prints a notice to stdout when saving plotfile and checkpoints. This PR extends this notice to openPMD, Ascent, and Sensei formatted diagnostics

For example,

--- INFO    : Writing openPMD file boosted_diags000070
STEP 70 ends. TIME = 7.829116496e-14 DT = 1.118445214e-15

or

--- INFO    : Writing openPMD file lab_diags000000
STEP 255 ends. TIME = 2.852035295e-13 DT = 1.118445214e-15
Evolve time = 63.00286442 s; This step = 0.207136209 s; Avg. per step = 0.2470700565 s

CI test LaserAccelerationBoost now uses BTD for its checksums, as planned to improve CI coverage of BTD (see #3300).

@EZoni EZoni self-assigned this Sep 23, 2022
@EZoni EZoni added the component: diagnostics all types of outputs label Sep 23, 2022
@EZoni EZoni self-requested a review September 23, 2022 21:10
@RTSandberg RTSandberg changed the title print when writing openPMD, Ascent, Sensei [WIP] print when writing openPMD, Ascent, Sensei Sep 27, 2022
@EZoni
Copy link
Member

EZoni commented Sep 28, 2022

The PR looks good to me, but there's a couple of CI tests that fail with the following error:

No protocol specified                                                                                                                       
terminate called after throwing an instance of 'std::__ios_failure'             
what():  basic_ios::clear: iostream error                                     
SIGABRT

The tests that fail are RigidInjection_BTD and BTD_ReducedSliceDiag.
I do not understand yet why this happens, needs to be investigated more.

Copy link
Member

@EZoni EZoni left a comment

Choose a reason for hiding this comment

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

Thank you for this PR, @RTSandberg! Besides my initial comment on the CI tests, I left a few minor suggestions.

@RTSandberg RTSandberg force-pushed the topic-printWhenWritingOutput branch from 6773f47 to 216781a Compare October 7, 2022 21:26
@RTSandberg RTSandberg changed the title [WIP] print when writing openPMD, Ascent, Sensei [WIP] Diagnostics: print when writing openPMD, Ascent, Sensei and when writing BTD plotfile and openPMD Oct 7, 2022
@RTSandberg RTSandberg force-pushed the topic-printWhenWritingOutput branch from fc43f11 to 7c94b2b Compare October 11, 2022 21:02
@RTSandberg RTSandberg changed the title [WIP] Diagnostics: print when writing openPMD, Ascent, Sensei and when writing BTD plotfile and openPMD Diagnostics: print when writing openPMD, Ascent, Sensei and when writing BTD plotfile and openPMD Oct 11, 2022
@RTSandberg RTSandberg added the component: boosted frame boosted frame components & logic label Oct 11, 2022
@EZoni EZoni self-requested a review October 12, 2022 00:34
@EZoni EZoni self-requested a review October 12, 2022 16:56
Copy link
Member

@EZoni EZoni left a comment

Choose a reason for hiding this comment

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

Thank you for this PR, @RTSandberg! Looks great to me. I left a few minor comments.

@RTSandberg RTSandberg requested a review from EZoni October 14, 2022 16:54
@RTSandberg RTSandberg force-pushed the topic-printWhenWritingOutput branch from b0b4e34 to b983072 Compare October 14, 2022 16:59
Copy link
Member

@EZoni EZoni left a comment

Choose a reason for hiding this comment

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

Thank you for the latest changes, @RTSandberg! Looks good to me. Will request a last review from @ax3l and then we can merge this.

@EZoni EZoni requested a review from ax3l October 14, 2022 18:07
@EZoni
Copy link
Member

EZoni commented Oct 21, 2022

@ax3l Hi, just pinging in case you have any suggestions before I merge this PR.

// j >= i / gamma / (1+beta) * dt_snapshot / dt_boosted_frame
const int final_snapshot_starting_step = ceil(final_snapshot_iteration / warpx.gamma_boost / (1._rt+warpx.beta_boost) * m_dt_snapshots_lab / dt_boosted_frame);
const int final_snapshot_fill_iteration = final_snapshot_starting_step + num_buffers * m_buffer_size - 1;
if (final_snapshot_fill_iteration > warpx.maxStep()) {
Copy link
Member

Choose a reason for hiding this comment

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

cc @RevathiJambunathan fyi what we discussed today

@ax3l ax3l enabled auto-merge (squash) October 24, 2022 22:33
auto-merge was automatically disabled October 25, 2022 17:57

Head branch was pushed to by a user without write access

@RTSandberg RTSandberg force-pushed the topic-printWhenWritingOutput branch from 4e279ee to 4533efa Compare October 25, 2022 17:57
@EZoni EZoni enabled auto-merge (squash) October 25, 2022 18:05
@EZoni EZoni merged commit e4c7354 into ECP-WarpX:development Oct 25, 2022
@RTSandberg RTSandberg deleted the topic-printWhenWritingOutput branch October 25, 2022 20:55
dpgrote pushed a commit to dpgrote/WarpX that referenced this pull request Nov 22, 2022
…e/openPMD (ECP-WarpX#3424)

* print when writing openPMD, Ascent, Sensei

* remove unnecesssary variables, include min_digits

* print snapshot id when writing btd

* fix ascent print

* compile without warnings

* still working on Ascent

* still working Ascent

* Print when BTD buffer is flushed

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* print when writing openPMD, Ascent, Sensei

* remove unnecesssary variables, include min_digits

* print snapshot id when writing btd

* fix ascent print

* compile without warnings

* still working on Ascent

* still working Ascent

* Print when BTD buffer is flushed

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add warning message if BTD not full

* adjust for CI, no in-situ vis BTD

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert to correct plotfile naming

* change warning topic to BTD

* nicer format for print statements

* extend examples to fill BTD

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Reset Checksums of BTD_ReducedSliceDiag

* Upgrade CI Test LaserAccelerationBoost

* Apply suggestions from code review

Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>

* improve BTD warning notes

* edit final step notes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix formatting

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: boosted frame boosted frame components & logic component: diagnostics all types of outputs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants