Factory that generates the tasks needed for a map reduce operation. A map reduce operation applies the map work function provided on each set of elements of the input views that have the same offset from the beginning of their respective view. The map operations return values that are combined using the reduce operation provided to form a single result value. The result value is returned to each location in the gang executing the map_reduce call.
More...
|
| map_reduce_factory (MapWF const &map_wf, ReduceWF const &reduce_wf) |
|
coarsener_type | get_coarsener () const |
|
void | reset () |
| Reset all data members related to the number of tasks that have been generated in order to prepare the factory for PARAGRAPH reinvocation.
|
|
bool | finished () const |
|
runtime::location_md const & | get_location_md (void) const noexcept |
| Returns the location metadata of the location this object registered in.
|
|
runtime::location_md & | get_location_md (void) noexcept |
| Returns the location metadata of the location this object registered in. noexcept More...
|
|
|
rmi_handle::const_reference const & | get_rmi_handle (void) const noexcept |
| Returns the associated rmi_handle.
|
|
rmi_handle::reference const & | get_rmi_handle (void) noexcept |
| Returns the associated rmi_handle.
|
|
size_type | get_location_id (void) const noexcept |
| Returns the location id of the local sub-object.
|
|
size_type | get_num_locations (void) const noexcept |
| Returns the number of locations of the gang of this p_object.
|
|
void | advance_epoch (void) |
| Advances the epoch of the object. More...
|
|
void | unlock (void) |
| Used by lock_guard functionality in method of derived classes to request atomicity with respect to incoming RMIs. More...
|
|
void | lock (void) |
| Used by lock_guard functionality in method of derived classes to request atomicity with respect to incoming RMIs. More...
|
|
bool | try_lock (void) |
| Attempt to maintain atomicity with respect to incoming RMIs. More...
|
|
template<typename MapWF, typename ReduceWF, bool b_coarse>
struct stapl::map_reduce_factory< MapWF, ReduceWF, b_coarse >
Factory that generates the tasks needed for a map reduce operation. A map reduce operation applies the map work function provided on each set of elements of the input views that have the same offset from the beginning of their respective view. The map operations return values that are combined using the reduce operation provided to form a single result value. The result value is returned to each location in the gang executing the map_reduce call.
- Template Parameters
-
MapWF | Fine-grain operation to be applied to each set of elements. |
ReduceWF | Fine-grain reduce operation used to combine the results of the applications of the map operation. |
b_coarse | Indicates whether the map operation provided is coarse-grain. |
The factory uses coarse_map_reduce_wf as the work function for the map tasks when the MapWF is a fine-grain operation. The results of the coarse-grain map operations are combined using a binary reduction tree. If the number of tasks used to perform the coarse-grain map operations isn't a power of two a set of binary trees whose widths are the powers of two that sum to equal the number of coarse-grain map operations is generated, and the results of the trees are combined to form the final result. The final result of the computation is pushed to all locations using a set of tasks that form a broadcast tree.