Skip to content

ADIOS2: Fix restart read/write - #3487

Merged
bendudson merged 2 commits into
nextfrom
fix-adios-restart
Sep 10, 2026
Merged

bendudson merged 2 commits into
nextfrom
fix-adios-restart

Conversation

@bendudson

Copy link
Copy Markdown
Contributor

Restarting from an ADIOS2 BOUT.restart.bp dataset and then writing to it would produce an unusable restart dataset. Attempting to restart a second time would either segfault or fail because variables had the wrong shape.

Quoth GPT:

  The main issue was that a restart read was preserving ADIOS’s
  internal __xarray_dimensions__ metadata in the Options tree,
  then writing it back out in a lossy form on the next restart
  write. On the second restart that made ADIOS interpret generic
  arrays as mesh fields with the wrong rank. I also tightened the
  ADIOS stream lifecycle so finished streams retire their IO
  objects cleanly instead of leaving stale cached state around.

Includes a new unit test that reproduced the original error and now passes.

Restarting from an ADIOS2 BOUT.restart.bp dataset and then writing
to it would produce an unusable restart dataset. Attempting to
restart a second time would either segfault or fail because variables
had the wrong shape.

Quoth GPT:

      The main issue was that a restart read was preserving ADIOS’s
      internal __xarray_dimensions__ metadata in the Options tree,
      then writing it back out in a lossy form on the next restart
      write. On the second restart that made ADIOS interpret generic
      arrays as mesh fields with the wrong rank. I also tightened the
      ADIOS stream lifecycle so finished streams retire their IO
      objects cleanly instead of leaving stale cached state around.

Includes a new unit test that reproduced the original error and now
passes.
Force when modifying an Option.
@Steven-Roberts

Copy link
Copy Markdown
Collaborator

Thanks for catching this @bendudson. I will review tomorrow.

@bendudson
bendudson merged commit 72a6f5f into next Sep 10, 2026
23 checks passed
@bendudson
bendudson deleted the fix-adios-restart branch September 10, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants