diff --git a/docs/reductions-api.rst b/docs/reductions-api.rst index acfdc555..a9021501 100644 --- a/docs/reductions-api.rst +++ b/docs/reductions-api.rst @@ -6,7 +6,21 @@ A reduction is a distributed and scalable operation that reduces data distributed across chares into a smaller set of data. A reduction involves the chares in a collection (Group, Array or Section). They are started by the elements calling their ``Chare.reduce()`` or ``Chare.allreduce()`` -methods (see :ref:`Chare `). +methods (see :ref:`Chare `). + +The reduction calls accumulate objects from a chare collection to a single desired +collection/object. ``Chare.reduce(, , )`` is the general format. +This returns a single collection/object to the callback function after applying the Reducer +function on all individual chare data. + +Alternatively, one can use the ``Chare.contribute()`` to achieve the same. The signature of the +contribute function is ``Chare.contribute(, , )`` + +* ``data``: scalar/vector data. Can be a collection/primitive/object. Each chare contributes some compatible data to the reducer. + +* ``Reducer``: charm4py.Reducer - :ref:`reducer-api-label` + +* ``callback``: any method - either belonging to a Chare or global or a different class. The reducer sends each reduced data to the callback. .. important::