legate.core.context.Context.tree_reduce#

Context.tree_reduce(task_id: int, store: Store, mapper_id: int = 0, radix: int = 4) Store#

Performs a user-defined reduction by building a tree of reduction tasks. At each step, the reducer task gets up to radix input stores and is supposed to produce outputs in a single unbound store.

Parameters:
  • task_id (int) – Id of the reducer task

  • store (Store) – Store to perform reductions on

  • mapper_id (int) – Id of the mapper that should decide mapping policies for reducer tasks

  • radix (int) – Fan-in of each reducer task. If the store is partitioned into \(N\) sub-stores by the runtime, then the first level of reduction tree has \(\ceil{N / \mathtt{radix}}\) reducer tasks.

Returns:

Store that contains reduction results

Return type:

Store