use std::rc::Rc;
use mpi::traits::Communicator;
use crate::distributed_tools::IndexLayout;
pub trait GatherToAll {
type Output;
fn gather_to_all(&self) -> Self::Output;
}
pub trait GatherToOne {
type Output;
fn gather_to_one(&self, root: usize);
fn gather_to_one_root(&self) -> Self::Output;
}
pub trait ScatterFromOne {
type Output<'a, C>
where
C: 'a,
C: Communicator;
fn scatter_from_one_root<'a, C: Communicator>(
&self,
index_layout: Rc<IndexLayout<'a, C>>,
) -> Self::Output<'a, C>;
fn scatter_from_one<'a, C: Communicator>(
root: usize,
index_layout: Rc<IndexLayout<'a, C>>,
) -> Self::Output<'a, C>;
}