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 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 reduce_i32( &mut self, root: usize, dest: &mut [i32], orig: &[i32], op: MpiOp ) -> 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: MpiOp ) -> 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: MpiOp ) -> 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: MpiOp ) -> 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: MpiOp ) -> 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: MpiOpx ) -> 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: MpiOpx ) -> Result<(), StrError>

Reduces values on all processes within a group

source

pub fn allreduce_i32( &mut self, dest: &mut [i32], orig: &[i32], op: MpiOp ) -> 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: MpiOp ) -> 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: MpiOp ) -> 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: MpiOp ) -> 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: MpiOp ) -> 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: MpiOpx ) -> 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: MpiOpx ) -> 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 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)

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.