-
Notifications
You must be signed in to change notification settings - Fork 91
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
Dynamic Time History Collection #1360
Conversation
wrtobin
commented
Mar 17, 2021
•
edited by rrsettgast
Loading
edited by rrsettgast
- Fix [Bug] History collection give out of bound error with EmbeddedSurfaceSubRegion. #1356
- Fix [Bug] Time history in parallel: abnormally slow setup and crash on exit #1309
- Resolve [Feature] Time History output including spatial coordinates #1203
- Collect data from arrays with an index set that can change size on any MPI rank during execution
- Account for the changing sizes in buffered collected data when writing to file
- Using the minimum index count from a rank involved in the writing works. Any larger and the HDF5 mpio routines error. Minimally this means doing writes with chunk size 1, since any ranks with 0 indices are excluded from the subcomm used to write a specific history 'row'. Efficiency of this approach is questionable, but this is the largest the chunk can reliably be.
- Unit testing for (1) expanding and contracting data collection/output from the same process (2) repeated file writing with (1)
- Allow collection of anything in the data repository (that is able to be collected).
- Since the dynamic collection changes the extent of the serialized portion of the time history 'row' that each MPI rank writes, we should also be able to use this to collect indexing data as well in order to help track specific items in a time history over the course of the simulation.
@castelletto1 This PR DOES include the ability to collect anything in the I've added it to the checklist. |
…tically when collecting from object managers / fields, account for dynamic set changes for the coordinates
…anging file row prealloc to 1 so that coords being written and never updated don't have erroneous zero rows
This requires a rebaseline as the tests deriving from sedov_base.xml will restart fail due to schema changes. |
…utput, also fixing an init collection size 0 bug
…cally output when collecting from mesh objects
HistoryCollection::initializePostSubGroups(); | ||
if( !m_initialized ) | ||
{ | ||
DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rrsettgast is this preferred over getGlobalState().problemManager().domain()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think to prefer getGlobalState().problemManager().domain()
, which is what I was using originally, this came in via a merge and I left it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be the way it is to avoid dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to fix this still...I was avoiding calls to getGlobalState()
due to dependency issues, but I hadn't provided an accessor for domain. It isn't pleasant as it stands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! I would add an integrated test in which some non mesh objects are collected (e.g., nonlinear and linear iterations) so that we have a working example in there.
objectPath="ElementRegions/Fracture/embeddedSurfaceSubRegion" | ||
fieldName="elementCenter" | ||
minSetSize="120"/> | ||
fieldName="displacementJump" /> | ||
</Tasks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for a min set size coz now the collection just gets resized every time the field changes size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes exactly.
There can still be trailing 0s though since the HDF arrays aren't ragged / AoAs. Practically now we just expand the dataset as needed, which will add 0s to all previous 'rows', and we never contract the dataset: it will be sized to accommodate the largest set of collected data from the run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How hard would it be to write it out AoA style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC it will require defining a couple data types, one for the values extracted by a single index, and another variable-length type using the first type. Not sure how it plays in a dataspace with an unlimited dimension.
The bigger unknown is dealing with the write in parallel w/ MPIO since HDF5 is a bit cumbersome in that respect... it might handle variable-length writes from processes transparently, or might require explicitly being told everything about the write (which is mostly the case right now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this will only happen if the collection has not been written to file yet. So, basically, if the field is resized in the same packCollection
event before being written to file then all time-steps will have the field with the maximum size. But this should not happen if an output event occurs before the resizing. Am I wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A size increase at any point results in the dimensions of the hdf dataspace being changed, so even rows already written to file will have 0s appended when the extent is changed.
Correlating the rows and the mesh object coordinates should in most cases allow the determination of which elements are padding elements and which are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some nitpick things
HistoryCollection::initializePostSubGroups(); | ||
if( !m_initialized ) | ||
{ | ||
DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to fix this still...I was avoiding calls to getGlobalState()
due to dependency issues, but I hadn't provided an accessor for domain. It isn't pleasant as it stands.
Co-authored-by: Randolph Settgast <settgast1@llnl.gov>
I tried the integrated test I understand the Note that all values in the |
@castelletto1 The last commit should fix this bug, thanks for catching it. |
This should be ready to go in. https://github.com/GEOSX/integratedTests/pull/139 needs to be merged in first to account for the XML changes to the baselines that use the time history functionality. |