dedalus.core.distributor ======================== .. py:module:: dedalus.core.distributor .. autoapi-nested-parse:: Distributor, Layout, Transform, and Transpose class definitions. Module Contents --------------- .. py: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) :ivar comm_cart: Cartesian MPI communicator over mesh :vartype comm_cart: MPI communicator :ivar coords: Coordinates in cartesian communicator :vartype coords: array of ints :ivar layouts: Available layouts :vartype layouts: list of layout objects .. rubric:: 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). .. py:method:: Field(*args, **kw) Alternate constructor for fields. .. py:method:: IdentityTensor(coordsys_in, coordsys_out=None, bases=None, dtype=None) Identity tensor field. .. py:method:: ScalarField(*args, **kw) Alternate constructor for scalar fields. .. py:method:: TensorField(*args, **kw) Alternate constructor for tensor fields. .. py:method:: VectorField(*args, **kw) Alternate constructor for vector fields. .. py:method:: buffer_size(domain, scales, dtype) Compute necessary buffer size (bytes) for all layouts. .. py:method:: cs_by_axis() .. py:method:: default_nonconst_groups() .. py:method:: first_axis(basis) .. py:method:: get_axis(coord) .. py:method:: get_basis_axis(basis) .. py:method:: get_coordsystem(axis) .. py:method:: get_layout_object(input) Dereference layout identifiers. .. py:method:: get_transform_object(axis) .. py:method:: last_axis(basis) .. py:method:: local_grid(basis, scale=None) .. py:method:: local_grids(*bases, scales=None) .. py:method:: local_modes(basis) .. py:method:: remedy_scales(scales) Remedy different scale inputs. .. py:attribute:: comm :value: None .. py:attribute:: comm_cart .. py:attribute:: comm_coords .. py:attribute:: coords .. py:attribute:: coordsystems .. py:attribute:: dtype :value: None .. py:attribute:: fields