-
Notifications
You must be signed in to change notification settings - Fork 51
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
setshape() should not touch the joined dim #1656
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -849,10 +849,13 @@ namespace detail | |
variable + "'."); | ||
} | ||
adios2::Dims dims; | ||
dims.reserve(newShape.size()); | ||
for (auto ext : newShape) | ||
dims.assign(newShape.begin(), newShape.end()); | ||
// keep the joined dim intact | ||
auto joined_dim = joinedDimension(var.Shape()); | ||
if (joined_dim.has_value()) | ||
{ | ||
dims.push_back(ext); | ||
auto idx = joined_dim.value(); | ||
dims[idx] = var.Shape()[idx]; | ||
} | ||
var.SetShape(dims); | ||
} | ||
|
@@ -2032,7 +2035,18 @@ namespace detail | |
} | ||
else | ||
{ | ||
var.SetShape(shape); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that the previous |
||
// keep the joined dim intact | ||
auto joined_dim = joinedDimension(var.Shape()); | ||
if (joined_dim.has_value()) | ||
{ | ||
adios2::Dims cc; | ||
cc.assign(shape.begin(), shape.end()); | ||
cc[joined_dim.value()] = var.Shape()[joined_dim.value()]; | ||
var.SetShape(cc); | ||
} | ||
else | ||
var.SetShape(shape); | ||
|
||
if (count.size() > 0) | ||
{ | ||
var.SetSelection({start, count}); | ||
|
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.
Undefined behavior if the vector lengths are not the same