Collectives

Trait Collectives 

Source
pub trait Collectives:
    Sealed
    + Send
    + Sync {
    // Required methods
    fn rank(&self) -> u32;
    fn size(&self) -> u32;
    fn allreduce_max_u8(&self, v: u8) -> u8;
    fn allreduce_sum_u64(&self, buffer: &mut [u64]);
    fn allreduce_sum_f64(&self, buffer: &mut [f64]);
    fn barrier(&self);

    // Provided method
    fn check_consistency(&self, fingerprint: u64) { ... }
}
Expand description

The group operations a partition needs besides the exchange: its rank, the reductions, and a barrier.

Every partition must issue the identical sequence of collective and transport calls, and every reduction must return the identical value on every partition. Sealed: implemented only by the in-process, solo and mpi::MpiTransport transports.

Required Methods§

Source

fn rank(&self) -> u32

This partition’s index in the group, 0 <= rank < size.

Source

fn size(&self) -> u32

Number of partitions in the group.

Source

fn allreduce_max_u8(&self, v: u8) -> u8

Maximum of v over the group.

Source

fn allreduce_sum_u64(&self, buffer: &mut [u64])

Element-wise wrapping sum of buffer over the group, in place; every partition passes the same length.

Source

fn allreduce_sum_f64(&self, buffer: &mut [f64])

Element-wise sum of buffer over the group, in place, bitwise identical on every partition.

The combination order is the implementation’s, so the result may differ by rounding from a serial sum; a slot only one partition fills is exact.

Source

fn barrier(&self)

Block until every partition has arrived.

Provided Methods§

Source

fn check_consistency(&self, fingerprint: u64)

Panic unless every partition passed the same fingerprint; one collective.

Implementors§