Skip to content

VTKFile/CheckpointFile: assert that Function comm is compatible - #5425

Open
JHopeCollins wants to merge 4 commits into
releasefrom
JHopeCollins/check-comm-on-file-writes
Open

VTKFile/CheckpointFile: assert that Function comm is compatible#5425
JHopeCollins wants to merge 4 commits into
releasefrom
JHopeCollins/check-comm-on-file-writes

Conversation

@JHopeCollins

@JHopeCollins JHopeCollins commented Sep 2, 2026

Copy link
Copy Markdown
Member

If you try to write a Function defined on a different Comm to the file then it will usually just hang with no indication of the error. This often occurs with the Ensemble when you forget to pass comm=ensemble.comm to the File constructor.

This PR:

  1. adds a check that the comms are compatible in the write/read methods of each file type.
  2. Updates docstrings for these methods to numpydoc formats.
  3. Adds a CommMismatchError to the firedrake custom exceptions.

@JHopeCollins JHopeCollins self-assigned this Sep 2, 2026
Comment thread firedrake/output/vtk_output.py Outdated
Comment thread firedrake/checkpointing.py Outdated
Comment thread firedrake/checkpointing.py Outdated
Comment thread firedrake/checkpointing.py Outdated
Comment thread firedrake/checkpointing.py Outdated
Co-authored-by: Josh Hope-Collins <jhc.jss@gmail.com>
connorjward
connorjward previously approved these changes Sep 2, 2026
@JHopeCollins
JHopeCollins enabled auto-merge (squash) September 2, 2026 12:49
Comment thread firedrake/checkpointing.py Outdated
Comment thread firedrake/checkpointing.py Outdated
Comment thread firedrake/checkpointing.py Outdated
Comment thread firedrake/checkpointing.py Outdated
Co-authored-by: Josh Hope-Collins <jhc.jss@gmail.com>
@connorjward

Copy link
Copy Markdown
Contributor

This is failing some tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants