Struct msgpass::Communicator

source ·
pub struct Communicator { /* private fields */ }
Expand description

Implements the Rust communicator (wrapping the C data)

This struct holds a pointer to the C communicator, which stores the communicator (MPI_Comm), the group (MPI_Group), and the status from recv calls (MPI_Status).

Implementations§

source§

impl Communicator

source

pub fn new() -> Result<Self, StrError>

Allocates a new instance

source

pub fn new_subset(ranks: &[usize]) -> Result<Self, StrError>

Allocates a new instance using a subset of processors

source

pub fn abort(&mut self, error_code: i32) -> Result<(), StrError>

Terminates the MPI execution environment

source

pub fn barrier(&mut self) -> Result<(), StrError>

Synchronizes the MPI processes

source

pub fn rank(&mut self) -> Result<usize, StrError>

Determines the rank of the calling process in the communicator

source

pub fn size(&mut self) -> Result<usize, StrError>

Returns the size of the group associated with a communicator

source

pub fn broadcast_i32( &mut self, sender: usize, x: &mut [i32] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn broadcast_i64( &mut self, sender: usize, x: &mut [i64] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn broadcast_u32( &mut self, sender: usize, x: &mut [u32] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn broadcast_u64( &mut self, sender: usize, x: &mut [u64] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn broadcast_usize( &mut self, sender: usize, x: &mut [usize] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn broadcast_f32( &mut self, sender: usize, x: &mut [f32] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn broadcast_f64( &mut self, sender: usize, x: &mut [f64] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn broadcast_c32( &mut self, sender: usize, x: &mut [Complex32] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn broadcast_c64( &mut self, sender: usize, x: &mut [Complex64] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn broadcast_bytes( &mut self, sender: usize, x: &mut [u8] ) -> Result<(), StrError>

Broadcasts a message from sender to all other processes in the group

source

pub fn reduce_i32( &mut self, root: usize, dest: &mut [i32], orig: &[i32], op: MpiOpInt ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn reduce_i64( &mut self, root: usize, dest: &mut [i64], orig: &[i64], op: MpiOpInt ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn reduce_u32( &mut self, root: usize, dest: &mut [u32], orig: &[u32], op: MpiOpInt ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn reduce_u64( &mut self, root: usize, dest: &mut [u64], orig: &[u64], op: MpiOpInt ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn reduce_usize( &mut self, root: usize, dest: &mut [usize], orig: &[usize], op: MpiOpInt ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn reduce_f32( &mut self, root: usize, dest: &mut [f32], orig: &[f32], op: MpiOpReal ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn reduce_f64( &mut self, root: usize, dest: &mut [f64], orig: &[f64], op: MpiOpReal ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn reduce_c32( &mut self, root: usize, dest: &mut [Complex32], orig: &[Complex32], op: MpiOpComplex ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn reduce_c64( &mut self, root: usize, dest: &mut [Complex64], orig: &[Complex64], op: MpiOpComplex ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn reduce_bytes( &mut self, root: usize, dest: &mut [u8], orig: &[u8], op: MpiOpByte ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn allreduce_i32( &mut self, dest: &mut [i32], orig: &[i32], op: MpiOpInt ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn allreduce_i64( &mut self, dest: &mut [i64], orig: &[i64], op: MpiOpInt ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn allreduce_u32( &mut self, dest: &mut [u32], orig: &[u32], op: MpiOpInt ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn allreduce_u64( &mut self, dest: &mut [u64], orig: &[u64], op: MpiOpInt ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn allreduce_usize( &mut self, dest: &mut [usize], orig: &[usize], op: MpiOpInt ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn allreduce_f32( &mut self, dest: &mut [f32], orig: &[f32], op: MpiOpReal ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn allreduce_f64( &mut self, dest: &mut [f64], orig: &[f64], op: MpiOpReal ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn allreduce_c32( &mut self, dest: &mut [Complex32], orig: &[Complex32], op: MpiOpComplex ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn allreduce_c64( &mut self, dest: &mut [Complex64], orig: &[Complex64], op: MpiOpComplex ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn allreduce_bytes( &mut self, dest: &mut [u8], orig: &[u8], op: MpiOpByte ) -> Result<(), StrError>

Combines values from all processes and distributes the result back to all processes

source

pub fn get_receive_status(&mut self) -> (i32, i32, i32)

Returns the status of the last receive call

source

pub fn send_i32( &mut self, data: &[i32], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn send_i64( &mut self, data: &[i64], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn send_u32( &mut self, data: &[u32], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn send_u64( &mut self, data: &[u64], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn send_usize( &mut self, data: &[usize], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn send_f32( &mut self, data: &[f32], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn send_f64( &mut self, data: &[f64], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn send_c32( &mut self, data: &[Complex32], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn send_c64( &mut self, data: &[Complex64], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn send_bytes( &mut self, data: &[u8], to_rank: usize, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking send

source

pub fn receive_i32( &mut self, data: &mut [i32], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn receive_i64( &mut self, data: &mut [i64], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn receive_u32( &mut self, data: &mut [u32], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn receive_u64( &mut self, data: &mut [u64], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn receive_usize( &mut self, data: &mut [usize], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn receive_f32( &mut self, data: &mut [f32], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn receive_f64( &mut self, data: &mut [f64], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn receive_c32( &mut self, data: &mut [Complex32], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn receive_c64( &mut self, data: &mut [Complex64], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn receive_bytes( &mut self, data: &mut [u8], from_rank: i32, tag: i32 ) -> Result<(), StrError>

Performs a standard-mode blocking receive

data – Buffer to store the received data from_rank – Rank from where the data was sent (a negative value corresponds to MPI_ANY_SOURCE) tag – Tag of the message (a negative value corresponds to MPI_ANY_TAG)

source

pub fn gather_i32( &mut self, root: usize, dest: Option<&mut [i32]>, orig: &[i32] ) -> Result<(), StrError>

source

pub fn gather_i64( &mut self, root: usize, dest: Option<&mut [i64]>, orig: &[i64] ) -> Result<(), StrError>

source

pub fn gather_u32( &mut self, root: usize, dest: Option<&mut [u32]>, orig: &[u32] ) -> Result<(), StrError>

source

pub fn gather_u64( &mut self, root: usize, dest: Option<&mut [u64]>, orig: &[u64] ) -> Result<(), StrError>

source

pub fn gather_usize( &mut self, root: usize, dest: Option<&mut [usize]>, orig: &[usize] ) -> Result<(), StrError>

source

pub fn gather_f32( &mut self, root: usize, dest: Option<&mut [f32]>, orig: &[f32] ) -> Result<(), StrError>

source

pub fn gather_f64( &mut self, root: usize, dest: Option<&mut [f64]>, orig: &[f64] ) -> Result<(), StrError>

source

pub fn gather_c32( &mut self, root: usize, dest: Option<&mut [Complex32]>, orig: &[Complex32] ) -> Result<(), StrError>

source

pub fn gather_c64( &mut self, root: usize, dest: Option<&mut [Complex64]>, orig: &[Complex64] ) -> Result<(), StrError>

source

pub fn gather_bytes( &mut self, root: usize, dest: Option<&mut [u8]>, orig: &[u8] ) -> Result<(), StrError>

source

pub fn allgather_i32( &mut self, dest: &mut [i32], orig: &[i32] ) -> Result<(), StrError>

source

pub fn allgather_i64( &mut self, dest: &mut [i64], orig: &[i64] ) -> Result<(), StrError>

source

pub fn allgather_usize( &mut self, dest: &mut [usize], orig: &[usize] ) -> Result<(), StrError>

source

pub fn allgather_u32( &mut self, dest: &mut [u32], orig: &[u32] ) -> Result<(), StrError>

source

pub fn allgather_u64( &mut self, dest: &mut [u64], orig: &[u64] ) -> Result<(), StrError>

source

pub fn allgather_f32( &mut self, dest: &mut [f32], orig: &[f32] ) -> Result<(), StrError>

source

pub fn allgather_f64( &mut self, dest: &mut [f64], orig: &[f64] ) -> Result<(), StrError>

source

pub fn allgather_c32( &mut self, dest: &mut [Complex32], orig: &[Complex32] ) -> Result<(), StrError>

source

pub fn allgather_c64( &mut self, dest: &mut [Complex64], orig: &[Complex64] ) -> Result<(), StrError>

source

pub fn allgather_bytes( &mut self, dest: &mut [u8], orig: &[u8] ) -> Result<(), StrError>

source

pub fn scatter_i32( &mut self, root: usize, dest: &mut [i32], orig: Option<&[i32]> ) -> Result<(), StrError>

source

pub fn scatter_i64( &mut self, root: usize, dest: &mut [i64], orig: Option<&[i64]> ) -> Result<(), StrError>

source

pub fn scatter_u32( &mut self, root: usize, dest: &mut [u32], orig: Option<&[u32]> ) -> Result<(), StrError>

source

pub fn scatter_u64( &mut self, root: usize, dest: &mut [u64], orig: Option<&[u64]> ) -> Result<(), StrError>

source

pub fn scatter_usize( &mut self, root: usize, dest: &mut [usize], orig: Option<&[usize]> ) -> Result<(), StrError>

source

pub fn scatter_f32( &mut self, root: usize, dest: &mut [f32], orig: Option<&[f32]> ) -> Result<(), StrError>

source

pub fn scatter_f64( &mut self, root: usize, dest: &mut [f64], orig: Option<&[f64]> ) -> Result<(), StrError>

source

pub fn scatter_c32( &mut self, root: usize, dest: &mut [Complex32], orig: Option<&[Complex32]> ) -> Result<(), StrError>

source

pub fn scatter_c64( &mut self, root: usize, dest: &mut [Complex64], orig: Option<&[Complex64]> ) -> Result<(), StrError>

source

pub fn scatter_bytes( &mut self, root: usize, dest: &mut [u8], orig: Option<&[u8]> ) -> Result<(), StrError>

Trait Implementations§

source§

impl Drop for Communicator

source§

fn drop(&mut self)

Deallocates the C memory

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.