agas_base

The contents of this module can be included with the header hpx/modules/agas_base.hpp. These headers may be used by user-code but are not guaranteed stable (neither header location nor contents). You are using these at your own risk. If you wish to use non-public functionality from a module we strongly suggest only including the module header hpx/modules/agas_base.hpp, not the particular header in which the functionality you would like to use is defined. See Public API for a list of names that are part of the public HPX API.

namespace hpx

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.

namespace agas

Typedefs

using iterate_types_function_type = hpx::util::function<void(std::string const&, components::component_type)>

Variables

constexpr char const *const service_name = "/0/agas/"
constexpr const std::uint64_t booststrap_prefix = 0ULL
constexpr const std::uint64_t primary_ns_msb = 0x100000001ULL
constexpr const std::uint64_t primary_ns_lsb = 0x000000001ULL
constexpr const std::uint64_t component_ns_msb = 0x100000001ULL
constexpr const std::uint64_t component_ns_lsb = 0x000000002ULL
constexpr const std::uint64_t symbol_ns_msb = 0x100000001ULL
constexpr const std::uint64_t symbol_ns_lsb = 0x000000003ULL
constexpr const std::uint64_t locality_ns_msb = 0x100000001ULL
constexpr const std::uint64_t locality_ns_lsb = 0x000000004ULL
namespace components

Typedefs

using component_type = std::int32_t
namespace hpx

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.

namespace agas
struct component_namespace

Public Functions

virtual ~component_namespace()
virtual naming::address::address_type ptr() const = 0
virtual naming::address addr() const = 0
virtual naming::id_type gid() const = 0
virtual components::component_type bind_prefix(std::string const &key, std::uint32_t prefix) = 0
virtual components::component_type bind_name(std::string const &name) = 0
virtual std::vector<std::uint32_t> resolve_id(components::component_type key) = 0
virtual bool unbind(std::string const &key) = 0
virtual void iterate_types(iterate_types_function_type const &f) = 0
virtual std::string get_component_type_name(components::component_type type) = 0
virtual lcos::future<std::uint32_t> get_num_localities(components::component_type type) = 0
virtual void register_server_instance(std::uint32_t)
virtual void unregister_server_instance(error_code&)
server::component_namespace *get_service()
namespace hpx

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.

namespace agas

Functions

template<typename Char, typename Traits>
std::basic_ostream<Char, Traits> &operator<<(std::basic_ostream<Char, Traits> &os, gva const &addr)
struct gva

Public Types

using component_type = std::int32_t
using lva_type = std::uint64_t

Public Functions

gva()
gva(naming::gid_type const &p, component_type t = components::component_invalid, std::uint64_t c = 1, lva_type a = 0, std::uint64_t o = 0)
gva(naming::gid_type const &p, component_type t, std::uint64_t c, void *a, std::uint64_t o = 0)
gva(lva_type a)
gva(void *a)
gva &operator=(lva_type a)
gva &operator=(void *a)
bool operator==(gva const &rhs) const
bool operator!=(gva const &rhs) const
void lva(lva_type a)
void lva(void *a)
lva_type lva() const
lva_type lva(naming::gid_type const &gid, naming::gid_type const &gidbase) const
gva resolve(naming::gid_type const &gid, naming::gid_type const &gidbase) const

Public Members

naming::gid_type prefix
component_type type
std::uint64_t count
std::uint64_t offset

Private Functions

template<class Archive>
void save(Archive &ar, const unsigned int) const
template<class Archive>
void load(Archive &ar, const unsigned int version)

Private Members

lva_type lva_

Friends

friend hpx::agas::hpx::serialization::access
namespace hpx

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.

namespace agas
struct locality_namespace

Public Functions

virtual ~locality_namespace()
virtual naming::address::address_type ptr() const = 0
virtual naming::address addr() const = 0
virtual naming::id_type gid() const = 0
virtual std::uint32_t allocate(parcelset::endpoints_type const &endpoints, std::uint64_t count, std::uint32_t num_threads, naming::gid_type const &suggested_prefix) = 0
virtual void free(naming::gid_type const &locality) = 0
virtual std::vector<std::uint32_t> localities() = 0
virtual parcelset::endpoints_type resolve_locality(naming::gid_type const &locality) = 0
virtual std::uint32_t get_num_localities() = 0
virtual hpx::future<std::uint32_t> get_num_localities_async() = 0
virtual std::vector<std::uint32_t> get_num_threads() = 0
virtual hpx::future<std::vector<std::uint32_t>> get_num_threads_async() = 0
virtual std::uint32_t get_num_overall_threads() = 0
virtual hpx::future<std::uint32_t> get_num_overall_threads_async() = 0
virtual void register_server_instance(std::uint32_t)
virtual void unregister_server_instance(error_code&)
virtual server::locality_namespace *get_service()
namespace hpx

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.

namespace agas
struct primary_namespace

Public Types

typedef hpx::tuple<naming::gid_type, gva, naming::gid_type> resolved_type

Public Functions

primary_namespace()
~primary_namespace()
naming::address::address_type ptr() const
naming::address addr() const
naming::id_type gid() const
hpx::future<std::pair<naming::id_type, naming::address>> begin_migration(naming::gid_type const &id)
bool end_migration(naming::gid_type const &id)
bool bind_gid(gva const &g, naming::gid_type const &id, naming::gid_type const &locality)
future<bool> bind_gid_async(gva g, naming::gid_type id, naming::gid_type locality)
resolved_type resolve_gid(naming::gid_type const &id)
future<resolved_type> resolve_full(naming::gid_type id)
future<id_type> colocate(naming::gid_type id)
naming::address unbind_gid(std::uint64_t count, naming::gid_type const &id)
future<naming::address> unbind_gid_async(std::uint64_t count, naming::gid_type const &id)
future<std::int64_t> increment_credit(std::int64_t credits, naming::gid_type lower, naming::gid_type upper)
std::pair<naming::gid_type, naming::gid_type> allocate(std::uint64_t count)
void set_local_locality(naming::gid_type const &g)
void register_server_instance(std::uint32_t locality_id)
void unregister_server_instance(error_code &ec)
server::primary_namespace &get_service()

Public Static Functions

static naming::gid_type get_service_instance(std::uint32_t service_locality_id)
static naming::gid_type get_service_instance(naming::gid_type const &dest, error_code &ec = throws)
static naming::gid_type get_service_instance(naming::id_type const &dest)
static bool is_service_instance(naming::gid_type const &gid)
static bool is_service_instance(naming::id_type const &id)

Private Members

std::unique_ptr<server::primary_namespace> server_
namespace hpx

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.

namespace agas
struct symbol_namespace

Public Types

using server_type = server::symbol_namespace
using iterate_names_return_type = std::map<std::string, naming::id_type>

Public Functions

symbol_namespace()
~symbol_namespace()
naming::address_type ptr() const
naming::address addr() const
naming::id_type gid() const
hpx::future<bool> bind_async(std::string key, naming::gid_type gid)
bool bind(std::string key, naming::gid_type gid)
hpx::future<naming::id_type> resolve_async(std::string key) const
naming::id_type resolve(std::string key) const
hpx::future<naming::id_type> unbind_async(std::string key)
naming::id_type unbind(std::string key)
hpx::future<bool> on_event(std::string const &name, bool call_for_past_events, hpx::id_type lco)
hpx::future<iterate_names_return_type> iterate_async(std::string const &pattern) const
iterate_names_return_type iterate(std::string const &pattern) const
void register_server_instance(std::uint32_t locality_id)
void unregister_server_instance(error_code &ec)
server::symbol_namespace &get_service()

Public Static Functions

static naming::gid_type get_service_instance(std::uint32_t service_locality_id)
static naming::gid_type get_service_instance(naming::gid_type const &dest, error_code &ec = throws)
static naming::gid_type get_service_instance(naming::id_type const &dest)
static bool is_service_instance(naming::gid_type const &gid)
static bool is_service_instance(naming::id_type const &id)
static naming::id_type symbol_namespace_locality(std::string const &key)

Private Members

std::unique_ptr<server_type> server_
namespace hpx

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.

namespace agas

Functions

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

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 = lcos::local::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)
HPX_DEFINE_COMPONENT_ACTION(component_namespace, bind_prefix)
HPX_DEFINE_COMPONENT_ACTION(component_namespace, bind_name)
HPX_DEFINE_COMPONENT_ACTION(component_namespace, resolve_id)
HPX_DEFINE_COMPONENT_ACTION(component_namespace, unbind)
HPX_DEFINE_COMPONENT_ACTION(component_namespace, iterate_types)
HPX_DEFINE_COMPONENT_ACTION(component_namespace, get_component_type_name)
HPX_DEFINE_COMPONENT_ACTION(component_namespace, get_num_localities)

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 lcos::local::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_
namespace hpx

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.

namespace agas

Functions

naming::gid_type bootstrap_locality_namespace_gid()
naming::id_type bootstrap_locality_namespace_id()
namespace server

Variables

constexpr char const *const locality_namespace_service_name = "locality/"
struct locality_namespace : public components::fixed_component_base<locality_namespace>

Public Types

using mutex_type = lcos::local::spinlock
using base_type = components::fixed_component_base<locality_namespace>
using component_type = std::int32_t
using partition_type = hpx::tuple<parcelset::endpoints_type, std::uint32_t>
using partition_table_type = std::map<std::uint32_t, partition_type>

Public Functions

locality_namespace(primary_namespace *primary)
void finalize()
void register_server_instance(char const *servicename, error_code &ec = throws)
void unregister_server_instance(error_code &ec = throws)
std::uint32_t allocate(parcelset::endpoints_type const &endpoints, std::uint64_t count, std::uint32_t num_threads, naming::gid_type suggested_prefix)
parcelset::endpoints_type resolve_locality(naming::gid_type const &locality)
void free(naming::gid_type const &locality)
std::vector<std::uint32_t> localities()
std::uint32_t get_num_localities()
std::vector<std::uint32_t> get_num_threads()
std::uint32_t get_num_overall_threads()
HPX_DEFINE_COMPONENT_ACTION(locality_namespace, allocate)
HPX_DEFINE_COMPONENT_ACTION(locality_namespace, free)
HPX_DEFINE_COMPONENT_ACTION(locality_namespace, localities)
HPX_DEFINE_COMPONENT_ACTION(locality_namespace, resolve_locality)
HPX_DEFINE_COMPONENT_ACTION(locality_namespace, get_num_localities)
HPX_DEFINE_COMPONENT_ACTION(locality_namespace, get_num_threads)
HPX_DEFINE_COMPONENT_ACTION(locality_namespace, get_num_overall_threads)

Public Members

counter_data counter_data_

Private Members

mutex_type mutex_
std::string instance_name_
partition_table_type partitions_
std::uint32_t prefix_counter_
primary_namespace *primary_
struct counter_data

Public Types

typedef lcos::local::spinlock mutex_type

Public Functions

HPX_NON_COPYABLE(counter_data)
counter_data()
std::int64_t get_allocate_count(bool)
std::int64_t get_resolve_locality_count(bool)
std::int64_t get_free_count(bool)
std::int64_t get_localities_count(bool)
std::int64_t get_num_localities_count(bool)
std::int64_t get_num_threads_count(bool)
std::int64_t get_resolved_localities_count(bool)
std::int64_t get_overall_count(bool)
std::int64_t get_allocate_time(bool)
std::int64_t get_resolve_locality_time(bool)
std::int64_t get_free_time(bool)
std::int64_t get_localities_time(bool)
std::int64_t get_num_localities_time(bool)
std::int64_t get_num_threads_time(bool)
std::int64_t get_resolved_localities_time(bool)
std::int64_t get_overall_time(bool)
void increment_allocate_count()
void increment_resolve_locality_count()
void increment_free_count()
void increment_localities_count()
void increment_num_localities_count()
void increment_num_threads_count()
void enable_all()

Public Members

api_counter_data allocate_
api_counter_data resolve_locality_
api_counter_data free_
api_counter_data localities_
api_counter_data num_localities_
api_counter_data num_threads_
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_

Variables

HPX_ACTION_USES_MEDIUM_STACK ( hpx::agas::server::primary_namespace::allocate_action) HPX_REGISTER_ACTION_DECLARATION( hpx typedef std::pair<hpx::naming::id_type, hpx::naming::address> std_pair_address_id_type
namespace hpx

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.

namespace agas

Functions

naming::gid_type bootstrap_primary_namespace_gid()
naming::id_type bootstrap_primary_namespace_id()
namespace server

Variables

constexpr char const *const primary_namespace_service_name = "primary/"
struct primary_namespace : public components::fixed_component_base<primary_namespace>

Public Types

using mutex_type = lcos::local::spinlock
using base_type = components::fixed_component_base<primary_namespace>
using component_type = std::int32_t
using gva_table_data_type = std::pair<gva, naming::gid_type>
using gva_table_type = std::map<naming::gid_type, gva_table_data_type>
using refcnt_table_type = std::map<naming::gid_type, std::int64_t>
using resolved_type = hpx::tuple<naming::gid_type, gva, naming::gid_type>

Public Functions

primary_namespace()
void finalize()
void set_local_locality(naming::gid_type const &g)
void register_server_instance(char const *servicename, std::uint32_t locality_id = naming::invalid_locality_id, error_code &ec = throws)
void unregister_server_instance(error_code &ec = throws)
bool bind_gid(gva const &g, naming::gid_type id, naming::gid_type const &locality)
std::pair<naming::id_type, naming::address> begin_migration(naming::gid_type id)
bool end_migration(naming::gid_type const &id)
resolved_type resolve_gid(naming::gid_type const &id)
naming::id_type colocate(naming::gid_type const &id)
naming::address unbind_gid(std::uint64_t count, naming::gid_type id)
std::int64_t increment_credit(std::int64_t credits, naming::gid_type lower, naming::gid_type upper)
std::vector<std::int64_t> decrement_credit(std::vector<hpx::tuple<std::int64_t, naming::gid_type, naming::gid_type>> const &requests)
std::pair<naming::gid_type, naming::gid_type> allocate(std::uint64_t count)
HPX_DEFINE_COMPONENT_ACTION(primary_namespace, allocate)
HPX_DEFINE_COMPONENT_ACTION(primary_namespace, bind_gid)
HPX_DEFINE_COMPONENT_ACTION(primary_namespace, colocate)
HPX_DEFINE_COMPONENT_ACTION(primary_namespace, begin_migration)
HPX_DEFINE_COMPONENT_ACTION(primary_namespace, end_migration)
HPX_DEFINE_COMPONENT_ACTION(primary_namespace, decrement_credit)
HPX_DEFINE_COMPONENT_ACTION(primary_namespace, increment_credit)
HPX_DEFINE_COMPONENT_ACTION(primary_namespace, resolve_gid)
HPX_DEFINE_COMPONENT_ACTION(primary_namespace, unbind_gid)

Public Members

counter_data counter_data_

Private Types

using migration_table_type = std::map<naming::gid_type, hpx::tuple<bool, std::size_t, lcos::local::detail::condition_variable>>
using free_entry_allocator_type = util::internal_allocator<free_entry>
using free_entry_list_type = std::list<free_entry, free_entry_allocator_type>

Private Functions

void wait_for_migration_locked(std::unique_lock<mutex_type> &l, naming::gid_type const &id, error_code &ec)
resolved_type resolve_gid_locked(std::unique_lock<mutex_type> &l, naming::gid_type const &gid, error_code &ec)
void increment(naming::gid_type const &lower, naming::gid_type const &upper, std::int64_t &credits, error_code &ec)
void resolve_free_list(std::unique_lock<mutex_type> &l, std::list<refcnt_table_type::iterator> const &free_list, free_entry_list_type &free_entry_list, naming::gid_type const &lower, naming::gid_type const &upper, error_code &ec)
void decrement_sweep(free_entry_list_type &free_list, naming::gid_type const &lower, naming::gid_type const &upper, std::int64_t credits, error_code &ec)
void free_components_sync(free_entry_list_type &free_list, naming::gid_type const &lower, naming::gid_type const &upper, error_code &ec)

Private Members

mutex_type mutex_
gva_table_type gvas_
refcnt_table_type refcnts_
std::string instance_name_
naming::gid_type next_id_
naming::gid_type locality_
migration_table_type migrating_objects_
struct counter_data

Public Functions

HPX_NON_COPYABLE(counter_data)
counter_data()
std::int64_t get_bind_gid_count(bool)
std::int64_t get_resolve_gid_count(bool)
std::int64_t get_unbind_gid_count(bool)
std::int64_t get_increment_credit_count(bool)
std::int64_t get_decrement_credit_count(bool)
std::int64_t get_allocate_count(bool)
std::int64_t get_begin_migration_count(bool)
std::int64_t get_end_migration_count(bool)
std::int64_t get_overall_count(bool)
std::int64_t get_bind_gid_time(bool)
std::int64_t get_resolve_gid_time(bool)
std::int64_t get_unbind_gid_time(bool)
std::int64_t get_increment_credit_time(bool)
std::int64_t get_decrement_credit_time(bool)
std::int64_t get_allocate_time(bool)
std::int64_t get_begin_migration_time(bool)
std::int64_t get_end_migration_time(bool)
std::int64_t get_overall_time(bool)
void increment_bind_gid_count()
void increment_resolve_gid_count()
void increment_unbind_gid_count()
void increment_increment_credit_count()
void increment_decrement_credit_count()
void increment_allocate_count()
void increment_begin_migration_count()
void increment_end_migration_count()
void enable_all()

Public Members

api_counter_data bind_gid_
api_counter_data resolve_gid_
api_counter_data unbind_gid_
api_counter_data increment_credit_
api_counter_data decrement_credit_
api_counter_data allocate_
api_counter_data begin_migration_
api_counter_data end_migration_
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_
struct free_entry

Public Functions

free_entry(agas::gva gva, naming::gid_type const &gid, naming::gid_type const &loc)

Public Members

agas::gva gva_
naming::gid_type gid_
naming::gid_type locality_
namespace hpx

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.

namespace agas

Functions

naming::gid_type bootstrap_symbol_namespace_gid()
naming::id_type bootstrap_symbol_namespace_id()
namespace server

Variables

constexpr char const *const symbol_namespace_service_name = "symbol/"
struct symbol_namespace : public components::fixed_component_base<symbol_namespace>

Public Types

using mutex_type = lcos::local::spinlock
using base_type = components::fixed_component_base<symbol_namespace>
using iterate_names_return_type = std::map<std::string, naming::gid_type>
using gid_table_type = std::map<std::string, std::shared_ptr<naming::gid_type>>
using on_event_data_map_type = std::multimap<std::string, hpx::id_type>

Public Functions

symbol_namespace()
void finalize()
void register_server_instance(char const *servicename, std::uint32_t locality_id = naming::invalid_locality_id, error_code &ec = throws)
void unregister_server_instance(error_code &ec = throws)
bool bind(std::string key, naming::gid_type gid)
naming::gid_type resolve(std::string const &key)
naming::gid_type unbind(std::string const &key)
iterate_names_return_type iterate(std::string const &pattern)
bool on_event(std::string const &name, bool call_for_past_events, hpx::id_type lco)
HPX_DEFINE_COMPONENT_ACTION(symbol_namespace, bind)
HPX_DEFINE_COMPONENT_ACTION(symbol_namespace, resolve)
HPX_DEFINE_COMPONENT_ACTION(symbol_namespace, unbind)
HPX_DEFINE_COMPONENT_ACTION(symbol_namespace, iterate)
HPX_DEFINE_COMPONENT_ACTION(symbol_namespace, on_event)

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_
gid_table_type gids_
std::string instance_name_
on_event_data_map_type on_event_data_
struct counter_data

Public Types

typedef lcos::local::spinlock mutex_type

Public Functions

HPX_NON_COPYABLE(counter_data)
counter_data()
std::int64_t get_bind_count(bool)
std::int64_t get_resolve_count(bool)
std::int64_t get_unbind_count(bool)
std::int64_t get_iterate_names_count(bool)
std::int64_t get_on_event_count(bool)
std::int64_t get_overall_count(bool)
std::int64_t get_bind_time(bool)
std::int64_t get_resolve_time(bool)
std::int64_t get_unbind_time(bool)
std::int64_t get_iterate_names_time(bool)
std::int64_t get_on_event_time(bool)
std::int64_t get_overall_time(bool)
void increment_bind_count()
void increment_resolve_count()
void increment_unbind_count()
void increment_iterate_names_count()
void increment_on_event_count()
void enable_all()

Public Members

api_counter_data bind_
api_counter_data resolve_
api_counter_data unbind_
api_counter_data iterate_names_
api_counter_data on_event_
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_