Skip to content

Commit 6400651

Browse files
committed
Only set shape if it was changed
1 parent 3a10fcd commit 6400651

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
@@ -2497,7 +2497,23 @@ ERROR: Variable ')"[1] + varName +
24972497
}
24982498
else
24992499
{
2500-
var.SetShape(shape);
2500+
auto const &old_shape = var.Shape();
2501+
bool shape_changed = old_shape.size() != shape.size();
2502+
if (!shape_changed)
2503+
{
2504+
for (size_t i = 0; i < old_shape.size(); ++i)
2505+
{
2506+
if (old_shape[i] != shape[i])
2507+
{
2508+
shape_changed = true;
2509+
break;
2510+
}
2511+
}
2512+
}
2513+
if (shape_changed)
2514+
{
2515+
var.SetShape(shape);
2516+
}
25012517
if (count.size() > 0)
25022518
{
25032519
var.SetSelection({start, count});

0 commit comments

Comments
 (0)