chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.79k stars 421 forks source link

comm=ofi completion #12264

Open gbtitus opened 5 years ago

gbtitus commented 5 years ago

The ofi comm layer "implements" the whole comm interface in the sense that all the functions are present and any Chapel program will link. But a number of the functions are implemented such that although they work functionally they don't behave exactly as implied or expected. For example, chpl_comm_get_nb() actually does a blocking GET, not a nonblocking one. Here we list what still needs doing.

gbtitus commented 5 years ago

I just sent a question to libfabric-users@lists.openfabrics.org asking about libfabric and processor/network atomic operation non-coherence.

gbtitus commented 5 years ago

We have an authoritative response on atomic coherence. Basically, see the paragraph on visibility in the fi_atomic(3) man page (which is going to be updated for clarity, also). For the Chapel comm layer, which does not request target-side completions, atomic results are guaranteed to be visible when the associated completion is seen on the initiating side. Achieving coherence for a given location, when multiple target-side actors (NIC and CPU, or multiple NICs) are performing AMOs on that location, requires that all ops done by one actor must be visible (completions seen) before any ops are initiated by another actor.

An implication of this rule is that if the provider says it can do network AMOs for at least one kind of operation on a given location (non-fetching, fetching, or comparison) but it also cannot do network AMOs for at least one other kind of operation, then the comm layer needs to limit itself to non-network operations for all ops on that location. An easier version of this is that when we're deciding whether to do a network AMO or a processor AMO via AM, we have to choose the latter unless the provider says it can do all operations of concern to us using the network. Otherwise we can end up with one initiator doing one kind of AMO and another initiator doing a different kind of AMO, to the same location, using different techniques (network or processor-via-AM) but not synchronizing, thus breaking the coherence protocol.

gbtitus commented 2 years ago

I think one could make the argument that comm=ofi is "complete" in the sense that it passes testing on several different network architectures with different providers. Not everything in the description block has been done, but much of what's not done yet can be viewed as functionally good enough, or else a performance improvement. So, I'm removing myself as the assignee but leaving this open for the group to make the decision.