Coupler transfer API#337
Draft
jacobmerson wants to merge 31 commits into
Draft
Conversation
jacobmerson
force-pushed
the
jacobmerson/field-function-split
branch
from
July 12, 2026 18:29
c74eefe to
bcb83df
Compare
jacobmerson
force-pushed
the
jacobmerson/coupler-transfer-api
branch
2 times, most recently
from
July 12, 2026 20:09
15b2bea to
01f44e5
Compare
jacobmerson
force-pushed
the
jacobmerson/field-function-split
branch
2 times, most recently
from
July 12, 2026 22:50
0716c22 to
a16f1ea
Compare
jacobmerson
force-pushed
the
jacobmerson/coupler-transfer-api
branch
from
July 12, 2026 22:50
01f44e5 to
e94d943
Compare
…trix / load_vector) Squashed original commits: 0a27b53, 0c0e697
…nsfer Squashed original commits: bad8434, eca15d1, b4af186, 26f35c6, b8baf3b, 6b1d7f2, dba7966, 5baf365, 4b00ac1 (mesh_fields_rhs_integrator churn from 26f35c6/b8baf3b dropped)
Squashed original commits: 844dc1c, b4a4545, 629419f (sobol_sequence churn dropped)
…y buffers Squashed original commits: e7488c6, 4e68c80
…fter #308) Squashed original commit: 75a3045
Currently the petsc-based solver is only needed for conservative projection which requires MeshFields. So petsc is only linked when PCMS_ENABLE_PETSC and PCMS_ENABLE_MESHFIELDS
Add a shared, format-agnostic GID-to-local permutation and use it so the transfer operators handle sparse or reordered global IDs correctly. This allows us to reuse the global-to-local mapping for things outside of the serialization such as setting up the petsc arrays.
…olders Split the GID (layout) message from the field (data) message and reuse the field GID-permutation primitives so exchanges handle overlap masks and reordered global IDs without corrupting payloads.
The python pcms module links libpetsc.so dynamically when python_api is ON, so PETSc lib dir must be on LD_LIBRARY_PATH for import to succeed.
clang-tidy bugprone-implicit-widening-of-multiplication-result (treated as error) flagged int*int products used to size 64-bit Views in the intersection/MC RHS integrators and the field-exchange-planner test. Perform the multiplication in size_t via an explicit cast.
Forward-declare the RHS integrators
We had kokkos lambdas in private functions which does not compile.
First pass is to just make a host mirror. Long term, we need to ask PETSc team if there is a better way to handle this.
The idea is as follows: a function space creates a function. A Function<T> represents an object that can be evaluated. A Function<T> is a Field<T>. A Field<T> itself does not have evaluation capabilities, but has everything needed to be sent over the network.
We had transfer in coupler a few years ago, but everything was compile time/type erasure so it made things very difficult to acomplish. This time around (pcms2) is taking a different approach and that seems to be leading us in a fairly positive direction in terms of usability.
naming model, removing AddLayout. Our goal was to remove the need for AddLayout and forcing the user to *know* what layouts they needed to add. This was the simplest strategy of the ones we tested. It also aligns to the idea that fields are likely to have names anyways. So, having a field and layout both have names allows convenient cacheing of the layout communicator and naming of fields that follows on its construction.
test_coupler_transfer.cpp pulls in the PETSc-dependent transfer headers, so the target cannot compile when PETSc is disabled. Guard it like the other transfer tests (PCMS_ENABLE_PETSC AND PCMS_ENABLE_MESHFIELDS).
With Function<T> being the object that handles evaluatable fields and Field<T> being the non-evaluatable object that can be used for sending over the network. This commit makes the function naming/usage consisent.
jacobmerson
force-pushed
the
jacobmerson/field-function-split
branch
from
July 13, 2026 07:11
a16f1ea to
fed617a
Compare
jacobmerson
force-pushed
the
jacobmerson/coupler-transfer-api
branch
from
July 13, 2026 07:11
e94d943 to
be23975
Compare
Give TransferOperator a protected constructor that stores the source and target function spaces it is built for, exposed via SourceSpace()/ TargetSpace(). This makes the space-to-space contract explicit and lets callers verify a bound field's space matches the operator before applying it.
jacobmerson
changed the base branch from
jacobmerson/field-function-split
to
develop
July 21, 2026 09:14
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.
Brings field transfer back into the coupler API. PCMS had transfer in the coupler years ago, but it was compile-time / type-erased and hard to work with; this is the pcms2 take with a more usable design.
Highlights:
Couplertransfer API +transfer/transfer_method.hpptest_coupler_transfer.cppend-to-end coverageBase is
jacobmerson/field-function-split(#336). Retarget to develop once that's merged.