EAMxx: replace AtmosphereInput with a lean FieldReader class#8388
Open
bartgol wants to merge 8 commits into
Open
EAMxx: replace AtmosphereInput with a lean FieldReader class#8388bartgol wants to merge 8 commits into
bartgol wants to merge 8 commits into
Conversation
We were allowed to call get_view<double*> on an IntType field
5f2e4ef to
1e5bfe7
Compare
This class will replace AtmosphereInput, as a very lightweight class with very little dependencies (only the Field class and the scorpio interfaces)
Avoid hand-rolling of the same code multiple times
- in grid: when resetting a field tag name, we must update any geo data currently stored to reflect the change - in scorpio interface: when creating single-dim decomp, store the dim in the DimDecomp structure
Instead, use FieldReader class or read_fields util
When FieldReader::reset_filename switches to a new file, scorpio dimension decompositions are per-file and thus lost. Reads then fell back to the non-decomposed path, causing all ranks to read the full global array into local-sized buffers (SIGBUS/SIGSEGV with 2+ ranks). Fix by storing the MPI comm alongside the decomp GIDs in FieldReader, and re-applying set_dim_decomp to the new file inside reset_filename whenever a decomp had previously been established. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1e5bfe7 to
8622bc8
Compare
… grid The special name is ONLY needed to read fields, so just rename the tag in the field aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the AtmosphereInput class with a lightweight class that is native to eamxx_field library.
[BFB]
A few highlights.
FieldReaderclass, there are also a few overloads of aread_fieldsfunction, which is helpful for one-off reads, that are not interested in keeping a reader around.eamxx_ioto read in fields. This utility simply relies oneamxx_fieldandeamxx_scorpio_interface. E.g., grids and remappers (that are built beforeeamxx_io) can use the utility to get stuff from IC/map files.FieldWriterclass, which does NO averaging, NO remapping, NO diags calculation, it JUST writes fields to a file. IO could use it as a building block, but more importantly it can be used in atm process for debugging, without the heavy machinery of AtmosphereOutput, and can also help for unit tests (e.g., remap unit tests do a bunch of scorpio::xyz calls to write to file, while we could just dowrite_fields (filename,{a,b,c});.