File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,21 @@ A reduction is a distributed and scalable operation that reduces data
6
6
distributed across chares into a smaller set of data.
7
7
A reduction involves the chares in a collection (Group, Array or Section). They are
8
8
started by the elements calling their ``Chare.reduce() `` or ``Chare.allreduce() ``
9
- methods (see :ref: `Chare <chare-api-label >`).
9
+ methods (see :ref: `Chare <chare-api-label >`).
10
+
11
+ The reduction calls accumulate objects from a chare collection to a single desired
12
+ collection/object. ``Chare.reduce(<callback>, <data>, <Reducer>) `` is the general format.
13
+ This returns a single collection/object to the callback function after applying the Reducer
14
+ function on all individual chare data.
15
+
16
+ Alternatively, one can use the ``Chare.contribute() `` to achieve the same. The signature of the
17
+ contribute function is ``Chare.contribute(<data>, <Reducer>, <callback>) ``
18
+
19
+ * ``data ``: scalar/vector data. Can be a collection/primitive/object. Each chare contributes some compatible data to the reducer.
20
+
21
+ * ``Reducer ``: charm4py.Reducer - :ref: `reducer-api-label `
22
+
23
+ * ``callback ``: any method - either belonging to a Chare or global or a different class. The reducer sends each reduced data to the callback.
10
24
11
25
.. important ::
12
26
You can’t perform that action at this time.
0 commit comments