Skip to content

Commit 62df6e5

Browse files
committed
Only set shape if it was changed
1 parent ba2b473 commit 62df6e5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/IO/ADIOS/ADIOS2IOHandler.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2421,7 +2421,23 @@ ERROR: Variable ')"[1] + varName +
24212421
}
24222422
else
24232423
{
2424-
var.SetShape(shape);
2424+
auto const &old_shape = var.Shape();
2425+
bool shape_changed = old_shape.size() != shape.size();
2426+
if (!shape_changed)
2427+
{
2428+
for (size_t i = 0; i < old_shape.size(); ++i)
2429+
{
2430+
if (old_shape[i] != shape[i])
2431+
{
2432+
shape_changed = true;
2433+
break;
2434+
}
2435+
}
2436+
}
2437+
if (shape_changed)
2438+
{
2439+
var.SetShape(shape);
2440+
}
24252441
if (count.size() > 0)
24262442
{
24272443
var.SetSelection({start, count});

0 commit comments

Comments
 (0)