naming_base

The contents of this module can be included with the header hpx/modules/naming_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/naming_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.

Defines

HPX_ADDRESS_VERSION
namespace hpx
namespace naming
struct address

Public Types

using component_type = naming::component_type
using address_type = naming::address_type

Public Functions

constexpr address()
constexpr address(gid_type const &l, component_type t = component_invalid)
address(gid_type const &l, component_type t, void *lva)
constexpr address(gid_type const &l, component_type t, address_type a)
address(void *lva, component_type t = component_invalid)
constexpr address(address_type a)
constexpr operator bool() const

Public Members

gid_type locality_
component_type type_ = component_invalid
address_type address_ = 0

Public Static Attributes

constexpr const component_type component_invalid = -1

Private Functions

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

Friends

friend hpx::naming::hpx::serialization::access

address (local virtual address)

friend constexpr bool operator==(address const &lhs, address const &rhs)

Defines

HPX_GIDTYPE_VERSION
template<>
struct hash<hpx::naming::gid_type>

Public Functions

std::size_t operator()(::hpx::naming::gid_type const &gid) const
namespace hpx
namespace naming

Functions

gid_type operator+(gid_type const &lhs, gid_type const &rhs)
gid_type operator-(gid_type const &lhs, gid_type const &rhs)
void save(serialization::output_archive &ar, gid_type const&, unsigned int)
void load(serialization::input_archive &ar, gid_type&, unsigned int version)
HPX_SERIALIZATION_SPLIT_FREE(gid_type)
gid_type get_gid_from_locality_id(std::uint32_t locality_id)
std::uint32_t get_locality_id_from_gid(std::uint64_t msb)
std::uint32_t get_locality_id_from_gid(gid_type const &id)
gid_type get_locality_from_gid(gid_type const &id)
bool is_locality(gid_type const &gid)
std::uint64_t replace_locality_id(std::uint64_t msb, std::uint32_t locality_id)
gid_type replace_locality_id(gid_type const &gid, std::uint32_t locality_id)
constexpr bool refers_to_virtual_memory(std::uint64_t msb)
constexpr bool refers_to_virtual_memory(gid_type const &gid)
constexpr bool refers_to_local_lva(gid_type const &gid)
gid_type replace_component_type(gid_type const &gid, std::uint32_t type)
std::ostream &operator<<(std::ostream &os, gid_type const &id)

Variables

HPX_INLINE_CONSTEXPR_VARIABLE const gid_type hpx::naming::invalid_gid = {}
struct gid_type
#include <gid_type.hpp>

Global identifier for components across the HPX system.

Subclassed by hpx::naming::detail::id_type_impl

Public Types

using size_type = gid_type
using difference_type = gid_type
using mutex_type = gid_type

Public Functions

constexpr gid_type()
constexpr gid_type(std::uint64_t lsb_id)
gid_type(std::uint64_t msb_id, std::uint64_t lsb_id)
constexpr gid_type(gid_type const &rhs)
constexpr gid_type(gid_type &&rhs)
~gid_type()
gid_type &operator=(std::uint64_t lsb_id)
gid_type &operator=(gid_type const &rhs)
gid_type &operator=(gid_type &&rhs)
constexpr operator bool() const
gid_type &operator++()
gid_type operator++(int)
gid_type &operator--()
gid_type operator--(int)
gid_type operator+=(gid_type const &rhs)
gid_type operator+=(std::uint64_t rhs)
gid_type operator-=(gid_type const &rhs)
gid_type operator-=(std::uint64_t rhs)
constexpr std::uint64_t get_msb() const
constexpr void set_msb(std::uint64_t msb)
constexpr std::uint64_t get_lsb() const
constexpr void set_lsb(std::uint64_t lsb)
void set_lsb(void *lsb)
std::string to_string() const
void lock()
bool try_lock()
void unlock()
mutex_type &get_mutex() const

Public Static Attributes

constexpr std::uint64_t credit_base_mask = 0x1full
constexpr std::uint16_t credit_shift = 24
constexpr std::uint64_t credit_mask = credit_base_mask << credit_shift
constexpr std::uint64_t was_split_mask = 0x80000000ull
constexpr std::uint64_t has_credits_mask = 0x40000000ull
constexpr std::uint64_t is_locked_mask = 0x20000000ull
constexpr std::uint64_t locality_id_mask = 0xffffffff00000000ull
constexpr std::uint16_t locality_id_shift = 32
constexpr std::uint64_t virtual_memory_mask = 0x3fffffull
constexpr std::uint64_t dont_cache_mask = 0x800000ull
constexpr std::uint64_t is_migratable = 0x400000ull
constexpr std::uint64_t dynamically_assigned = 0x1ull
constexpr std::uint64_t component_type_base_mask = 0xfffffull
constexpr std::uint64_t component_type_shift = 1ull
constexpr std::uint64_t component_type_mask = component_type_base_mask << component_type_shift
constexpr std::uint64_t credit_bits_mask = credit_mask | was_split_mask | has_credits_mask
constexpr std::uint64_t internal_bits_mask = credit_bits_mask | is_locked_mask | dont_cache_mask | is_migratable
constexpr std::uint64_t special_bits_mask = locality_id_mask | internal_bits_mask | component_type_mask

Private Types

using spinlock_pool = util::spinlock_pool<gid_type>

Private Functions

bool acquire_lock()
void relinquish_lock()
constexpr bool is_locked() const

Private Members

std::uint64_t id_msb_ = 0
std::uint64_t id_lsb_ = 0

Friends

gid_type operator+(gid_type const &lhs, gid_type const &rhs)
gid_type operator+(gid_type const &lhs, std::uint64_t rhs)
gid_type operator-(gid_type const &lhs, gid_type const &rhs)
gid_type operator-(gid_type const &lhs, std::uint64_t rhs)
gid_type operator&(gid_type const &lhs, std::uint64_t rhs)
bool operator==(gid_type const &lhs, gid_type const &rhs)
bool operator!=(gid_type const &lhs, gid_type const &rhs)
bool operator<(gid_type const &lhs, gid_type const &rhs)
bool operator>=(gid_type const &lhs, gid_type const &rhs)
bool operator<=(gid_type const &lhs, gid_type const &rhs)
bool operator>(gid_type const &lhs, gid_type const &rhs)
std::ostream &operator<<(std::ostream &os, gid_type const &id)
void save(serialization::output_archive &ar, gid_type const&, unsigned int)
void load(serialization::input_archive &ar, gid_type&, unsigned int version)
namespace std
template<>
struct hash<hpx::naming::gid_type>

Public Functions

std::size_t operator()(::hpx::naming::gid_type const &gid) const
template<>
struct get_remote_result<naming::id_type, naming::gid_type>

Public Static Functions

static naming::id_type call(naming::gid_type const &rhs)
template<>
struct promise_local_result<naming::gid_type>

Public Types

typedef naming::id_type type
template<>
struct get_remote_result<std::vector<naming::id_type>, std::vector<naming::gid_type>>

Public Static Functions

static std::vector<naming::id_type> call(std::vector<naming::gid_type> const &rhs)
template<>
struct promise_local_result<std::vector<naming::gid_type>>

Public Types

typedef std::vector<naming::id_type> type
namespace hpx
namespace naming

Functions

std::ostream &operator<<(std::ostream &os, id_type const &id)
char const *get_management_type_name(id_type::management_type m)
id_type get_id_from_locality_id(std::uint32_t locality_id)
std::uint32_t get_locality_id_from_id(id_type const &id)
id_type get_locality_from_id(id_type const &id)
bool is_locality(id_type const &id)
bool operator!=(id_type const &lhs, id_type const &rhs)
bool operator<=(id_type const &lhs, id_type const &rhs)
bool operator>(id_type const &lhs, id_type const &rhs)
bool operator>=(id_type const &lhs, id_type const &rhs)

Variables

const id_type invalid_id = id_type()
struct id_type

Public Types

enum management_type

Values:

unknown_deleter = -1
unmanaged = 0

unmanaged GID

managed = 1

managed GID

managed_move_credit = 2

managed GID which will give up all credits when sent

Public Functions

constexpr id_type()
id_type(std::uint64_t lsb_id, management_type t)
id_type(gid_type const &gid, management_type t)
id_type(std::uint64_t msb_id, std::uint64_t lsb_id, management_type t)
id_type(id_type const &o)
id_type(id_type &&o)
id_type &operator=(id_type const &o)
id_type &operator=(id_type &&o)
gid_type const &get_gid()
gid_type const &get_gid() const
id_type::management_type get_management_type() const
id_type &operator++()
id_type operator++(int)
operator bool() const
std::uint64_t get_msb() const
void set_msb(std::uint64_t msb)
std::uint64_t get_lsb() const
void set_lsb(std::uint64_t lsb)
void set_lsb(void *lsb)
void make_unmanaged() const
hpx::intrusive_ptr<detail::id_type_impl> &impl()
hpx::intrusive_ptr<detail::id_type_impl> const &impl() const

Private Members

hpx::intrusive_ptr<detail::id_type_impl> gid_

Friends

bool operator==(id_type const &lhs, id_type const &rhs)
bool operator!=(id_type const &lhs, id_type const &rhs)
bool operator<(id_type const &lhs, id_type const &rhs)
bool operator<=(id_type const &lhs, id_type const &rhs)
bool operator>(id_type const &lhs, id_type const &rhs)
bool operator>=(id_type const &lhs, id_type const &rhs)
std::ostream &operator<<(std::ostream &os, id_type const &id)
namespace traits
template<>
struct get_remote_result<naming::id_type, naming::gid_type>

Public Static Functions

static naming::id_type call(naming::gid_type const &rhs)
template<>
struct get_remote_result<std::vector<naming::id_type>, std::vector<naming::gid_type>>

Public Static Functions

static std::vector<naming::id_type> call(std::vector<naming::gid_type> const &rhs)
template<>
struct promise_local_result<naming::gid_type>

Public Types

typedef naming::id_type type
template<>
struct promise_local_result<std::vector<naming::gid_type>>

Public Types

typedef std::vector<naming::id_type> type
namespace hpx
namespace naming

Typedefs

using component_type = std::int32_t
using address_type = std::uint64_t

Variables

HPX_INLINE_CONSTEXPR_VARIABLE std::uint32_t hpx::naming::invalid_locality_id=            ~static_cast<std::uint32_t>(0)
HPX_INLINE_CONSTEXPR_VARIABLE std::int32_t hpx::naming::component_invalid = -1
namespace hpx
namespace naming

Functions

id_type unmanaged(id_type const &id)

The helper function hpx::unmanaged can be used to generate a global identifier which does not participate in the automatic garbage collection.

Return

This function returns a new global id referencing the same object as the parameter id. The only difference is that the returned global identifier does not participate in the automatic garbage collection.

Note

This function allows to apply certain optimizations to the process of memory management in HPX. It however requires the user to take full responsibility for keeping the referenced objects alive long enough.

Parameters
  • id: [in] The id to generated the unmanaged global id from This parameter can be itself a managed or a unmanaged global id.