uwsampa / grappa

Grappa: scaling irregular applications on commodity clusters
grappa.io
BSD 3-Clause "New" or "Revised" License
159 stars 50 forks source link

Delegation order #296

Open bealwang opened 7 years ago

bealwang commented 7 years ago

Hello, I am confused about your intra-node MessageList design which use compare_and_swap to insert a outbound message. (https://github.com/uwsampa/grappa/blob/master/system/RDMAAggregator.hpp#L672)

So, the newer message will on the top of the older message in your messagelist like:

[new message] -> [old message] 

and I think we should reverse the MessageList before we process it since we should make sure that the older message should be handled first.

However, I did't find something like that, and I just see you use compare_and_swap to grab a messagelist and process it one by one. (https://github.com/uwsampa/grappa/blob/master/system/RDMAAggregator.hpp#L546)

bholt commented 7 years ago

Hi Genial,

I believe you are correct about the order in which operations get executed. They are reversed simply to make the task of keeping track of them simpler. But this is not incorrect behavior because there is no guarantee of order between concurrent delegate ops. Any time you want to ensure ordering between two delegates, you must have some synchronization. So blocking delegates in the same task are ordered. One could order these delegates as you suggested, but in general you still wouldn't have a guarantee that concurrent delegates would maintain their original order over the network.

Hope that helps.