Combining CRDTs and MPI (crdts.rs and rsmpi crates) #144
-
I am looking to combine CRDTs and MPI using the rsmpi crate. A previous discussion (#139) mentioned that we must serialize/deserialize the operations we want to send or receive. In my "hello-world" example using crdts and mpi, I am testing the use of a What I have tried is to create struct that contains |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi Dave, I believe the simplest way to hook this up would be to use a lightweight serialization format like bincode. let op = local_counter.inc(&rank);
let op_bytes: Vec<u8> = bincode::serialize(&ob).unwrap();
// you can then transmit op_bytes over the MPI communication channels
// on the receiving side
let decoded_op: Dot<mpi::Rank> = bincode::deserialize(&op_bytes).unwrap();
let local_counter.apply(decoded_op) Bincode is very lightweight so you should see minimal overhead in encoding/decoding. Plus you can avoid having to write your own Let me know if this works for you. David |
Beta Was this translation helpful? Give feedback.
-
Great! glad you got it working |
Beta Was this translation helpful? Give feedback.
Ok! Here is some working code to do point-to-point MPI sending
inc
operations to a replicated counter. I think it would make more sense (with resepect to Ops based CRDTs) to have all-to-all type broadcast or define a topology where eventually every message/op is seen by every replica, but I hope this serves as a naive example: