Use Field with serializer - #362
Open
jacobmerson wants to merge 2 commits into
Open
Conversation
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.
Contributor
There was a problem hiding this comment.
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
FieldSerializerandXGCFieldSerializerinterfaces to acceptField<T>&directly. - Updated
FieldCommunicatorto call the new serializer API. - Consolidated several field serialization tests into a new
test_field_serializer.cppand 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(); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.