hpx/agas_base/server/component_namespace.hpp

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

namespace hpx
namespace agas

Functions

naming::gid_type bootstrap_component_namespace_gid()
hpx::id_type bootstrap_component_namespace_id()
namespace server

AGAS’s primary namespace maps 128-bit global identifiers (GIDs) to resolved addresses.

The following is the canonical description of the partitioning of AGAS’s primary namespace.

|-----MSB------||------LSB-----|
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
|prefix||RC||----identifier----|

MSB        - Most significant bits (bit 64 to bit 127)
LSB        - Least significant bits (bit 0 to bit 63)
prefix     - Highest 32 bits (bit 96 to bit 127) of the MSB. Each
             locality is assigned a prefix. This creates a 96-bit
             address space for each locality.
RC         - Bit 88 to bit 92 of the MSB. This is the log2 of the number
             of reference counting credits on the GID.
             Bit 93 is used by the locking scheme for gid_types.
             Bit 94 is a flag which is set if the credit value is valid.
             Bit 95 is a flag that is set if a GID's credit count is
             ever split (e.g. if the GID is ever passed to another
             locality).
           - Bit 87 marks the gid such that it will not be stored in
             any of the AGAS caches. This is used mainly for ids
             which represent 'one-shot' objects (like promises).
identifier - Bit 64 to bit 86 of the MSB, and the entire LSB. The
             content of these bits depends on the component type of
             the underlying object. For all user-defined components,
             these bits contain a unique 88-bit number which is
             assigned sequentially for each locality. For
             \a hpx#components#component_runtime_support the high 24
             bits are zeroed and the low 64 bits hold the LVA of the
             component.
Note

The layout of the address space is implementation defined, and subject to change. Never write application code that relies on the internal layout of GIDs. AGAS only guarantees that all assigned GIDs will be unique.

The following address ranges are reserved. Some are either explicitly or implicitly protected by AGAS. The letter x represents a single-byte wild card.

00000000xxxxxxxxxxxxxxxxxxxxxxxx
    Historically unused address space reserved for future use.
xxxxxxxxxxxx0000xxxxxxxxxxxxxxxx
    Address space for LVA-encoded GIDs.
00000001xxxxxxxxxxxxxxxxxxxxxxxx
    Prefix of the bootstrap AGAS locality.
00000001000000010000000000000001
    Address of the primary_namespace component on the bootstrap AGAS
    locality.
00000001000000010000000000000002
    Address of the component_namespace component on the bootstrap AGAS
    locality.
00000001000000010000000000000003
    Address of the symbol_namespace component on the bootstrap AGAS
    locality.
00000001000000010000000000000004
    Address of the locality_namespace component on the bootstrap AGAS
    locality.

Variables

constexpr char const *const component_namespace_service_name = "component/"
struct component_namespace : public components::fixed_component_base<component_namespace>

Public Types

using mutex_type = hpx::spinlock
using base_type = components::fixed_component_base<component_namespace>
using component_id_type = components::component_type
using prefixes_type = std::set<std::uint32_t>
using component_id_table_type = std::unordered_map<std::string, component_id_type>
using factory_table_type = std::map<component_id_type, prefixes_type>

Public Functions

component_namespace()
void finalize()
void register_server_instance(char const *servicename, error_code &ec = throws)
void unregister_server_instance(error_code &ec = throws)
components::component_type bind_prefix(std::string const &key, std::uint32_t prefix)
components::component_type bind_name(std::string const &name)
std::vector<std::uint32_t> resolve_id(components::component_type key)
bool unbind(std::string const &key)
void iterate_types(iterate_types_function_type const &f)
std::string get_component_type_name(components::component_type type)
std::uint32_t get_num_localities(components::component_type type)

Public Members

counter_data counter_data_

Public Static Functions

static void register_counter_types(error_code &ec = throws)
static void register_global_counter_types(error_code &ec = throws)

Private Members

mutex_type mutex_
component_id_table_type component_ids_
factory_table_type factories_
component_id_type type_counter
std::string instance_name_
struct counter_data

Public Types

typedef hpx::spinlock mutex_type

Public Functions

HPX_NON_COPYABLE(counter_data)
counter_data()
std::int64_t get_bind_prefix_count(bool)
std::int64_t get_bind_name_count(bool)
std::int64_t get_resolve_id_count(bool)
std::int64_t get_unbind_name_count(bool)
std::int64_t get_iterate_types_count(bool)
std::int64_t get_component_type_name_count(bool)
std::int64_t get_num_localities_count(bool)
std::int64_t get_overall_count(bool)
std::int64_t get_bind_prefix_time(bool)
std::int64_t get_bind_name_time(bool)
std::int64_t get_resolve_id_time(bool)
std::int64_t get_unbind_name_time(bool)
std::int64_t get_iterate_types_time(bool)
std::int64_t get_component_type_name_time(bool)
std::int64_t get_num_localities_time(bool)
std::int64_t get_overall_time(bool)
void increment_bind_prefix_count()
void increment_bind_name_count()
void increment_resolve_id_count()
void increment_unbind_name_count()
void increment_iterate_types_count()
void increment_get_component_type_name_count()
void increment_num_localities_count()
void enable_all()

Public Members

api_counter_data bind_prefix_
api_counter_data bind_name_
api_counter_data resolve_id_
api_counter_data unbind_name_
api_counter_data iterate_types_
api_counter_data get_component_type_name_
api_counter_data num_localities_
struct api_counter_data

Public Functions

api_counter_data()

Public Members

std::atomic<std::int64_t> count_
std::atomic<std::int64_t> time_
bool enabled_