-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix: Restart files contain incorrect types for ArrayOfArrays #3434
Merged
Merged
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
648818d
add conduit write/read for ArrayOfArrays
rrsettgast 60dd774
Merge branch 'develop' into bugfix/conduitTypeError
rrsettgast c2b7371
uncrustify
rrsettgast 327b5b9
Merge branch 'bugfix/conduitTypeError' of github.com:GEOS-DEV/GEOS in…
rrsettgast 451572d
update baselines
rrsettgast 362cfcc
fixed bug in ArrayOfArrays conduit reader
rrsettgast 295303b
Merge branch 'develop' into bugfix/conduitTypeError
paveltomin 0451312
add checks to conduit ArrayOfArrays read
rrsettgast 286318f
Merge branch 'bugfix/conduitTypeError' of github.com:GEOS-DEV/GEOS in…
rrsettgast 20b324b
Update .integrated_tests.yaml
paveltomin 28bfe0d
avoid bounds check error using const_cast for ArrayOfArrays:m_values …
rrsettgast a4569cd
Merge branch 'develop' into bugfix/conduitTypeError
paveltomin 80713cc
more bug-chasing
rrsettgast cd6ac76
retry ArrayOfArrays::m_values prealloc
rrsettgast d5305ed
Merge branch 'develop' into bugfix/conduitTypeError
paveltomin 1c00ae8
update baseline hash
rrsettgast b986147
Merge branch 'bugfix/conduitTypeError' of github.com:GEOS-DEV/GEOS in…
rrsettgast 56eed8f
reset baseline to develop
rrsettgast 76e9594
update baselines....again
rrsettgast d2e8f8d
make copy of ArrayOfArray::m_values and alter uninitialized allocations
rrsettgast ac211ad
update baselines
rrsettgast a799d6b
remove the copy of values
rrsettgast 1be8ad2
uncrustify
rrsettgast fcfa719
update baseline
rrsettgast File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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 don't fully understand the size here. What' s in
offsets[numArrays]
?Shouldn't this be the size of each array *
numOfArrays
*sizeof(T)
?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.
offsets
is the location in the buffer that a subarray starts. The nextoffset
is where the next one starts. So the last valueoffsets[numArrays]
is the end of the buffers as there arenumArrays+1
values inoffsets
. So `offsets[numArrays] is the length of the buffer if I am not mistaken. @corbett5 @wrtobin ??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.
oh I see. I would write this exact comment in the code.
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.
From
ArrayOfArraysView.hpp
: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 agree with Randy. The last offset is one measure of the total length of the underlying memory. Other measures are the capacity from the underlying buffer, or offsets(numArrays - 1) + sizeOfArray(numArrays - 1) which would be the end of the valid values. For io you should only need to write up to this last value.
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.
@corbett5 I did notice it would be nice for a bit different nomenclature for this object....for example:
NestedArrays
arrays object for an arbitrary nesting, it would be nice to come up with something extendible.m_offset
andm_sizes
protected inArrayOfArraysView
. So that means thatArrayOfArrays
can't provide public access. I am sure this is by design, but there needs to be more data helper functions to avoid needing direct access to these internal data arrays IMO.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.
1
If you're accessing the underlying data (ie through
m_offsets
andm_sizes
) you could be accessing uninitialized data. Which isn't a problem if you have anArrayOfArrays< double >
, but is very much a problem (or at least you need to know what you're doing) if you have anArrayOfArrays< string >
. So yeah I didn't make this easy on purpose.There is a way to get the total underlying buffer capacity
One way to do IO for the whole buffer would be
2
Certainly open for a name change. I thought I tried to call them inner arrays in the docs, but it's certainly confusing.
3
I agree it's strange that you can
getValues()
becomes accessible once you convert anArrayOfArrays
to anArrayOfArraysView
. I don't think there would be any harm in making these methods accessible directly fromArrayOfArrays
.