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

Mesh refinement: Adding IO #526

Merged
merged 9 commits into from
Jun 14, 2021

Conversation

SeverinDiederichs
Copy link
Member

@SeverinDiederichs SeverinDiederichs commented Jun 11, 2021

This PR adds a first working version of IO of the refined level.

In the OpenPMDWriter class, the series is now a vector over levels. Each level has its own series and writes to its own sub-folder in the IO path. If only the 0th level is used, no sub-folders will be generated.

Then, the IO is now a loop over levels. Additionally, the copying of the slice to the diagnostics is now a loop over levels.

The resizing of the diagnostic arrays is a loop over levels. To not yet touch the other functions, it is done with local variables.

To avoid complications with the Poisson solver (the staging area needs to exist per level), the Poisson solver is not even allocated for other levels than lev = 0. This is handled in #527.

Additionally, the boxarray for the first level is not set correctly.

In the current version, the code crashes if used with a beam in the binning. No beam can be used with MR at this point.

  • Small enough (< few 100s of lines), otherwise it should probably be split into smaller PRs
  • Tested (describe the tests in the PR description)
  • Runs on GPU (basic: the code compiles and run well with the new module)
  • Contains an automated test (checksum and/or comparison with theory)
  • Documented: all elements (classes and their members, functions, namespaces, etc.) are documented
  • Constified (All that can be const is const)
  • Code is clean (no unwanted comments, )
  • Style and code conventions are respected at the bottom of https://github.com/Hi-PACE/hipace
  • Proper label and GitHub project, if applicable

@SeverinDiederichs SeverinDiederichs added component: fields About 3D fields and slices, field solvers etc. component: diagnostics About any types of diagnostics labels Jun 11, 2021
@SeverinDiederichs SeverinDiederichs changed the title Mesh refinement: Adding IO [WIP] Mesh refinement: Adding IO Jun 11, 2021
@SeverinDiederichs SeverinDiederichs changed the title [WIP] Mesh refinement: Adding IO Mesh refinement: Adding IO Jun 11, 2021
Copy link
Member

@MaxThevenet MaxThevenet left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! See a few comments below.

src/Hipace.H Outdated Show resolved Hide resolved
src/diagnostics/OpenPMDWriter.cpp Show resolved Hide resolved
src/diagnostics/OpenPMDWriter.H Show resolved Hide resolved
@SeverinDiederichs SeverinDiederichs merged commit 5931ef7 into Hi-PACE:development Jun 14, 2021
@SeverinDiederichs SeverinDiederichs deleted the mr_io branch June 14, 2021 10:54
@ax3l
Copy link
Member

ax3l commented Jun 15, 2021

Awesome! :)

Let me cross-link the WarpX implementation and definitions we drafted for the openPMD standard:

Note that the WarpX implementation currently still over-allocates file size for the refined level for HDF5 (we use this with ADIOS2 at the moment). A follow-up PR tuning HDF5 further would only declare a smaller box per patch on the refined level to work-around this, as noted in both links :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: diagnostics About any types of diagnostics component: fields About 3D fields and slices, field solvers etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants