Skip to content

Combining CRDTs and MPI (crdts.rs and rsmpi crates) #144

Answered by DaveLanday
DaveLanday asked this question in Q&A
Discussion options

You must be logged in to vote

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:

use bincode;
#[allow(unused_imports)]
use crdts::{CmRDT, Dot, GCounter};
use mpi::request::WaitGuard;
use mpi::traits::*;
use rand::{thread_rng, Rng};
use std::{thread, time};

fn main() {
    #[allow(unused_variables)]
    // number of fake jobs to process (i.e: count up to this number)
    const NJOBS: u16 = 2000;

    // Represents the worst time job can take to …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@DaveLanday
Comment options

@davidrusu
Comment options

@DaveLanday
Comment options

@DaveLanday
Comment options

Answer selected by DaveLanday
Comment options

You must be logged in to vote
1 reply
@DaveLanday
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants