Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ boundary padding
the logical *boundary* of the entire domain. These are physical or real
boundaries and correspond to the elements or indices that are involved with
the physical system's boundary conditions in a PDE application, for
example. These boundary padding elements would exist even if the array
were not distributed. These elements are included in a distributed
example. These elements are included in a distributed
dimension's ``'size'``.

communication padding
Expand Down Expand Up @@ -160,8 +159,8 @@ The value for the ``'dim_data'`` key shall be a tuple of dictionaries, called
"dimension dictionaries", containing one dictionary for each dimension of the
distributed array, with the zeroth dictionary associated with the zeroth
dimension of the array, and so on for each dimension in succession. There is
one dimension dictionary per dimension, **whether or not that dimension is
distributed**. These dictionaries are intended to include all metadata
one dimension dictionary per dimension. These dictionaries are intended to
include all metadata
required to fully specify a distributed array's dimension information. This
tuple may be empty, indicating a zero-dimensional array. The number of
elements in the ``'dim_data'`` tuple must match the number of dimensions of the
Expand All @@ -173,20 +172,19 @@ Dimension Dictionaries

All dimension dictionaries shall have a ``'dist_type'`` key with a value of
type string. The ``dist_type`` of a dimension specifies the kind of
distribution for that dimension (or no distribution for value ``'n'``).
distribution for that dimension.

The following dist_types are currently supported:

=============== =========== ========================== =======================
name dist_type required keys optional keys
=============== =========== ========================== =======================
no-distribution 'n' 'dist_type', 'size' 'padding', 'periodic'
block 'b' common, 'start', 'stop' 'padding', 'periodic'
cyclic 'c' common, 'start' 'block_size'
unstructured 'u' common, 'indices' 'one_to_one'
=============== =========== ========================== =======================

where "common" represents the keys common to all distributed dist_types:
where "common" represents the keys common to all dist_types:
``'dist_type'``, ``'size'``, ``'proc_grid_size'``, and
``'proc_grid_rank'``.

Expand All @@ -198,7 +196,7 @@ Required key-value pairs
All dimension dictionaries (regardless of distribution type) must define the
following key-value pairs:

* ``'dist_type'`` : ``{'n', 'b', 'c', 'u'}``
* ``'dist_type'`` : ``{'b', 'c', 'u'}``

The distribution type; the primary way to determine the kind of distribution
for this dimension.
Expand Down Expand Up @@ -257,12 +255,6 @@ Distribution-type specific key-value pairs
The remaining key-value pairs in each dimension dictionary depend on the
``dist_type`` and are described below:

* no-distribution (``dist_type`` is ``'n'``):

* ``padding`` : optional. See same key under block distribution.
* ``periodic`` : optional. See same key under block distribution.


* block (``dist_type`` is ``'b'``):

* ``start`` : ``int``, greater than or equal to zero.
Expand Down Expand Up @@ -393,12 +385,14 @@ The following properties of a dimension dictionary imply an empty local buffer:
Examples
-------------------------------------------------------------------------------

Block, No-distribution
``````````````````````
Block, Block
````````````

Assume we have a process grid with 2 rows and 1 column, and we have a 2x10
array ``a`` distributed over it. Let ``a`` be a two-dimensional array with a
block-distributed 0th dimension and no distribution for the 1st dimension.
block distribution in both dimensions. Note that since the ``proc_grid_size``
of the first dimension is ``1``, it is essentially "undistributed". Because of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the quotes around "undistributed".

this, having a cyclic ``dist_type`` for this dimension would be equivalent.

In process 0:

Expand All @@ -419,7 +413,11 @@ In process 0:
'start': 0,
'stop': 1},
{'size': 10,
'dist_type': 'n'})
'dist_type': 'b',
'proc_grid_rank': 0,
'proc_grid_size': 1,
'start': 0,
'stop': 10})

In process 1:

Expand All @@ -440,7 +438,11 @@ In process 1:
'start': 1,
'stop': 2},
{'size': 10,
'dist_type': 'n'})
'dist_type': 'b',
'proc_grid_rank': 0,
'proc_grid_size': 1,
'start': 0,
'stop': 10})


Block with padding
Expand Down