Skip to content

Commit 83ab8ab

Browse files
committed
Only set shape if it was changed
1 parent 047c035 commit 83ab8ab

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
@@ -2560,7 +2560,23 @@ namespace detail
25602560
}
25612561
else
25622562
{
2563-
var.SetShape(shape);
2563+
auto const &old_shape = var.Shape();
2564+
bool shape_changed = old_shape.size() != shape.size();
2565+
if (!shape_changed)
2566+
{
2567+
for (size_t i = 0; i < old_shape.size(); ++i)
2568+
{
2569+
if (old_shape[i] != shape[i])
2570+
{
2571+
shape_changed = true;
2572+
break;
2573+
}
2574+
}
2575+
}
2576+
if (shape_changed)
2577+
{
2578+
var.SetShape(shape);
2579+
}
25642580
if (count.size() > 0)
25652581
{
25662582
var.SetSelection({start, count});

0 commit comments

Comments
 (0)