hpx/collectives/create_communicator.hpp#

Defined in header hpx/collectives/create_communicator.hpp.

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

namespace hpx

Top level HPX namespace.

namespace collectives

Top level HPX namespace.

Functions

communicator create_communicator(char const *basename, num_sites_arg num_sites = num_sites_arg(), this_site_arg this_site = this_site_arg(), generation_arg generation = generation_arg(), root_site_arg root_site = root_site_arg())#

Create a new communicator object usable with any collective operation

This functions creates a new communicator object that can be called in order to pre-allocate a communicator object usable with multiple invocations of any of the collective operations (such as all_gather, all_reduce, all_to_all, broadcast, etc.).

Parameters
  • basename – The base name identifying the collective operation

  • 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 collective operation performed on the given base name. This is optional and needs to be supplied only if the collective operation on the given base name has to be performed more than once.

  • root_site – The site that is responsible for creating the collective support object. This value is optional and defaults to ‘0’ (zero).

Returns

This function returns a new communicator object usable with the collective operation.

communicator create_local_communicator(char const *basename, num_sites_arg num_sites, this_site_arg this_site, generation_arg generation = generation_arg(), root_site_arg root_site = root_site_arg())#

Create a new communicator object usable with any local collective operation

This functions creates a new communicator object that can be called in order to pre-allocate a communicator object usable with multiple invocations of any of the collective operations (such as all_gather, all_reduce, all_to_all, broadcast, etc.).

Parameters
  • basename – The base name identifying the collective operation

  • num_sites – The number of participating sites

  • this_site – The sequence number of this invocation (usually the sequence number of the object participating in the collective operation). This value must be in the range [0, num_sites).

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

  • root_site – The site that is responsible for creating the collective support object. This value is optional and defaults to ‘0’ (zero).

Returns

This function returns a new communicator object usable for all local collective operations.

struct communicator#
#include <create_communicator.hpp>

A communicator instance represents the list of sites that participate in a particular collective operation.

Public Functions

void set_info(num_sites_arg num_sites, this_site_arg this_site) noexcept#

Store the number of used sites and the index of the current site for this communicator instance.

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

  • this_site – The sequence number of this site (usually the locality id).

std::pair<num_sites_arg, this_site_arg> get_info() const noexcept#

Retrieve the number of used sites and the index of the current site for this communicator instance.

bool is_root() const#

Return whether this communicator instance represents the root site of the communication operation.