Skip to content

Commit 546c5ef

Browse files
committed
Only set shape if it was changed
1 parent bdb6ba0 commit 546c5ef

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/IO/ADIOS/ADIOS2IOHandler.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2482,7 +2482,23 @@ ERROR: Variable ')"[1] + varName +
24822482
}
24832483
else
24842484
{
2485-
var.SetShape(shape);
2485+
auto const &old_shape = var.Shape();
2486+
bool shape_changed = old_shape.size() != shape.size();
2487+
if (!shape_changed)
2488+
{
2489+
for (size_t i = 0; i < old_shape.size(); ++i)
2490+
{
2491+
if (old_shape[i] != shape[i])
2492+
{
2493+
shape_changed = true;
2494+
break;
2495+
}
2496+
}
2497+
}
2498+
if (shape_changed)
2499+
{
2500+
var.SetShape(shape);
2501+
}
24862502
if (count.size() > 0)
24872503
{
24882504
var.SetSelection({start, count});

0 commit comments

Comments
 (0)