Skip to content

Conversation

guj
Copy link
Contributor

@guj guj commented Aug 1, 2024

if a joined dim exists, setshape() should not change it.

@franzpoeschel
Copy link
Contributor

Do you have a specific use case in mind for this?
If yes, can you add that as a test, please?

If there is no specific use case, should we maybe rather just check this and throw an error if the shape is changed in unconventional ways?

Also, I think that this logic is more adequately placed in the frontend at RecordComponent::resetDataset(), since there is nothing inherently ADIOS2-specific about it.

}
else
{
var.SetShape(shape);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that the previous shape should be considered here at all.
This code is executed when the Variable was already part of the previous step. The Variable shape can be something completely new in the new step. If the user means to use a joined dimension again, Dataset::JOINED_DIMENSION should be specified again; we should not try to outsmart the user by trying to keep the joined dimension from the previous step.

{
dims.push_back(ext);
auto idx = joined_dim.value();
dims[idx] = var.Shape()[idx];
Copy link
Contributor

Choose a reason for hiding this comment

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

Undefined behavior if the vector lengths are not the same

@guj
Copy link
Contributor Author

guj commented Aug 1, 2024

Do you have a specific use case in mind for this? If yes, can you add that as a test, please?

If there is no specific use case, should we maybe rather just check this and throw an error if the shape is changed in unconventional ways?

Also, I think that this logic is more adequately placed in the frontend at RecordComponent::resetDataset(), since there is nothing inherently ADIOS2-specific about it.

Yes, this change was needed when testing joined dimension in warpx. Let me see if I can come up with a test case.

@ax3l ax3l added this to the 0.16.0 milestone Aug 5, 2024
@ax3l ax3l modified the milestones: 0.16.0, 0.17.0, 0.16.1 Sep 5, 2024
@ax3l ax3l modified the milestones: 0.16.1, 0.16.2 Oct 8, 2024
@franzpoeschel
Copy link
Contributor

This has been fixed with #1740, I think? Feel free to reopen, if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants