mpi4py.MPI.Cartcomm

class mpi4py.MPI.Cartcomm(comm=None)

Bases: Topocomm

Cartesian topology intracommunicator

Parameters

comm (Optional[Cartcomm]) –

Return type

Cartcomm

static __new__(cls, comm=None)
Parameters

comm (Optional[Cartcomm]) –

Return type

Cartcomm

Methods Summary

Get_cart_rank(coords)

Translate logical coordinates to ranks

Get_coords(rank)

Translate ranks to logical coordinates

Get_dim()

Return number of dimensions

Get_topo()

Return information on the cartesian topology

Shift(direction, disp)

Return a tuple (source, dest) of process ranks for data shifting with Comm.Sendrecv()

Sub(remain_dims)

Return cartesian communicators that form lower-dimensional subgrids

Attributes Summary

coords

coordinates

dim

number of dimensions

dims

dimensions

ndim

number of dimensions

periods

periodicity

topo

topology information

Methods Documentation

Get_cart_rank(coords)

Translate logical coordinates to ranks

Parameters

coords (Sequence[int]) –

Return type

int

Get_coords(rank)

Translate ranks to logical coordinates

Parameters

rank (int) –

Return type

List[int]

Get_dim()

Return number of dimensions

Return type

int

Get_topo()

Return information on the cartesian topology

Return type

Tuple[List[int], List[int], List[int]]

Shift(direction, disp)

Return a tuple (source, dest) of process ranks for data shifting with Comm.Sendrecv()

Parameters
  • direction (int) –

  • disp (int) –

Return type

Tuple[int, int]

Sub(remain_dims)

Return cartesian communicators that form lower-dimensional subgrids

Parameters

remain_dims (Sequence[bool]) –

Return type

Cartcomm

Attributes Documentation

coords

coordinates

dim

number of dimensions

dims

dimensions

ndim

number of dimensions

periods

periodicity

topo

topology information