hpx/collectives/gather.hpp

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace collectives

Functions

template<typename T>
hpx::future<std::vector<decay_t<T>>> gather_here(char const *basename, T &&result, num_sites_arg num_sites = num_sites_arg(), this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg())

Gather 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.

Return

This function returns a future holding a vector with all gathered values. It will become ready once the gather operation has been completed.

Parameters
  • basename: The base name identifying the gather operation

  • result: The value to transmit to the central gather point from this call site.

  • num_sites: The number of participating sites (default: all localities).

  • generation: The generational counter identifying the sequence number of the gather operation performed on the given base name. This is optional and needs to be supplied only if the gather operation on the given base name has to be performed more than once.

  • 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.

template<typename T>
hpx::future<std::vector<decay_t<T>>> gather_here(communicator comm, T &&result, this_site_arg this_site = this_site_arg())

Gather 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.

Return

This function returns a future holding a vector with all gathered values. It will become ready once the gather operation has been completed.

Parameters
  • comm: A communicator object returned from create_communicator

  • result: The value to transmit to the central gather point from this call site.

  • 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.

template<typename T>
hpx::future<std::vector<decay_t<T>>> gather_there(char const *basename, T &&result, this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg(), root_site_arg root_site = root_site_arg())

Gather a given value at the given call site

This function transmits the value given by result to a central gather site (where the corresponding gather_here is executed)

Return

This function returns a future holding a vector with all gathered values. It will become ready once the gather operation has been completed.

Parameters
  • basename: The base name identifying the gather operation

  • result: The value to transmit to the central gather point from this call site.

  • generation: The generational counter identifying the sequence number of the gather operation performed on the given base name. This is optional and needs to be supplied only if the gather operation on the given base name has to be performed more than once.

  • 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.

  • root_site: The sequence number of the central gather point (usually the locality id). This value is optional and defaults to 0.

template<typename T>
hpx::future<std::vector<decay_t<T>>> gather_there(communicator comm, T &&result, this_site_arg this_site = this_site_arg())

Gather a given value at the given call site

This function transmits the value given by result to a central gather site (where the corresponding gather_here is executed)

Return

This function returns a future holding a vector with all gathered values. It will become ready once the gather operation has been completed.

Parameters
  • comm: A communicator object returned from create_communicator

  • result: The value to transmit to the central gather point from this call site.

  • 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.