dedalus.core.distributor
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.
- Parameters
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)
- Variables
comm_cart (MPI communicator) – Cartesian MPI communicator over mesh
coords (array of ints) – Coordinates in cartesian communicator
layouts (list of layout objects) – Available layouts
Notes
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).
- cs_by_axis()
- get_coordsystem(axis)
- get_layout_object(input)
Dereference layout identifiers.
- buffer_size(domain, scales, dtype)
Compute necessary buffer size (bytes) for all layouts.
- remedy_scales(scales)
Remedy different scale inputs.
- get_transform_object(axis)
- get_axis(coord)
- 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.
- IdentityTensor(coordsys)
Identity tensor field.
- local_grid(basis, scale=None)
- local_grids(*bases, scales=None)
- local_modes(basis)
- default_nonconst_groups()