Skip to content

Commit 52828d6

Browse files
committed
Only set shape if it was changed
1 parent 9f76d37 commit 52828d6

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
@@ -2577,7 +2577,23 @@ namespace detail
25772577
}
25782578
else
25792579
{
2580-
var.SetShape(shape);
2580+
auto const &old_shape = var.Shape();
2581+
bool shape_changed = old_shape.size() != shape.size();
2582+
if (!shape_changed)
2583+
{
2584+
for (size_t i = 0; i < old_shape.size(); ++i)
2585+
{
2586+
if (old_shape[i] != shape[i])
2587+
{
2588+
shape_changed = true;
2589+
break;
2590+
}
2591+
}
2592+
}
2593+
if (shape_changed)
2594+
{
2595+
var.SetShape(shape);
2596+
}
25812597
if (count.size() > 0)
25822598
{
25832599
var.SetSelection({start, count});

0 commit comments

Comments
 (0)