hpx::collectives::create_channel_communicator#
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:
-
hpx::future<channel_communicator> hpx::collectives::create_channel_communicator(char const *basename, num_sites_arg num_sites = num_sites_arg(), this_site_arg this_site = this_site_arg())#
Create a new communicator object usable with peer-to-peer channel-based operations
This functions creates a new communicator object that can be called in order to pre-allocate a communicator object usable with multiple invocations of channel-based peer-to-peer operations.
Note
The caller must ensure that the communicator object returned by this function is kept alive (i.e., does not go out of scope) until all participating sites have successfully connected. Destroying the communicator before all sites have reached the creation point may cause the remaining sites to hang indefinitely. Consider using a barrier or similar synchronization mechanism after creating the communicator to ensure all sites are connected before allowing it to be destroyed.
- 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.
- Returns:
This function returns a future to a new communicator object usable with the collective operation. The future becomes ready after the local endpoint has been registered. It does not wait for all participating sites to create their communicators.
-
channel_communicator hpx::collectives::create_channel_communicator(hpx::launch::sync_policy, char const *basename, num_sites_arg num_sites = num_sites_arg(), this_site_arg this_site = this_site_arg())#
Create a new communicator object usable with peer-to-peer channel-based operations
This functions creates a new communicator object that can be called in order to pre-allocate a communicator object usable with multiple invocations of channel-based peer-to-peer operations.
Note
The caller must ensure that the communicator object returned by this function is kept alive (i.e., does not go out of scope) until all participating sites have successfully connected. Destroying the communicator before all sites have reached the creation point may cause the remaining sites to hang indefinitely. Consider using a barrier or similar synchronization mechanism after creating the communicator to ensure all sites are connected before allowing it to be destroyed.
- 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.
- Returns:
This function returns a new communicator object usable with the collective operation. It returns after the local endpoint has been registered and does not wait for all participating sites to create their communicators. It is not a global barrier.