Skip to main content

MPIInterface

Trait MPIInterface 

Source
pub trait MPIInterface {
    // Required methods
    fn rank(&self) -> i32;
    fn size(&self) -> i32;
    fn broadcast<T>(&self, data: &mut [T], root: i32) -> ScirsResult<()>
       where T: Clone + Send + Sync;
    fn gather<T>(
        &self,
        send_data: &[T],
        recv_data: Option<&mut [T]>,
        root: i32,
    ) -> ScirsResult<()>
       where T: Clone + Send + Sync;
    fn allreduce<T>(
        &self,
        send_data: &[T],
        recv_data: &mut [T],
        op: ReductionOp,
    ) -> ScirsResult<()>
       where T: Clone + Send + Sync + Add<Output = T> + PartialOrd;
    fn barrier(&self) -> ScirsResult<()>;
    fn send<T>(&self, data: &[T], dest: i32, tag: i32) -> ScirsResult<()>
       where T: Clone + Send + Sync;
    fn recv<T>(&self, data: &mut [T], source: i32, tag: i32) -> ScirsResult<()>
       where T: Clone + Send + Sync;
}
Expand description

MPI interface abstraction for distributed optimization

Required Methods§

Source

fn rank(&self) -> i32

Get the rank of this process

Source

fn size(&self) -> i32

Get the total number of processes

Source

fn broadcast<T>(&self, data: &mut [T], root: i32) -> ScirsResult<()>
where T: Clone + Send + Sync,

Broadcast data from root to all processes

Source

fn gather<T>( &self, send_data: &[T], recv_data: Option<&mut [T]>, root: i32, ) -> ScirsResult<()>
where T: Clone + Send + Sync,

Gather data from all processes to root

Source

fn allreduce<T>( &self, send_data: &[T], recv_data: &mut [T], op: ReductionOp, ) -> ScirsResult<()>
where T: Clone + Send + Sync + Add<Output = T> + PartialOrd,

All-to-all reduction operation

Source

fn barrier(&self) -> ScirsResult<()>

Barrier synchronization

Source

fn send<T>(&self, data: &[T], dest: i32, tag: i32) -> ScirsResult<()>
where T: Clone + Send + Sync,

Send data to specific process

Source

fn recv<T>(&self, data: &mut [T], source: i32, tag: i32) -> ScirsResult<()>
where T: Clone + Send + Sync,

Receive data from specific process

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§