Distributor, Layout, Transform, and Transpose class definitions.

Module Contents

class Distributor(coordsystems, comm=None, mesh=None, dtype=None)

Directs parallelized distribution and transformation of fields.

  • dim (int) – Dimension

  • comm (MPI communicator, optional) – MPI communicator (default: comm world)

  • mesh (tuple of ints, optional) – Process mesh for parallelization (default: 1-D mesh of available processes)

  • comm_cart (MPI communicator) – Cartesian MPI communicator over mesh

  • coords (array of ints) – Coordinates in cartesian communicator

  • layouts (list of layout objects) – Available layouts


Computations are parallelized by splitting D-dimensional data fields over an R-dimensional mesh of MPI processes, where R < D. In coefficient space, we take the first R dimensions of the data to be distributed over the mesh, leaving the last (D-R) dimensions local. To transform such a data cube to grid space, we loop backwards over the D dimensions, performing each transform if the corresponding dimension is local, and performing an MPI transpose with the next dimension otherwise. This effectively bubbles the first local dimension up from the (D-R)-th to the first dimension, transforming to grid space along the way. In grid space, then, the first dimensional is local, followed by R dimensions distributed over the mesh, and the last (D-R-1) dimensions local.

The distributor object for a given dimension constructs layout objects describing each of the (D+R+1) layouts (sets of transform/distribution states) and the paths between them (D transforms and R transposes).


Dereference layout identifiers.

buffer_size(domain, scales, dtype)

Compute necessary buffer size (bytes) for all layouts.


Remedy different scale inputs.

Field(*args, **kw)

Alternate constructor for fields.

ScalarField(*args, **kw)

Alternate constructor for scalar fields.

VectorField(*args, **kw)

Alternate constructor for vector fields.

TensorField(*args, **kw)

Alternate constructor for tensor fields.


Identity tensor field.

local_grid(basis, scale=None)
local_grids(*bases, scales=None)