Skip to content

Commit 75ab607

Browse files
committed
Only set shape if it was changed
1 parent e7060fc commit 75ab607

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
@@ -2617,7 +2617,23 @@ namespace detail
26172617
}
26182618
else
26192619
{
2620-
var.SetShape(shape);
2620+
auto const &old_shape = var.Shape();
2621+
bool shape_changed = old_shape.size() != shape.size();
2622+
if (!shape_changed)
2623+
{
2624+
for (size_t i = 0; i < old_shape.size(); ++i)
2625+
{
2626+
if (old_shape[i] != shape[i])
2627+
{
2628+
shape_changed = true;
2629+
break;
2630+
}
2631+
}
2632+
}
2633+
if (shape_changed)
2634+
{
2635+
var.SetShape(shape);
2636+
}
26212637
if (count.size() > 0)
26222638
{
26232639
var.SetSelection({start, count});

0 commit comments

Comments
 (0)