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

Add runtime particle components to HDF5 wrapper #3596

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

jordanm304
Copy link
Contributor

Summary

Add runtime components when computing the sizes/offsets for particle HDF5 files.

Additional background

Checklist

The proposed changes:

  • [ x] fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@atmyers
Copy link
Member

atmyers commented Oct 16, 2023

@houjun Does this change look correct to you? Is there a similar change that needs to be made in RestartHDF5 to read the runtime components back in?

@houjun
Copy link
Contributor

houjun commented Oct 16, 2023

@atmyers, I just checked the code and this fix looks correct.
The restart code uses "NStructReal + NumRealComps()", and NumRealComps() = NArrayReal + NumRuntimeRealComps(). So no need to change RestartHDF5.
I don't remember why "NStructInt" and "NStructReal" were used, likely a copy-paste error from an earlier version of AMReX.

@jordanm304, to make things consistent, I'd recommend changing the fix to:

int_size  = count[grid] * (2 + NStructInt + NumIntComps());
real_size = count[grid] * (AMREX_SPACEDIM + NStructReal + NumRealComps());

@atmyers atmyers merged commit da79aff into AMReX-Codes:development Oct 23, 2023
69 checks passed
guj pushed a commit to guj/amrex that referenced this pull request Dec 13, 2023
## Summary

Add runtime components when computing the sizes/offsets for particle
HDF5 files.

## Additional background

## Checklist

The proposed changes:
- [ x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate

---------

Co-authored-by: Jordan Musser <[email protected]>
Co-authored-by: Andrew Myers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants