Make both src and dst call back when ready #644
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.
This modifies mesh-to-mesh transfer so that both the src and the dst side call back to client code when each is ready, as opposed to the previous solution which only called back from dst when a transfer step was done.
This simplifies client code logic after a transfer step and also enables to/from transfer with meshes using unequal number of chares. This can happen using different virtualization for different meshes or using the same virtualization but for meshes with significantly different number of elements. As far as I know, the former has not been exercised so far, since this is not exposed to the user, while the latter may happen but has not occurred due to limited testing using virtualization (and in parallel).
Note that I only modified the code immediately before and after a transfer step (in Discretization), and did not attempt to remove the global sync between the 'to' and 'from' transfer steps because that would tie in with logic in OversetFE::setTransferFlags(). It is possible that this global sync could be removed in the future, because my implementation of this same idea in xyst, where client code is still a bit simpler, works without this global sync.
More testing would be good. In particular, setting unequal virtualization for different meshes could be exposed to the user and that would allow testing that case as well (which was the original use case triggered the problem being solved in the first place).
This change is