Struct CartesianCommunicator

Source
pub struct CartesianCommunicator(/* private fields */);
Expand description

A CartesianCommunicator is an MPI communicator object where ranks are laid out in an n-dimensional cartesian space. This gives ranks neighbors in each of those dimensions, and MPI is able to optimize the layout of these ranks to improve physical locality.

§Standard Section(s)

7

Implementations§

Source§

impl CartesianCommunicator

Source

pub unsafe fn from_raw(raw: MPI_Comm) -> Option<CartesianCommunicator>

Given a valid MPI_Comm handle in raw, returns a CartesianCommunicator value if, and only if:

  • The handle is not MPI_COMM_NULL
  • The topology of the communicator is MPI_CART

Otherwise returns None.

§Parameters
  • raw - Handle to a valid MPI_Comm object
§Safety
  • raw must be a live MPI_Comm object.
  • raw must not be used after calling from_raw.
Source

pub unsafe fn from_raw_unchecked(raw: MPI_Comm) -> CartesianCommunicator

Creates a CartesianCommunicator from raw.

§Parameters
  • raw - Handle to a valid MPI_CART MPI_Comm object
§Safety
  • raw must be a live MPI_Comm object.
  • raw must not be used after calling from_raw_unchecked.
  • raw must not be MPI_COMM_NULL.
§Panics

raw must not be RSMPI_COMM_NULL

Source

pub fn num_dimensions(&self) -> Count

Returns the number of dimensions that the Cartesian communicator was established over.

§Standard section(s)

7.5.5 MPI_Cartdim_get

Examples found in repository?
examples/cartesian.rs (line 28)
7fn main() {
8    let universe = mpi::initialize().unwrap();
9
10    let comm = universe.world();
11
12    if comm.size() < 4 {
13        return;
14    }
15
16    let cart_comm = {
17        let dims = [2, 2];
18        let periodic = [false, true];
19        let reorder = true;
20        if let Some(cart_comm) = comm.create_cartesian_communicator(&dims, &periodic, reorder) {
21            cart_comm
22        } else {
23            assert!(comm.rank() >= 4);
24            return;
25        }
26    };
27
28    assert_eq!(2, cart_comm.num_dimensions());
29
30    let mpi::topology::CartesianLayout {
31        dims,
32        periods,
33        coords,
34    } = cart_comm.get_layout();
35
36    assert_eq!([2 as mpi::Count, 2], &dims[..]);
37    assert_eq!([false, true], &periods[..]);
38
39    let xrank = coords[0];
40    let yrank = coords[1];
41
42    assert!(0 <= xrank && xrank < 2);
43    assert!(0 <= yrank && yrank < 2);
44
45    let xcomm = cart_comm.subgroup(&[true, false]);
46    let ycomm = cart_comm.subgroup(&[false, true]);
47
48    assert_eq!(2, xcomm.size());
49    assert_eq!(xrank, xcomm.rank());
50
51    assert_eq!(2, ycomm.size());
52    assert_eq!(yrank, ycomm.rank());
53
54    // the first dimension is non-periodic
55    let (x_src, x_dest) = cart_comm.shift(0, 1);
56    if xrank == 0 {
57        assert!(x_src.is_none());
58        assert!(x_dest.is_some());
59
60        let coords = cart_comm.rank_to_coordinates(x_dest.unwrap());
61        assert_eq!(1, coords[0]);
62    } else {
63        assert_eq!(1, xrank);
64
65        assert!(x_src.is_some());
66        assert!(x_dest.is_none());
67
68        let coords = cart_comm.rank_to_coordinates(x_src.unwrap());
69        assert_eq!(0, coords[0]);
70    }
71
72    // the second dimension is periodic
73    {
74        let (y_src, y_dest) = cart_comm.shift(1, 1);
75        assert!(y_src.is_some());
76        assert!(y_dest.is_some());
77
78        let y_src_coords = cart_comm.rank_to_coordinates(y_src.unwrap());
79        assert_eq!((yrank - 1) & 0b1, y_src_coords[1]);
80
81        let y_dest_coords = cart_comm.rank_to_coordinates(y_dest.unwrap());
82        assert_eq!((yrank + 1) & 0b1, y_dest_coords[1]);
83    }
84
85    // second dimension shift by 2 should be identity
86    {
87        let (y_src, y_dest) = cart_comm.shift(1, 2);
88        assert_eq!(comm.rank(), y_src.unwrap());
89        assert_eq!(comm.rank(), y_dest.unwrap());
90    }
91}
Source

pub unsafe fn get_layout_into_unchecked( &self, dims: &mut [Count], periods: &mut [bool], coords: &mut [Count], )

Returns the topological structure of the Cartesian communicator

Prefer get_layout_into

§Parameters
  • dims - array of spatial extents for the cartesian space
  • periods - Must match length of dims. periods[i] indicates if axis i is periodic. i.e. if true, the element at dims[i] - 1 in axis i is a neighbor of element 0 in axis i
  • coords - coords[i] is the location offset in axis i of this rank
§Standard section(s)

7.5.5 MPI_Cart_get

§Safety

Behavior is undefined if dims, periods, and coords are not of length num_dimensions.

§Panics

Invalid boolean value ({}) from the MPI implementation

Source

pub fn get_layout_into( &self, dims: &mut [Count], periods: &mut [bool], coords: &mut [Count], )

Returns the topological structure of the Cartesian communicator

§Panics

if dims, periods, and coords are not of length num_dimensions.

§Parameters
  • dims - array of spatial extents for the cartesian space
  • periods - Must match length of dims. periods[i] indicates if axis i is periodic. i.e. if true, the element at dims[i] - 1 in axis i is a neighbor of element 0 in axis i
  • coords - coords[i] is the location offset in axis i of this rank
§Standard section(s)

7.5.5 MPI_Cart_get

Source

pub fn get_layout(&self) -> CartesianLayout

Returns the topological structure of the Cartesian communicator

§Standard section(s)

7.5.5 [MPI_Cart_get]

Examples found in repository?
examples/cartesian.rs (line 34)
7fn main() {
8    let universe = mpi::initialize().unwrap();
9
10    let comm = universe.world();
11
12    if comm.size() < 4 {
13        return;
14    }
15
16    let cart_comm = {
17        let dims = [2, 2];
18        let periodic = [false, true];
19        let reorder = true;
20        if let Some(cart_comm) = comm.create_cartesian_communicator(&dims, &periodic, reorder) {
21            cart_comm
22        } else {
23            assert!(comm.rank() >= 4);
24            return;
25        }
26    };
27
28    assert_eq!(2, cart_comm.num_dimensions());
29
30    let mpi::topology::CartesianLayout {
31        dims,
32        periods,
33        coords,
34    } = cart_comm.get_layout();
35
36    assert_eq!([2 as mpi::Count, 2], &dims[..]);
37    assert_eq!([false, true], &periods[..]);
38
39    let xrank = coords[0];
40    let yrank = coords[1];
41
42    assert!(0 <= xrank && xrank < 2);
43    assert!(0 <= yrank && yrank < 2);
44
45    let xcomm = cart_comm.subgroup(&[true, false]);
46    let ycomm = cart_comm.subgroup(&[false, true]);
47
48    assert_eq!(2, xcomm.size());
49    assert_eq!(xrank, xcomm.rank());
50
51    assert_eq!(2, ycomm.size());
52    assert_eq!(yrank, ycomm.rank());
53
54    // the first dimension is non-periodic
55    let (x_src, x_dest) = cart_comm.shift(0, 1);
56    if xrank == 0 {
57        assert!(x_src.is_none());
58        assert!(x_dest.is_some());
59
60        let coords = cart_comm.rank_to_coordinates(x_dest.unwrap());
61        assert_eq!(1, coords[0]);
62    } else {
63        assert_eq!(1, xrank);
64
65        assert!(x_src.is_some());
66        assert!(x_dest.is_none());
67
68        let coords = cart_comm.rank_to_coordinates(x_src.unwrap());
69        assert_eq!(0, coords[0]);
70    }
71
72    // the second dimension is periodic
73    {
74        let (y_src, y_dest) = cart_comm.shift(1, 1);
75        assert!(y_src.is_some());
76        assert!(y_dest.is_some());
77
78        let y_src_coords = cart_comm.rank_to_coordinates(y_src.unwrap());
79        assert_eq!((yrank - 1) & 0b1, y_src_coords[1]);
80
81        let y_dest_coords = cart_comm.rank_to_coordinates(y_dest.unwrap());
82        assert_eq!((yrank + 1) & 0b1, y_dest_coords[1]);
83    }
84
85    // second dimension shift by 2 should be identity
86    {
87        let (y_src, y_dest) = cart_comm.shift(1, 2);
88        assert_eq!(comm.rank(), y_src.unwrap());
89        assert_eq!(comm.rank(), y_dest.unwrap());
90    }
91}
Source

pub unsafe fn coordinates_to_rank_unchecked(&self, coords: &[Count]) -> Rank

Converts a set of cartesian coordinates to its rank in the CartesianCommunicator.

Coordinates in periodic axes that are out of range are shifted back into the dimensions of the communiactor.

Prefer coordinates_to_rank

§Parameters
  • coords - coords[i] is a location offset in axis i
§Standard section(s)

7.5.5 MPI_Cart_rank

§Safety
  • Behavior is undefined if coords is not of length num_dimensions.
  • Behavior is undefined if any coordinates in non-periodic axes are outside the dimensions
Source

pub fn coordinates_to_rank(&self, coords: &[Count]) -> Rank

Converts a set of cartesian coordinates to its rank in the CartesianCommunicator.

Panics if coords is not of length num_dimensions.

Coordinates in periodic axes that are out of range are shifted back into the dimensions of the communiactor.

§Panics

if any coordinates in non-periodic axes are outside the dimensions of the communicator.

§Parameters
  • coords - coords[i] is a location offset in axis i
§Standard section(s)

7.5.5 MPI_Cart_rank

Source

pub unsafe fn rank_to_coordinates_into_unchecked( &self, rank: Rank, coords: &mut [Count], )

Receives into coords the cartesian coordinates of rank.

Prefer rank_to_coordinates_into

§Parameters
  • rank - A rank in the communicator
  • coords - coords[i] is the cartesian coordinate of rank in axis i
§Standard section(s)

7.5.5 MPI_Cart_coords

§Safety

Behavior is undefined if rank is not a non-negative value less than size.

Source

pub fn rank_to_coordinates_into(&self, rank: Rank, coords: &mut [Count])

Receives into coords the cartesian coordinates of rank.

§Panics

if rank is not a non-negative value less than size.

§Parameters
  • rank - A rank in the communicator
  • coords - coords[i] is the cartesian coordinate of rank in axis i
§Standard section(s)

7.5.5 MPI_Cart_coords

Source

pub fn rank_to_coordinates(&self, rank: Rank) -> Vec<Count>

Returns an array of coords with the cartesian coordinates of rank, where coords[i] is the cartesian coordinate of rank in axis i.

§Panics

if rank is not a non-negative value less than size.

§Parameters
  • rank - A rank in the communicator
§Standard section(s)

7.5.5 MPI_Cart_coords

Examples found in repository?
examples/cartesian.rs (line 60)
7fn main() {
8    let universe = mpi::initialize().unwrap();
9
10    let comm = universe.world();
11
12    if comm.size() < 4 {
13        return;
14    }
15
16    let cart_comm = {
17        let dims = [2, 2];
18        let periodic = [false, true];
19        let reorder = true;
20        if let Some(cart_comm) = comm.create_cartesian_communicator(&dims, &periodic, reorder) {
21            cart_comm
22        } else {
23            assert!(comm.rank() >= 4);
24            return;
25        }
26    };
27
28    assert_eq!(2, cart_comm.num_dimensions());
29
30    let mpi::topology::CartesianLayout {
31        dims,
32        periods,
33        coords,
34    } = cart_comm.get_layout();
35
36    assert_eq!([2 as mpi::Count, 2], &dims[..]);
37    assert_eq!([false, true], &periods[..]);
38
39    let xrank = coords[0];
40    let yrank = coords[1];
41
42    assert!(0 <= xrank && xrank < 2);
43    assert!(0 <= yrank && yrank < 2);
44
45    let xcomm = cart_comm.subgroup(&[true, false]);
46    let ycomm = cart_comm.subgroup(&[false, true]);
47
48    assert_eq!(2, xcomm.size());
49    assert_eq!(xrank, xcomm.rank());
50
51    assert_eq!(2, ycomm.size());
52    assert_eq!(yrank, ycomm.rank());
53
54    // the first dimension is non-periodic
55    let (x_src, x_dest) = cart_comm.shift(0, 1);
56    if xrank == 0 {
57        assert!(x_src.is_none());
58        assert!(x_dest.is_some());
59
60        let coords = cart_comm.rank_to_coordinates(x_dest.unwrap());
61        assert_eq!(1, coords[0]);
62    } else {
63        assert_eq!(1, xrank);
64
65        assert!(x_src.is_some());
66        assert!(x_dest.is_none());
67
68        let coords = cart_comm.rank_to_coordinates(x_src.unwrap());
69        assert_eq!(0, coords[0]);
70    }
71
72    // the second dimension is periodic
73    {
74        let (y_src, y_dest) = cart_comm.shift(1, 1);
75        assert!(y_src.is_some());
76        assert!(y_dest.is_some());
77
78        let y_src_coords = cart_comm.rank_to_coordinates(y_src.unwrap());
79        assert_eq!((yrank - 1) & 0b1, y_src_coords[1]);
80
81        let y_dest_coords = cart_comm.rank_to_coordinates(y_dest.unwrap());
82        assert_eq!((yrank + 1) & 0b1, y_dest_coords[1]);
83    }
84
85    // second dimension shift by 2 should be identity
86    {
87        let (y_src, y_dest) = cart_comm.shift(1, 2);
88        assert_eq!(comm.rank(), y_src.unwrap());
89        assert_eq!(comm.rank(), y_dest.unwrap());
90    }
91}
Source

pub unsafe fn shift_unchecked( &self, dimension: Count, displacement: Count, ) -> (Option<Rank>, Option<Rank>)

Retrieves targets in dimension shifted from the current rank by displacing in the negative direction by displacement units for the first returned rank and in the positive direction for the second returned rank.

Prefer shift

§Parameters
  • dimension - which axis to shift in
  • displacement - what offset to shift by in each direction
§Standard section(s)

7.5.6 MPI_Cart_shift

§Safety

Behavior is undefined if dimension is not of length num_dimensions.

Source

pub fn shift( &self, dimension: Count, displacement: Count, ) -> (Option<Rank>, Option<Rank>)

Retrieves targets in dimension shifted from the current rank by displacing in the negative direction by displacement units for the first returned rank and in the positive direction for the second returned rank.

§Parameters
  • dimension - which axis to shift in
  • displacement - what offset to shift by in each direction
§Standard section(s)

7.5.6 MPI_Cart_shift

§Panics

if dimension is not of length num_dimensions.

Examples found in repository?
examples/cartesian.rs (line 55)
7fn main() {
8    let universe = mpi::initialize().unwrap();
9
10    let comm = universe.world();
11
12    if comm.size() < 4 {
13        return;
14    }
15
16    let cart_comm = {
17        let dims = [2, 2];
18        let periodic = [false, true];
19        let reorder = true;
20        if let Some(cart_comm) = comm.create_cartesian_communicator(&dims, &periodic, reorder) {
21            cart_comm
22        } else {
23            assert!(comm.rank() >= 4);
24            return;
25        }
26    };
27
28    assert_eq!(2, cart_comm.num_dimensions());
29
30    let mpi::topology::CartesianLayout {
31        dims,
32        periods,
33        coords,
34    } = cart_comm.get_layout();
35
36    assert_eq!([2 as mpi::Count, 2], &dims[..]);
37    assert_eq!([false, true], &periods[..]);
38
39    let xrank = coords[0];
40    let yrank = coords[1];
41
42    assert!(0 <= xrank && xrank < 2);
43    assert!(0 <= yrank && yrank < 2);
44
45    let xcomm = cart_comm.subgroup(&[true, false]);
46    let ycomm = cart_comm.subgroup(&[false, true]);
47
48    assert_eq!(2, xcomm.size());
49    assert_eq!(xrank, xcomm.rank());
50
51    assert_eq!(2, ycomm.size());
52    assert_eq!(yrank, ycomm.rank());
53
54    // the first dimension is non-periodic
55    let (x_src, x_dest) = cart_comm.shift(0, 1);
56    if xrank == 0 {
57        assert!(x_src.is_none());
58        assert!(x_dest.is_some());
59
60        let coords = cart_comm.rank_to_coordinates(x_dest.unwrap());
61        assert_eq!(1, coords[0]);
62    } else {
63        assert_eq!(1, xrank);
64
65        assert!(x_src.is_some());
66        assert!(x_dest.is_none());
67
68        let coords = cart_comm.rank_to_coordinates(x_src.unwrap());
69        assert_eq!(0, coords[0]);
70    }
71
72    // the second dimension is periodic
73    {
74        let (y_src, y_dest) = cart_comm.shift(1, 1);
75        assert!(y_src.is_some());
76        assert!(y_dest.is_some());
77
78        let y_src_coords = cart_comm.rank_to_coordinates(y_src.unwrap());
79        assert_eq!((yrank - 1) & 0b1, y_src_coords[1]);
80
81        let y_dest_coords = cart_comm.rank_to_coordinates(y_dest.unwrap());
82        assert_eq!((yrank + 1) & 0b1, y_dest_coords[1]);
83    }
84
85    // second dimension shift by 2 should be identity
86    {
87        let (y_src, y_dest) = cart_comm.shift(1, 2);
88        assert_eq!(comm.rank(), y_src.unwrap());
89        assert_eq!(comm.rank(), y_dest.unwrap());
90    }
91}
Source

pub unsafe fn subgroup_unchecked( &self, retain: &[bool], ) -> CartesianCommunicator

Partitions an existing Cartesian communicator into a new Cartesian communicator in a lower dimension.

Prefer subgroup

§Parameters
  • retain - if retain[i] is true, then axis i is retained in the new communicator
§Standard section(s)

7.5.7 MPI_Cart_sub

§Safety

Behavior is undefined if retain is not of length num_dimensions.

Source

pub fn subgroup(&self, retain: &[bool]) -> CartesianCommunicator

Partitions an existing Cartesian communicator into a new Cartesian communicator in a lower dimension.

§Panics

if retain is not of length num_dimensions.

§Parameters
  • retain - if retain[i] is true, then axis i is retained in the new communicator
§Standard section(s)

7.5.7 MPI_Cart_sub

Examples found in repository?
examples/cartesian.rs (line 45)
7fn main() {
8    let universe = mpi::initialize().unwrap();
9
10    let comm = universe.world();
11
12    if comm.size() < 4 {
13        return;
14    }
15
16    let cart_comm = {
17        let dims = [2, 2];
18        let periodic = [false, true];
19        let reorder = true;
20        if let Some(cart_comm) = comm.create_cartesian_communicator(&dims, &periodic, reorder) {
21            cart_comm
22        } else {
23            assert!(comm.rank() >= 4);
24            return;
25        }
26    };
27
28    assert_eq!(2, cart_comm.num_dimensions());
29
30    let mpi::topology::CartesianLayout {
31        dims,
32        periods,
33        coords,
34    } = cart_comm.get_layout();
35
36    assert_eq!([2 as mpi::Count, 2], &dims[..]);
37    assert_eq!([false, true], &periods[..]);
38
39    let xrank = coords[0];
40    let yrank = coords[1];
41
42    assert!(0 <= xrank && xrank < 2);
43    assert!(0 <= yrank && yrank < 2);
44
45    let xcomm = cart_comm.subgroup(&[true, false]);
46    let ycomm = cart_comm.subgroup(&[false, true]);
47
48    assert_eq!(2, xcomm.size());
49    assert_eq!(xrank, xcomm.rank());
50
51    assert_eq!(2, ycomm.size());
52    assert_eq!(yrank, ycomm.rank());
53
54    // the first dimension is non-periodic
55    let (x_src, x_dest) = cart_comm.shift(0, 1);
56    if xrank == 0 {
57        assert!(x_src.is_none());
58        assert!(x_dest.is_some());
59
60        let coords = cart_comm.rank_to_coordinates(x_dest.unwrap());
61        assert_eq!(1, coords[0]);
62    } else {
63        assert_eq!(1, xrank);
64
65        assert!(x_src.is_some());
66        assert!(x_dest.is_none());
67
68        let coords = cart_comm.rank_to_coordinates(x_src.unwrap());
69        assert_eq!(0, coords[0]);
70    }
71
72    // the second dimension is periodic
73    {
74        let (y_src, y_dest) = cart_comm.shift(1, 1);
75        assert!(y_src.is_some());
76        assert!(y_dest.is_some());
77
78        let y_src_coords = cart_comm.rank_to_coordinates(y_src.unwrap());
79        assert_eq!((yrank - 1) & 0b1, y_src_coords[1]);
80
81        let y_dest_coords = cart_comm.rank_to_coordinates(y_dest.unwrap());
82        assert_eq!((yrank + 1) & 0b1, y_dest_coords[1]);
83    }
84
85    // second dimension shift by 2 should be identity
86    {
87        let (y_src, y_dest) = cart_comm.shift(1, 2);
88        assert_eq!(comm.rank(), y_src.unwrap());
89        assert_eq!(comm.rank(), y_dest.unwrap());
90    }
91}

Trait Implementations§

Source§

impl AsCommunicator for CartesianCommunicator

Source§

type Out = CartesianCommunicator

The type of the associated communicator
Source§

fn as_communicator(&self) -> &Self::Out

Returns the associated communicator.
Source§

impl AsRaw for CartesianCommunicator

Source§

type Raw = *mut ompi_communicator_t

The raw MPI C API type
Source§

fn as_raw(&self) -> Self::Raw

The raw value
Source§

impl Communicator for CartesianCommunicator

Source§

fn size(&self) -> Rank

Number of processes in this communicator Read more
Source§

fn rank(&self) -> Rank

The Rank that identifies the calling process within this communicator Read more
Source§

fn process_at_rank(&self, r: Rank) -> Process<'_, Self>
where Self: Sized,

Bundles a reference to this communicator with a specific Rank into a Process. Read more
Source§

fn any_process(&self) -> AnyProcess<'_, Self>
where Self: Sized,

Returns an AnyProcess identifier that can be used, e.g. as a Source in point to point communication.
Source§

fn this_process(&self) -> Process<'_, Self>
where Self: Sized,

A Process for the calling process
Source§

fn compare<C>(&self, other: &C) -> CommunicatorRelation
where C: Communicator + ?Sized,

Compare two communicators. Read more
Source§

fn duplicate(&self) -> UserCommunicator

Duplicate a communicator. Read more
Source§

fn split_by_color(&self, color: Color) -> Option<UserCommunicator>

Split a communicator by color. Read more
Source§

fn split_by_color_with_key( &self, color: Color, key: Key, ) -> Option<UserCommunicator>

Split a communicator by color. Read more
Source§

fn split_shared(&self, key: c_int) -> UserCommunicator

Split the communicator into subcommunicators, each of which can create a shared memory region. Read more
Source§

fn split_by_subgroup_collective<G>(&self, group: &G) -> Option<UserCommunicator>
where G: Group + ?Sized,

Split a communicator collectively by subgroup. Read more
Source§

fn split_by_subgroup<G>(&self, group: &G) -> Option<UserCommunicator>
where G: Group + ?Sized,

Split a communicator by subgroup. Read more
Source§

fn split_by_subgroup_with_tag<G>( &self, group: &G, tag: Tag, ) -> Option<UserCommunicator>
where G: Group + ?Sized,

Split a communicator by subgroup Read more
Source§

fn group(&self) -> UserGroup

The group associated with this communicator Read more
Source§

fn abort(&self, errorcode: c_int) -> !

Abort program execution Read more
Source§

fn set_name(&self, name: &str)

Set the communicator name Read more
Source§

fn get_name(&self) -> String

Get the communicator name Read more
Source§

fn create_cartesian_communicator( &self, dims: &[Count], periods: &[bool], reorder: bool, ) -> Option<CartesianCommunicator>

Creates a communicator with ranks laid out in a multi-dimensional space, allowing for easy neighbor-to-neighbor communication, while providing MPI with information to allow it to better optimize the physical locality of ranks that are logically close. Read more
Source§

fn cartesian_map(&self, dims: &[Count], periods: &[bool]) -> Option<Rank>

Gets the target rank of this rank as-if create_cartesian_communicator had been called with dims, periods, and reorder = true. Read more
Source§

fn pack_size<Dt>(&self, incount: Count, datatype: &Dt) -> Count
where Dt: Datatype,

Gets the implementation-defined buffer size required to pack ‘incount’ elements of type ‘datatype’. Read more
Source§

fn pack<Buf>(&self, inbuf: &Buf) -> Vec<u8>
where Buf: ?Sized + Buffer,

Packs inbuf into a byte array with an implementation-defined format. Often paired with unpack to convert back into a specific datatype. Read more
Source§

fn pack_into<Buf>( &self, inbuf: &Buf, outbuf: &mut [u8], position: Count, ) -> Count
where Buf: ?Sized + Buffer,

Packs inbuf into a byte array with an implementation-defined format. Often paired with unpack to convert back into a specific datatype. Read more
Source§

unsafe fn unpack_into<Buf>( &self, inbuf: &[u8], outbuf: &mut Buf, position: Count, ) -> Count
where Buf: ?Sized + BufferMut,

Unpacks an implementation-specific byte array from pack or pack_into into a buffer of a specific datatype. Read more
Source§

impl From<CartesianCommunicator> for UserCommunicator

Source§

fn from(cart_comm: CartesianCommunicator) -> Self

Converts to this type from the input type.

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<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
Source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

Source§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
Source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
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<C> CommunicatorCollectives for C
where C: Communicator,

Source§

fn barrier(&self)

Barrier synchronization among all processes in a Communicator Read more
Source§

fn all_gather_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
where S: Buffer + ?Sized, R: BufferMut + ?Sized,

Gather contents of buffers on all participating processes. Read more
Source§

fn all_gather_varcount_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)

Gather contents of buffers on all participating processes. Read more
Source§

fn all_to_all_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
where S: Buffer + ?Sized, R: BufferMut + ?Sized,

Distribute the send Buffers from all processes to the receive Buffers on all processes. Read more
Source§

fn all_to_all_varcount_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)

Distribute the send Buffers from all processes to the receive Buffers on all processes. Read more
Source§

fn all_reduce_into<S, R, O>(&self, sendbuf: &S, recvbuf: &mut R, op: O)
where S: Buffer + ?Sized, R: BufferMut + ?Sized, O: Operation,

Performs a global reduction under the operation op of the input data in sendbuf and stores the result in recvbuf on all processes. Read more
Source§

fn reduce_scatter_block_into<S, R, O>( &self, sendbuf: &S, recvbuf: &mut R, op: O, )
where S: Buffer + ?Sized, R: BufferMut + ?Sized, O: Operation,

Performs an element-wise global reduction under the operation op of the input data in sendbuf and scatters the result into equal sized blocks in the receive buffers on all processes. Read more
Source§

fn scan_into<S, R, O>(&self, sendbuf: &S, recvbuf: &mut R, op: O)
where S: Buffer + ?Sized, R: BufferMut + ?Sized, O: Operation,

Performs a global inclusive prefix reduction of the data in sendbuf into recvbuf under operation op. Read more
Source§

fn exclusive_scan_into<S, R, O>(&self, sendbuf: &S, recvbuf: &mut R, op: O)
where S: Buffer + ?Sized, R: BufferMut + ?Sized, O: Operation,

Performs a global exclusive prefix reduction of the data in sendbuf into recvbuf under operation op. Read more
Source§

fn immediate_barrier(&self) -> Request<'static>

Non-blocking barrier synchronization among all processes in a Communicator Read more
Source§

fn immediate_all_gather_into<'a, Sc, S, R>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, ) -> Request<'a, Sc>
where S: 'a + Buffer + ?Sized, R: 'a + BufferMut + ?Sized, Sc: Scope<'a>,

Initiate non-blocking gather of the contents of all sendbufs into all rcevbufs on all processes in the communicator. Read more
Source§

fn immediate_all_gather_varcount_into<'a, Sc, S, R>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, ) -> Request<'a, Sc>
where S: 'a + Buffer + ?Sized, R: 'a + PartitionedBufferMut + ?Sized, Sc: Scope<'a>,

Initiate non-blocking gather of the contents of all sendbufs into all rcevbufs on all processes in the communicator. Read more
Source§

fn immediate_all_to_all_into<'a, Sc, S, R>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, ) -> Request<'a, Sc>
where S: 'a + Buffer + ?Sized, R: 'a + BufferMut + ?Sized, Sc: Scope<'a>,

Initiate non-blocking all-to-all communication. Read more
Source§

fn immediate_all_to_all_varcount_into<'a, Sc, S, R>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, ) -> Request<'a, Sc>
where S: 'a + PartitionedBuffer + ?Sized, R: 'a + PartitionedBufferMut + ?Sized, Sc: Scope<'a>,

Initiate non-blocking all-to-all communication. Read more
Source§

fn immediate_all_reduce_into<'a, Sc, S, R, O>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, op: O, ) -> Request<'a, Sc>
where S: 'a + Buffer + ?Sized, R: 'a + BufferMut + ?Sized, O: 'a + Operation, Sc: Scope<'a>,

Initiates a non-blocking global reduction under the operation op of the input data in sendbuf and stores the result in recvbuf on all processes. Read more
Source§

fn immediate_reduce_scatter_block_into<'a, Sc, S, R, O>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, op: O, ) -> Request<'a, Sc>
where S: 'a + Buffer + ?Sized, R: 'a + BufferMut + ?Sized, O: 'a + Operation, Sc: Scope<'a>,

Initiates a non-blocking element-wise global reduction under the operation op of the input data in sendbuf and scatters the result into equal sized blocks in the receive buffers on all processes. Read more
Source§

fn immediate_scan_into<'a, Sc, S, R, O>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, op: O, ) -> Request<'a, Sc>
where S: 'a + Buffer + ?Sized, R: 'a + BufferMut + ?Sized, O: 'a + Operation, Sc: Scope<'a>,

Initiates a non-blocking global inclusive prefix reduction of the data in sendbuf into recvbuf under operation op. Read more
Source§

fn immediate_exclusive_scan_into<'a, Sc, S, R, O>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, op: O, ) -> Request<'a, Sc>
where S: 'a + Buffer + ?Sized, R: 'a + BufferMut + ?Sized, O: 'a + Operation, Sc: Scope<'a>,

Initiates a non-blocking global exclusive prefix reduction of the data in sendbuf into recvbuf under operation op. Read more
Source§

impl<T, Dst> ConvAsUtil<Dst> for T

Source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
Source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
Source§

impl<T> ConvUtil for T

Source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
Source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
Source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
Source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
Source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
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<Src> TryFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
Source§

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

Source§

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<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
Source§

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

Source§

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.
Source§

impl<Src> ValueFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
Source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

Source§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.