Skip to content

Commit 8fa907e

Browse files
committed
Merge pull request #79 from enthought/feature/redo-padding-description
Redo description of padding tuple
2 parents f08247e + a4ade9a commit 8fa907e

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

protocol.rst

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -281,31 +281,33 @@ The remaining key-value pairs in each dimension dictionary depend on the
281281
* ``padding`` : 2-tuple of ``int``, each greater than or equal to zero.
282282
Optional.
283283

284-
When present, indicates the number of "padding" values at the lower and
285-
upper limits (respectively) of the indices available on this process. This
286-
padding can be either "boundary padding" or "communication padding". When
287-
not present, indicates that the distributed array is not padded in this
288-
dimension on any process.
289-
290-
Whenever an element of the ``padding`` tuple is > 0 and the padding is on
291-
an internal edge of the process grid (or the dimension is periodic), that
292-
indicates this is "communication padding", and the communication padding
293-
elements do not count towards the ``size`` of the array in this dimension.
294-
In other words, the array shares the indicated number of indices with its
295-
neighbor (as determined by ``proc_grid_rank``), and further, this
296-
neighboring process owns the data. When an element of the ``padding``
297-
tuple is > 0 and the padding is on an external edge of the process grid
298-
(and the dimension is not periodic), that indicates that this is "boundary
299-
padding".
300-
301-
All communication padding widths must be the same for a dimension.
302-
303-
Padding is an all-or-nothing attribute: if the ``padding`` keyword is
304-
present in any dimension dictionary for a dimension of the distributed
305-
array, then the ``padding`` keyword shall be present on *all* processes for
306-
the same dimension dictionary. The value associated with ``padding`` can
307-
be the tuple ``(0,0)`` indicating that this local array is not padded in
308-
this dimension.
284+
The padding tuple describes the width of the padding region at the
285+
beginning and end of a buffer in a particular dimension. Padding
286+
represents extra allocation for an array, but padding values are in some
287+
sense not "owned" by the local array and are reserved for other purposes.
288+
289+
For the dimension dictionary with ``proc_grid_rank == 0``, the first
290+
element in ``padding`` is the width of the boundary padding; this is extra
291+
allocation reserved for boundary logic in applications that need it. For
292+
the dimension dictionary with ``proc_grid_rank == proc_grid_size-1``, the
293+
second element in ``padding`` is the width of the boundary padding. All
294+
other ``padding`` tuple values are for communication padding and represent
295+
extra allocation reserved for communication between processes. All
296+
communication padding widths must be the same for a dimension.
297+
298+
For example, consider a one-dimensional block-distributed array distributed
299+
over four processes. Let its boundary padding have a width of 3 and its
300+
communication padding have a width of 2. The padding tuple for the local
301+
array on each rank would be:
302+
303+
============== ====== ====== ====== ======
304+
proc_grid_rank 0 1 2 3
305+
============== ====== ====== ====== ======
306+
padding (3, 2) (2, 2) (2, 2) (2, 3)
307+
============== ====== ====== ====== ======
308+
309+
If the value associated with ``padding`` is the tuple ``(0,0)`` (the
310+
default), this indicates the local array is not padded in this dimension.
309311

310312
* ``periodic`` : ``bool``, optional
311313

0 commit comments

Comments
 (0)