hpx/runtime_distributed/get_num_localities.hpp#

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

namespace hpx

Functions

hpx::future<std::uint32_t> get_num_localities(components::component_type t)#

Asynchronously return the number of localities which are currently registered for the running application.

The function get_num_localities asynchronously returns the number of localities currently connected to the console which support the creation of the given component type. The returned future represents the actual result.

See also

hpx::find_all_localities, hpx::get_num_localities

Note

This function will return meaningful results only if called from an HPX-thread. It will return 0 otherwise.

Parameters

t – The component type for which the number of connected localities should be retrieved.

std::uint32_t get_num_localities(launch::sync_policy, components::component_type t, error_code &ec = throws)#

Synchronously return the number of localities which are currently registered for the running application.

The function get_num_localities returns the number of localities currently connected to the console which support the creation of the given component type. The returned future represents the actual result.

See also

hpx::find_all_localities, hpx::get_num_localities

Note

This function will return meaningful results only if called from an HPX-thread. It will return 0 otherwise.

Parameters
  • t – The component type for which the number of connected localities should be retrieved.

  • ec – [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.