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
impl Communicator
sourcepub fn new_subset(ranks: &[usize]) -> Result<Self, StrError>
pub fn new_subset(ranks: &[usize]) -> Result<Self, StrError>
Allocates a new instance using a subset of processors
sourcepub fn abort(&mut self, error_code: i32) -> Result<(), StrError>
pub fn abort(&mut self, error_code: i32) -> Result<(), StrError>
Terminates the MPI execution environment
sourcepub fn rank(&mut self) -> Result<usize, StrError>
pub fn rank(&mut self) -> Result<usize, StrError>
Determines the rank of the calling process in the communicator
sourcepub fn size(&mut self) -> Result<usize, StrError>
pub fn size(&mut self) -> Result<usize, StrError>
Returns the size of the group associated with a communicator
sourcepub fn broadcast_i32(
&mut self,
sender: usize,
x: &mut [i32]
) -> Result<(), StrError>
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
sourcepub fn broadcast_i64(
&mut self,
sender: usize,
x: &mut [i64]
) -> Result<(), StrError>
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
sourcepub fn broadcast_u32(
&mut self,
sender: usize,
x: &mut [u32]
) -> Result<(), StrError>
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
sourcepub fn broadcast_u64(
&mut self,
sender: usize,
x: &mut [u64]
) -> Result<(), StrError>
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
sourcepub fn broadcast_usize(
&mut self,
sender: usize,
x: &mut [usize]
) -> Result<(), StrError>
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
sourcepub fn broadcast_f32(
&mut self,
sender: usize,
x: &mut [f32]
) -> Result<(), StrError>
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
sourcepub fn broadcast_f64(
&mut self,
sender: usize,
x: &mut [f64]
) -> Result<(), StrError>
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
sourcepub fn broadcast_c32(
&mut self,
sender: usize,
x: &mut [Complex32]
) -> Result<(), StrError>
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
sourcepub fn broadcast_c64(
&mut self,
sender: usize,
x: &mut [Complex64]
) -> Result<(), StrError>
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
sourcepub fn broadcast_bytes(
&mut self,
sender: usize,
x: &mut [u8]
) -> Result<(), StrError>
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
sourcepub fn reduce_i32(
&mut self,
root: usize,
dest: &mut [i32],
orig: &[i32],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn reduce_i64(
&mut self,
root: usize,
dest: &mut [i64],
orig: &[i64],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn reduce_u32(
&mut self,
root: usize,
dest: &mut [u32],
orig: &[u32],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn reduce_u64(
&mut self,
root: usize,
dest: &mut [u64],
orig: &[u64],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn reduce_usize(
&mut self,
root: usize,
dest: &mut [usize],
orig: &[usize],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn reduce_f32(
&mut self,
root: usize,
dest: &mut [f32],
orig: &[f32],
op: MpiOpReal
) -> Result<(), StrError>
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
sourcepub fn reduce_f64(
&mut self,
root: usize,
dest: &mut [f64],
orig: &[f64],
op: MpiOpReal
) -> Result<(), StrError>
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
sourcepub fn reduce_c32(
&mut self,
root: usize,
dest: &mut [Complex32],
orig: &[Complex32],
op: MpiOpComplex
) -> Result<(), StrError>
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
sourcepub fn reduce_c64(
&mut self,
root: usize,
dest: &mut [Complex64],
orig: &[Complex64],
op: MpiOpComplex
) -> Result<(), StrError>
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
sourcepub fn reduce_bytes(
&mut self,
root: usize,
dest: &mut [u8],
orig: &[u8],
op: MpiOpByte
) -> Result<(), StrError>
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
sourcepub fn allreduce_i32(
&mut self,
dest: &mut [i32],
orig: &[i32],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn allreduce_i64(
&mut self,
dest: &mut [i64],
orig: &[i64],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn allreduce_u32(
&mut self,
dest: &mut [u32],
orig: &[u32],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn allreduce_u64(
&mut self,
dest: &mut [u64],
orig: &[u64],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn allreduce_usize(
&mut self,
dest: &mut [usize],
orig: &[usize],
op: MpiOpInt
) -> Result<(), StrError>
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
sourcepub fn allreduce_f32(
&mut self,
dest: &mut [f32],
orig: &[f32],
op: MpiOpReal
) -> Result<(), StrError>
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
sourcepub fn allreduce_f64(
&mut self,
dest: &mut [f64],
orig: &[f64],
op: MpiOpReal
) -> Result<(), StrError>
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
sourcepub fn allreduce_c32(
&mut self,
dest: &mut [Complex32],
orig: &[Complex32],
op: MpiOpComplex
) -> Result<(), StrError>
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
sourcepub fn allreduce_c64(
&mut self,
dest: &mut [Complex64],
orig: &[Complex64],
op: MpiOpComplex
) -> Result<(), StrError>
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
sourcepub fn allreduce_bytes(
&mut self,
dest: &mut [u8],
orig: &[u8],
op: MpiOpByte
) -> Result<(), StrError>
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
sourcepub fn get_receive_status(&mut self) -> (i32, i32, i32)
pub fn get_receive_status(&mut self) -> (i32, i32, i32)
Returns the status of the last receive call
sourcepub fn send_i32(
&mut self,
data: &[i32],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_i32( &mut self, data: &[i32], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn send_i64(
&mut self,
data: &[i64],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_i64( &mut self, data: &[i64], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn send_u32(
&mut self,
data: &[u32],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_u32( &mut self, data: &[u32], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn send_u64(
&mut self,
data: &[u64],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_u64( &mut self, data: &[u64], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn send_usize(
&mut self,
data: &[usize],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_usize( &mut self, data: &[usize], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn send_f32(
&mut self,
data: &[f32],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_f32( &mut self, data: &[f32], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn send_f64(
&mut self,
data: &[f64],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_f64( &mut self, data: &[f64], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn send_c32(
&mut self,
data: &[Complex32],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_c32( &mut self, data: &[Complex32], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn send_c64(
&mut self,
data: &[Complex64],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_c64( &mut self, data: &[Complex64], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn send_bytes(
&mut self,
data: &[u8],
to_rank: usize,
tag: i32
) -> Result<(), StrError>
pub fn send_bytes( &mut self, data: &[u8], to_rank: usize, tag: i32 ) -> Result<(), StrError>
Performs a standard-mode blocking send
sourcepub fn receive_i32(
&mut self,
data: &mut [i32],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)
sourcepub fn receive_i64(
&mut self,
data: &mut [i64],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)
sourcepub fn receive_u32(
&mut self,
data: &mut [u32],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)
sourcepub fn receive_u64(
&mut self,
data: &mut [u64],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)
sourcepub fn receive_usize(
&mut self,
data: &mut [usize],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)
sourcepub fn receive_f32(
&mut self,
data: &mut [f32],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)
sourcepub fn receive_f64(
&mut self,
data: &mut [f64],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)
sourcepub fn receive_c32(
&mut self,
data: &mut [Complex32],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)
sourcepub fn receive_c64(
&mut self,
data: &mut [Complex64],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)
sourcepub fn receive_bytes(
&mut self,
data: &mut [u8],
from_rank: i32,
tag: i32
) -> Result<(), StrError>
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)