hpx::collectives::reduce_here#
Defined in header hpx/collectives.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
See also:
-
template<typename T, typename F>
hpx::future<std::decay_t<T>> hpx::collectives::reduce_here(char const *basename, T &&result, F &&op, num_sites_arg num_sites = num_sites_arg(), this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())# Reduce a set of values from different call sites
This function receives a set of values from all call sites operating on the given base name.
- Parameters
basename – The base name identifying the reduce operation
result – A value to reduce on the central reduction point from this call site.
op – Reduction operation to apply to all values supplied from all participating sites
num_sites – The number of participating sites (default: all localities).
this_site – The sequence number of this invocation (usually the locality id). This value is optional and defaults to whatever hpx::get_locality_id() returns.
generation – The generational counter identifying the sequence number of the reduce operation performed on the given base name. This is optional and needs to be supplied only if the reduce operation on the given base name has to be performed more than once. The generation number (if given) must be a positive number greater than zero.
- Returns
This function returns a future holding a vector with all values send by all participating sites. It will become ready once the reduce operation has been completed.
-
template<typename T, typename F>
hpx::future<decay_t<T>> hpx::collectives::reduce_here(communicator comm, T &&result, F &&op, this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())# Reduce a set of values from different call sites
This function receives a set of values that are the result of applying a given operator on values supplied from all call sites operating on the given base name.
Reduce a set of values from different call sites
This function receives a set of values that are the result of applying a given operator on values supplied from all call sites operating on the given base name.
Note
The generation values from corresponding reduce_here and reduce_there have to match.
Note
The generation values from corresponding reduce_here and reduce_there have to match.
- Parameters
comm – A communicator object returned from create_communicator
result – A value to reduce on the root_site from this call site.
op – Reduction operation to apply to all values supplied from all participating sites
this_site – The sequence number of this invocation (usually the locality id). This value is optional and defaults to whatever hpx::get_locality_id() returns.
generation – The generational counter identifying the sequence number of the reduce operation performed on the given base name. This is optional and needs to be supplied only if the reduce operation on the given base name has to be performed more than once. The generation number (if given) must be a positive number greater than zero.
comm – A communicator object returned from create_communicator
result – A value to reduce on the root_site from this call site.
op – Reduction operation to apply to all values supplied from all participating sites
generation – The generational counter identifying the sequence number of the reduce operation performed on the given base name. This is optional and needs to be supplied only if the reduce operation on the given base name has to be performed more than once. The generation number (if given) must be a positive number greater than zero.
this_site – The sequence number of this invocation (usually the locality id). This value is optional and defaults to whatever hpx::get_locality_id() returns.
- Returns
This function returns a future holding a value calculated based on the values send by all participating sites. It will become ready once the reduce operation has been completed.
- Returns
This function returns a future holding a value calculated based on the values send by all participating sites. It will become ready once the reduce operation has been completed.
Warning
doxygenfunction: Unable to resolve function “hpx::collectives::reduce_here” with arguments (hpx::launch::sync_policy, char const*, T&&, F&&, num_sites_arg, this_site_arg, generation_arg) in doxygen xml output for project “hpx” from directory: ../hpx_autodoc. Potential matches:
- template<typename T, typename F> decltype(auto) reduce_here(hpx::launch::sync_policy, char const *basename, T &&result, F &&op, num_sites_arg num_sites = num_sites_arg(), this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())
- template<typename T, typename F> decltype(auto) reduce_here(hpx::launch::sync_policy, communicator comm, T &&result, F &&op, this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())
- template<typename T, typename F> hpx::future<decay_t<T>> reduce_here(communicator comm, T &&result, F &&op, this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())
- template<typename T, typename F> hpx::future<std::decay_t<T>> reduce_here(char const *basename, T &&result, F &&op, num_sites_arg num_sites = num_sites_arg(), this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())
Warning
doxygenfunction: Unable to resolve function “hpx::collectives::reduce_here” with arguments (hpx::launch::sync_policy, communicator, T&&, F&&, this_site_arg, generation_arg) in doxygen xml output for project “hpx” from directory: ../hpx_autodoc. Potential matches:
- template<typename T, typename F> decltype(auto) reduce_here(hpx::launch::sync_policy, char const *basename, T &&result, F &&op, num_sites_arg num_sites = num_sites_arg(), this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())
- template<typename T, typename F> decltype(auto) reduce_here(hpx::launch::sync_policy, communicator comm, T &&result, F &&op, this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())
- template<typename T, typename F> hpx::future<decay_t<T>> reduce_here(communicator comm, T &&result, F &&op, this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())
- template<typename T, typename F> hpx::future<std::decay_t<T>> reduce_here(char const *basename, T &&result, F &&op, num_sites_arg num_sites = num_sites_arg(), this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())