Skip to content

Use Field with serializer - #362

Open
jacobmerson wants to merge 2 commits into
SCOREC:developfrom
jacobmerson:pcms-reduce-FieldData
Open

Use Field with serializer#362
jacobmerson wants to merge 2 commits into
SCOREC:developfrom
jacobmerson:pcms-reduce-FieldData

Conversation

@jacobmerson

Copy link
Copy Markdown
Collaborator

Rather than pass data and layouts separately, we update the serializer to directly take the Field&. This does a better job of maintaining consistency with what data we are operating with. Also, it reduces the number of places we expose FieldData, which is really an internal implementation detail that we don't want readily exposed.

Rather than pass data and layouts separately, we update the serializer
to directly take the Field&. This does a better job of maintaining
consistency with what data we are operating with. Also, it reduces the
number of places we expose FieldData, which is really an internal
implementation detail that we don't want readily exposed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the field serialization API to operate on Field<T>& (layout + data) instead of taking FieldData<T>& and FieldLayout separately, reducing FieldData exposure and keeping serialization consistent with the field’s active layout.

Changes:

  • Updated FieldSerializer and XGCFieldSerializer interfaces to accept Field<T>& directly.
  • Updated FieldCommunicator to call the new serializer API.
  • Consolidated several field serialization tests into a new test_field_serializer.cpp and removed now-redundant per-backend test cases.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/test_xgc_field_data.cpp Removes XGC-specific serializer test that is moved into the new consolidated serializer test file.
test/test_uniform_grid_field.cpp Removes uniform-grid serialization test (moved to consolidated serializer tests).
test/test_polynomial_reconstruction_function_space.cpp Removes polynomial-reconstruction serialization round-trip test (moved to consolidated serializer tests).
test/test_omega_h_lagrange_field.cpp Removes Omega_h serialization round-trip tests (moved to consolidated serializer tests).
test/test_field_serializer.cpp Adds consolidated serializer tests covering multiple backends (Omega_h, uniform grid, polynomial reconstruction, XGC).
test/field_test_utils.h Removes serializer-related helper(s) now replaced by the consolidated test implementation.
test/CMakeLists.txt Registers the new consolidated serializer test source file in the unit test build.
src/pcms/coupler/serializer/xgc.h Updates XGC serializer to accept Field<T>& and use the field’s layout/data bundle.
src/pcms/coupler/field_serializer.h Updates base serializer interface to accept Field<T>& and derive layout from the field.
src/pcms/coupler/field_communicator.hpp Updates communicator send/receive to use the new serializer API signature.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 21 to +22
auto data = field.GetDOFHolderDataHost();
auto owned = layout.GetOwnedHost();
auto owned = field.GetLayout().GetOwnedHost();
Comment thread src/pcms/coupler/serializer/xgc.h Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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