Camure
High-performance 1-to-many communication and synchronization primitives using UDP multicast.
This crates provides a set of communication and synchronization primitives similar to the collective communication routines found in MPI. In contrast to MPI, this crates allows for more flexible communication patterns without sacrificing performance and is designed to be used in mid-sized distributed systems. The underlying protocol is session based which allows nodes to join and leave at any time. One node explicitly takes over the role of the session coordinator and is responsible for creating the session. All other nodes must join the session as a member.
Getting Started
If you use Rust you can add camure as dependency using:
If you want to use the library from languages other than Rust, please take a look at camure-ffi.
Below are a few examples that will get you started quickly. The full documentation can be found here.
Barrier Groups
Coordinator
use Coordinator;
let bind_addr = "192.168.0.100:12345".parse?;
let multicast_addr = "234.0.0.0:55555".parse?;
let coordinator = start_session?;
let mut barrier_group_coordinator = coordinator.create_barrier_group?;
barrier_group_coordinator.accept?;
for _ in 0..1000
Member
use Member;
let coordinator_addr = "192.168.0.100:12345".parse?;
let member = join_session?;
let mut barrier_group_member = member.join_barrier_group?;
for _ in 0..1000
Broadcast Groups
Coordinator
use Coordinator;
use Write;
let bind_addr = "192.168.0.100:12345".parse?;
let multicast_addr = "234.0.0.0:55555".parse?;
let coordinator = start_session?;
let mut sender = coordinator.create_broadcast_group?;
sender.accept.unwrap;
for _ in 0..1000
sender.wait?;
Member
use Member;
use Read;
let coordinator_addr = "192.168.0.100:12345".parse?;
let member = join_session?;
let mut receiver = member.join_broadcast_group.unwrap;
for _ in 0..1000