[Chapel Merge] Return fetching AMO result via AM

Branch: refs/heads/main
Revision: 4e12184
Author: jhh67
Link: Return fetching AMO result via AM by jhh67 · Pull Request #19233 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19233 from jhh67/T2821.1

Return fetching AMO result via AM

On networks that do not support atomic operations (AMO) natively the Chapel runtime implements them using active messages (AM). For fetching AMOs (FAMO) the AM handler must return the result of the operation and also set a "done" flag indicating that the result is valid. Previously, the handler did this by doing a PUT of the result back to the initiator locale, performing whatever actions are necessary based on the MCM mode to ensure the PUT is visible, then doing a non-blocking PUT of the done flag. If the MCM mode is delivery-complete the PUT of the result will require one round-trip network latency before the done is PUT. With this change the handler sends a non-blocking AM back to the initiator when possible, which sets the result and the done flag, avoiding the network latency and eliminating one network transfer.

[Reviewed by @ronawho and @gbtitus]

Modified Files:
M runtime/src/comm/ofi/comm-ofi.c

Compare: https://github.com/chapel-lang/chapel/compare/7279503041f5...4e121847034f