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§
Sourcefn broadcast<T>(&self, data: &mut [T], root: i32) -> ScirsResult<()>
fn broadcast<T>(&self, data: &mut [T], root: i32) -> ScirsResult<()>
Broadcast data from root to all processes
Sourcefn gather<T>(
&self,
send_data: &[T],
recv_data: Option<&mut [T]>,
root: i32,
) -> ScirsResult<()>
fn gather<T>( &self, send_data: &[T], recv_data: Option<&mut [T]>, root: i32, ) -> ScirsResult<()>
Gather data from all processes to root
Sourcefn allreduce<T>(
&self,
send_data: &[T],
recv_data: &mut [T],
op: ReductionOp,
) -> ScirsResult<()>
fn allreduce<T>( &self, send_data: &[T], recv_data: &mut [T], op: ReductionOp, ) -> ScirsResult<()>
All-to-all reduction operation
Sourcefn barrier(&self) -> ScirsResult<()>
fn barrier(&self) -> ScirsResult<()>
Barrier synchronization
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.