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

CI: checksums cleanup #5297

Merged
merged 9 commits into from
Oct 4, 2024
Merged

CI: checksums cleanup #5297

merged 9 commits into from
Oct 4, 2024

Conversation

EZoni
Copy link
Member

@EZoni EZoni commented Sep 19, 2024

Fix #5206 and prepare for #5256:

  • Add missing checksums
    • test_1d_background_mcc_picmi
    • test_2d_background_mcc_picmi
    • test_3d_particle_absorption
    • test_2d_dirichlet_bc
    • test_2d_dirichlet_bc_picmi
    • test_2d_field_probe
    • test_3d_embedded_boundary_picmi
    • test_2d_particle_reflection_picmi
    • test_rz_laser_acceleration_opmd
    • test_2d_runtime_components_picmi
  • Clean up calls to evaluate_checksum

Calls to evaluate_checksum are now uniform across the analysis scripts, making it easier to automatize further changes. Hopefully the uniformity will be preserved by copy/pasting the necessary code:

  • import os
    import sys
  • sys.path.insert(1, "../../../../warpx/Regression/Checksum/")
    from checksumAPI import evaluate_checksum
  • # compare checksums
    evaluate_checksum(
        test_name=os.path.split(os.getcwd())[1],
        output_file=sys.argv[1],
    )
    with this last one possibly modified by adding other arguments, e.g., output_format, rtol, do_particles, etc.

@EZoni EZoni added the component: tests Tests and CI label Sep 19, 2024
@EZoni EZoni force-pushed the ctest_checksums branch 23 times, most recently from ca00dda to 2aeaf7e Compare October 2, 2024 07:06
@EZoni EZoni force-pushed the ctest_checksums branch 2 times, most recently from 152fbbd to 7c11574 Compare October 2, 2024 13:07
@EZoni EZoni force-pushed the ctest_checksums branch 5 times, most recently from aa3aec8 to 3ee6ecf Compare October 3, 2024 11:44
@EZoni EZoni marked this pull request as ready for review October 3, 2024 11:49
@EZoni EZoni added the cleaning Clean code, improve readability label Oct 3, 2024
@EZoni EZoni changed the title [WIP] CI: checksums cleanup CI: checksums cleanup Oct 3, 2024
@EZoni EZoni requested a review from ax3l October 3, 2024 15:52
@ax3l ax3l merged commit a7d3935 into ECP-WarpX:development Oct 4, 2024
37 checks passed
Comment on lines +246 to 249
print(f"\nNew checksums file {self.test_name}.json:")
print(json.dumps(self.data, indent=2))
print("----------------")
sys.exit(1)

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I'm working on a fix in #5372.

@EZoni EZoni deleted the ctest_checksums branch October 7, 2024 17:40
ax3l added a commit that referenced this pull request Oct 8, 2024
The major part of this PR is about updating the docs so that it is a bit
easier for developers to connect the section on testing with the section
on checksums.

Here's a couple of screenshots showing the new content organization for
the testing and checksums sections:
<p align="center">
<img
src="https://github.com/user-attachments/assets/af3df005-6923-4bcf-9f2a-8dcf60c126b2"
width="300">
<img
src="https://github.com/user-attachments/assets/b290e5bd-0ec3-46c1-93fc-055607220042"
width="300">
</p>

As part of this PR, I also update the tool that we have to reset
checksums locally based on the Azure output. The update is necessary due
to a change in #5297, as noted in
#5297 (comment),
given that new checksum files are now displayed as follows:
```

New checksums file test_2d_langmuir_multi.json:
{
  "lev=0": {
    "Bx": 0.0,
    "By": 5.726296856755232,
    "Bz": 0.0,
    "Ex": 3751589134191.326,
    "Ey": 0.0,
    "Ez": 3751589134191.332,
    "jx": 1.0100623329922576e+16,
    "jy": 0.0,
    "jz": 1.0100623329922578e+16
  },
  "electrons": {
    "particle_momentum_x": 5.668407513430198e-20,
    "particle_momentum_y": 0.0,
    "particle_momentum_z": 5.668407513430198e-20,
    "particle_position_x": 0.6553599999999999,
    "particle_position_y": 0.65536,
    "particle_weight": 3200000000000000.5
  },
  "positrons": {
    "particle_momentum_x": 5.668407513430198e-20,
    "particle_momentum_y": 0.0,
    "particle_momentum_z": 5.668407513430198e-20,
    "particle_position_x": 0.6553599999999999,
    "particle_position_y": 0.65536,
    "particle_weight": 3200000000000000.5
  }
}

```
as opposed to the old way
```

----------------
New file for test_2d_langmuir_multi:
{
  "lev=0": {
    "Bx": 0.0,
    "By": 5.726296856755232,
    "Bz": 0.0,
    "Ex": 3751589134191.326,
    "Ey": 0.0,
    "Ez": 3751589134191.332,
    "jx": 1.0100623329922576e+16,
    "jy": 0.0,
    "jz": 1.0100623329922578e+16
  },
  "electrons": {
    "particle_momentum_x": 5.668407513430198e-20,
    "particle_momentum_y": 0.0,
    "particle_momentum_z": 5.668407513430198e-20,
    "particle_position_x": 0.6553599999999999,
    "particle_position_y": 0.65536,
    "particle_weight": 3200000000000000.5
  },
  "positrons": {
    "particle_momentum_x": 5.668407513430198e-20,
    "particle_momentum_y": 0.0,
    "particle_momentum_z": 5.668407513430198e-20,
    "particle_position_x": 0.6553599999999999,
    "particle_position_y": 0.65536,
    "particle_weight": 3200000000000000.5
  }
}
----------------

```

To-do:
- [x] Update docs
- [x] Update tool

---------

Co-authored-by: Axel Huebl <[email protected]>
@EZoni EZoni mentioned this pull request Oct 19, 2024
4 tasks
n01r added a commit to RevathiJambunathan/WarpX that referenced this pull request Oct 21, 2024
Modify checksum evaluation call to follow example from PR ECP-WarpX#5297.

Co-authored-by: Edoardo Zoni <[email protected]>
dpgrote pushed a commit to dpgrote/WarpX that referenced this pull request Oct 23, 2024
The major part of this PR is about updating the docs so that it is a bit
easier for developers to connect the section on testing with the section
on checksums.

Here's a couple of screenshots showing the new content organization for
the testing and checksums sections:
<p align="center">
<img
src="https://github.com/user-attachments/assets/af3df005-6923-4bcf-9f2a-8dcf60c126b2"
width="300">
<img
src="https://github.com/user-attachments/assets/b290e5bd-0ec3-46c1-93fc-055607220042"
width="300">
</p>

As part of this PR, I also update the tool that we have to reset
checksums locally based on the Azure output. The update is necessary due
to a change in ECP-WarpX#5297, as noted in
ECP-WarpX#5297 (comment),
given that new checksum files are now displayed as follows:
```

New checksums file test_2d_langmuir_multi.json:
{
  "lev=0": {
    "Bx": 0.0,
    "By": 5.726296856755232,
    "Bz": 0.0,
    "Ex": 3751589134191.326,
    "Ey": 0.0,
    "Ez": 3751589134191.332,
    "jx": 1.0100623329922576e+16,
    "jy": 0.0,
    "jz": 1.0100623329922578e+16
  },
  "electrons": {
    "particle_momentum_x": 5.668407513430198e-20,
    "particle_momentum_y": 0.0,
    "particle_momentum_z": 5.668407513430198e-20,
    "particle_position_x": 0.6553599999999999,
    "particle_position_y": 0.65536,
    "particle_weight": 3200000000000000.5
  },
  "positrons": {
    "particle_momentum_x": 5.668407513430198e-20,
    "particle_momentum_y": 0.0,
    "particle_momentum_z": 5.668407513430198e-20,
    "particle_position_x": 0.6553599999999999,
    "particle_position_y": 0.65536,
    "particle_weight": 3200000000000000.5
  }
}

```
as opposed to the old way
```

----------------
New file for test_2d_langmuir_multi:
{
  "lev=0": {
    "Bx": 0.0,
    "By": 5.726296856755232,
    "Bz": 0.0,
    "Ex": 3751589134191.326,
    "Ey": 0.0,
    "Ez": 3751589134191.332,
    "jx": 1.0100623329922576e+16,
    "jy": 0.0,
    "jz": 1.0100623329922578e+16
  },
  "electrons": {
    "particle_momentum_x": 5.668407513430198e-20,
    "particle_momentum_y": 0.0,
    "particle_momentum_z": 5.668407513430198e-20,
    "particle_position_x": 0.6553599999999999,
    "particle_position_y": 0.65536,
    "particle_weight": 3200000000000000.5
  },
  "positrons": {
    "particle_momentum_x": 5.668407513430198e-20,
    "particle_momentum_y": 0.0,
    "particle_momentum_z": 5.668407513430198e-20,
    "particle_position_x": 0.6553599999999999,
    "particle_position_y": 0.65536,
    "particle_weight": 3200000000000000.5
  }
}
----------------

```

To-do:
- [x] Update docs
- [x] Update tool

---------

Co-authored-by: Axel Huebl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleaning Clean code, improve readability component: tests Tests and CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CTest follow-up: add missing checksum files
2 participants